Hi. I have created a fresh react native project with react-native init and add realm yard add realm. Then linked react-native link realm. I have set the android build tools for 25. When I run ios it is fine but when I run android the build fails:
RealmReactPackage.java:18: error: method does not override or implement a method from a supertype
@Override
^
RealmReactModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:realm:compileReleaseJavaWithJavac FAILED
I have checked the settings.gradle and build.gradle and everything is at it should be according to realm doc.
I am also having this issue.
I have the same issue. The only one difference is that I upgraded versions of react, react-native and realm for the existing project. Previous react-native version was 0.44 (Realm worked with this version).
Is there a way to fix it?
+1
The same issue here. Not able to build
Realm: 1.10.1
React Native: 0.47.1
.......
:realm:mergeReleaseResources
:realm:processReleaseManifest
:realm:processReleaseResources
:realm:generateReleaseSources
:realm:incrementalReleaseJavaCompilationSafeguard
:realm:compileReleaseJavaWithJavac
:realm:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/home/brano/Programming/Servio/node_modules/realm/android/src/main/java/io/realm/react/RealmReactPackage.java:18: error: method does not override or implement a method from a supertype
@Override
^
Note: /home/brano/Programming/Servio/node_modules/realm/android/src/main/java/io/realm/react/RealmReactModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:realm:compileReleaseJavaWithJavac FAILEDFAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':realm:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
After one day trying I think it's working now for me, I can build and develop finally without bugs.
This helped me:
"react-native": "0.46.0","realm": "1.10.0"rm -r node_modules/npm iThen it started working. Maybe also uninstall&install of app on device would be needed.
As the build output highlights, the problem is on overriding the method that you will find on the RealmReactModule.java under "node_modules/realm/android/src/main/java/io/realm/react", you need to change this on line 18:
@Override
public List
return Collections.emptyList();
}
to this :
// @Override
public List
return Collections.emptyList();
}
It worked for me !
@aminesig Thank you for your solution! But it's not a good practice to make changes to the node modules.
I believe it is fixed by #1178 but it hasn't be released yet.
@aminesig This did came on my mind, but when I want to deploy it to CI it would download/upgrade the library so this error would persist outside development machine.
I hope we have time to do a release today or tomorrow.
I have the same problem using [email protected], [email protected]
We have released 1.10.3. Please upgrade as we believe #1178 fixes it.
@kneth Thank you! It seems it's working now
Most helpful comment
I hope we have time to do a release today or tomorrow.