React-native-image-crop-picker: Installation documentation for Android

Created on 26 Apr 2017  路  5Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

  • react-native-image-crop-picker v0.13.0
  • react-native v0.41.2

Platform

  • Android

Expected behaviour

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 List getPackages() {
    return Arrays.asList(
    new MainReactPackage(),
    new PickerPackage() // Add package
    );
    }
    ...
    }

It's not included in final version documentation

Most helpful comment

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()

All 5 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhangjunhou picture zhangjunhou  路  3Comments

habovh picture habovh  路  3Comments

aterribili picture aterribili  路  3Comments

co-de picture co-de  路  3Comments

tximpa91 picture tximpa91  路  3Comments