0

Every time I run react-native run-android I get the following error:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
  - react-native-image-picker (to unlink run: "react-native unlink react-native-image-picker")

And then after I run the following command: react-native unlink react-native-image-picker, I still get the same error.

I deleted node_modules and ran npm i and still am getting the same error.

Do you all have any suggestions?

I am on Windows 10

1
  • Which version of react native you have used??? Commented Aug 25, 2019 at 5:35

2 Answers 2

1

The following code maybe helps you.

npm unlink react-native-image-picker
Sign up to request clarification or add additional context in comments.

1 Comment

This didn't resolve this issue. Thank you though! This is such a weird thing!
0

Try to manually unlink project in following files:

settings.gradle
MainApplication.java
app/build.gradle

Also be aware to remove project imports in MainApplication.java file and remove packages from List<ReactPackage>, Your getPackages method should be like this:

@Override
protected List<ReactPackage> getPackages() {
  @SuppressWarnings("UnnecessaryLocalVariable")
  List<ReactPackage> packages = new PackageList(this).getPackages();
  // Packages that cannot be autolinked yet can be added manually here, for example:
  // packages.add(new MyReactNativePackage());

  return packages;
}

Or use react-native unlink react-native-image-picker and then clean your project and build it again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.