Android need this step
// file: MainApplication.java
...import com.reactnative.picker.PickerPackage; // import package
public class MainApplication extends ReactApplication {
...
/**
- A list of packages used by the app. If the app uses additional views
- or modules besides the default ones, add more packages here.
*/
@Override
protected ListgetPackages() {
return Arrays.asList(
new MainReactPackage(),
new PickerPackage() // Add package
);
}
...
}
It's not included in final version documentation
you don't have to use this if you run react-native link <package-name>. That step is required if you are doing manual installation/linking of package.
Sorry but it is preferable to add one more step on the documentation to install correctly react-native-image-crop-picker for Android in case of doubt.
Indeed, running the following command react-native link <package> don't modify the MainApplication.java file when our android package name have been renamed.
As said @sherwinWatson, we need to add few lines to our MainApplication.java for the package to work. For me, it was :
import com.reactnative.ivpusic.imagepicker.PickerPackage;
And in the getPackages() method :
new PickerPackage()
1 more step:
add following to file android/app/build.gradle
dependencies {
.....
compile project(':react-native-image-crop-picker')
.....
}
Thank you!!!
Thanks!
Most helpful comment
Sorry but it is preferable to add one more step on the documentation to install correctly
react-native-image-crop-pickerfor Android in case of doubt.Indeed, running the following command
react-native link <package>don't modify theMainApplication.javafile when our android package name have been renamed.As said @sherwinWatson, we need to add few lines to our
MainApplication.javafor the package to work. For me, it was :And in the
getPackages()method :