React-native-image-picker: linking image picker causes error when build

Created on 8 Aug 2017  路  3Comments  路  Source: react-native-image-picker/react-native-image-picker

Hello,
I created a project

react-native init test

After this run this command

npm install react-native-image-picker@latest --save
react-native link

Here is the error...

C:\Users\ozer\Desktoprntest33node_modulesreact-native-image-picker\android\srcmain\java\com\imagepicker\ImagePickerPackage.java:34: error: method does not override or implement a method from a supertype
@Override
^
:react-native-image-picker:compileReleaseJavaWithJavac FAILED
1 error

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-image-picker:compileReleaseJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Also guys, I get this error all packages just not to this..

react-native-cli: 2.0.1
react-native: 0.47.1

All 3 comments

I do everything, tried all solution ways. But still same errors... I can't link projects, always gives error.

react-native 0.47 deprecated createJSModules with https://github.com/facebook/react-native/issues/15232
many PR is waiting to be merged to solve this #661 #657 #653 #649

fastest way to fix this issue is to go to the __PROJECT_ROOT__/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/ImagePickerPackage.java

and remove line 34 - 37

@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
    return Collections.emptyList();
}

Fixed in 0.26.4

Was this page helpful?
0 / 5 - 0 ratings