Tell us which versions you are using:
After running your recommended steps for installation the application should run.
npm i react-native-image-crop-picker --save
react-native link react-native-image-crop-pickerActual behaviour
After executing "react-native run-android" following error occurs:
E:(...)\MainApplication.java:8: error: package com.reactnative.ivpusic.imagepicker does not exist
import com.reactnative.ivpusic.imagepicker.PickerPackage;
^
E:(...)\MainApplication.java:31: error: cannot find symbol
new PickerPackage(),
^
symbol: class PickerPackage
2 errorsSteps to reproduce
I noticed in your example project there are lines that are missing in mine, for example:
settings.gradle:
include ':react-native-image-crop-picker'
project(':react-native-image-crop-picker').projectDir = new File(settingsDir, '../../android')"
app/build.gradle:
dependencies {
(...)
compile project(':react-native-image-crop-picker')
}
However it still fails with:
A problem occurred configuring project ':app'.
Cannot evaluate module react-native-image-crop-picker : Configuration with name 'default' not >found."
Here is my MainApplication.java:
package com.stampowlapp;
import android.app.Application;
import android.util.Log;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactApplication;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.imagepicker.ImagePickerPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new PickerPackage(),
new VectorIconsPackage(),
new ImagePickerPackage() // <-- add this line
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}
tried
npm i react-native-image-crop-picker --save
react-native link react-native-image-crop-picker
react-native run-android
on brand-new project and it works. Try gradle clean / force gradle sync if you had old version before
Does it includes the entries in settings.gradle and app/build.gradle?
yes, this is included
// settings.gradle
project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android')
// app/build.gradle
compile project(':react-native-image-crop-picker')
@kuhbaar any updates here?
I tried unlinking and removing the package and installing/linking again, but still no success with automatic linking.
Solved it manually though, just added the lines above.
Just attempted to install on an existing project with other linked libraries, and can confirm that the link install does not fully install.
As above, manually adding the following lines fixes it:
// app/build.gradle
compile project(':react-native-image-crop-picker')
//settings.gradle
include ':react-native-image-crop-picker'
project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android')
You should update the install instructions, or fix the linking. I don't know package managers well enough to help :(
same issue here.
Most helpful comment
Just attempted to install on an existing project with other linked libraries, and can confirm that the link install does not fully install.
As above, manually adding the following lines fixes it:
// app/build.gradle
compile project(':react-native-image-crop-picker')//settings.gradle
include ':react-native-image-crop-picker'project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android')You should update the install instructions, or fix the linking. I don't know package managers well enough to help :(