question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android : Build failed in react-native@0.47.0-rc.1

See original GitHub issue

Description :

I am getting the following error on android.

:react-native-svg:compileReleaseJavaWithJavac
:react-native-svg:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).

/Users/ayushnawani/Project/SvgTest/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/SvgPackage.java:47: error: method does not override or implement a method from a supertype
    @Override
    ^
1 error

:react-native-svg:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-svg: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.

BUILD FAILED

Total time: 13.679 secs

Dependencies :

		"react": "16.0.0-alpha.12",
		"react-native": "0.47.0-rc.1",
		"react-native-svg": "5.3.0"

Suggested Solution :

In react-native@0.47.0-rc.1, ReactPackager interface is updated and it does not contain the following method

public List<Class<? extends JavaScriptModule>> createJSModules() 

i fixed this error in my project by removing createJSModules method from SvgPackage.java

Sent Pull Request : #398

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:8

github_iconTop GitHub Comments

2reactions
doomsowercommented, Jul 22, 2017

I think it landed too soon, because with react-native@0.46.4 and react-native-svg@5.3.1 the override is missing and causes this:

:react-native-svg:compileReleaseJavaWithJavac
:react-native-svg:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/path/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/SvgPackage.java:23: error: SvgPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class SvgPackage implements ReactPackage {
       ^

Had to revert to 5.3.0

2reactions
magicismightcommented, Jul 12, 2017

Merged in this branch https://github.com/react-native-community/react-native-svg/tree/5.4.0

Will land on master after 0.47.0 is released

Read more comments on GitHub >

github_iconTop Results From Across the Web

[HAS WORKAROUND] Android build fails since 0.71.0-rc.0 tag ...
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction > 2 files found ...
Read more >
React Native Android build failure with different errors without ...
The build failures for Android was due to the publish of the React Native version 0.71.0-rc0 . Note: Error may be different but...
Read more >
Android App build error - I have no idea what to do
Hi, unfortunately, I now always get an error when I try to build an Android app (both with runtime version 4.5.12 and version...
Read more >
Upstream issue with React-Native release causing all Android ...
A fix has been implemented for Expo SDK 43 through 47 (beta). We are monitoring Android build results. IDENTIFIED at 11/04/2022 02:43PM. We...
Read more >
Build error on android with the latest 4.0.0 version
When building the last 4.0.0 release with "react-native": 0.70.5 we're getting this conflict about androidx.appcompat:appcompat:1.1.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found