Closed DtheRock closed 2 years ago
Compilation failed; see the compiler error output for details.
As the error message says, the compiler is telling where it failed above. We need the full error message in order to support you here.
Please check the below error message. If you want the full log file let me know to upload it here.
"2022-07-21T23:31:08.6115330Z - Gradle detected a problem with the following location: '/Users/runner/work/1/s/android/app/build/intermediates/merged_assets/release/out'. Reason: Task ':app:compressReleaseAssets' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/***guide/validation_problems.html#implicit_dependency for more details about this problem.
2022-07-21T23:31:08.6199690Z /Users/runner/work/1/s/android/app/src/main/java/com/app/MainApplication.java:55: error: cannot find symbol
2022-07-21T23:31:08.6201380Z return mNewArchitectureNativeHost;
2022-07-21T23:31:08.6202150Z ^
2022-07-21T23:31:08.6202810Z symbol: variable mNewArchitectureNativeHost
2022-07-21T23:31:08.6203530Z location: class MainApplication
2022-07-21T23:31:08.6204520Z /Users/runner/work/1/s/android/app/src/main/java/com/app/MainActivity.java:41: error: method does not override or implement a method from a supertype
2022-07-21T23:31:08.6205450Z @Override
2022-07-21T23:31:08.6206030Z ^
2022-07-21T23:31:08.6206810Z Note: /Users/runner/work/1/s/android/app/src/main/java/com/app/MainApplication.java uses or overrides a deprecated API.
2022-07-21T23:31:08.6351420Z Note: Recompile with -Xlint:deprecation for details.
2022-07-21T23:31:08.6352660Z 2 errors
2022-07-21T23:31:09.3963880Z w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
2022-07-21T23:31:09.4065050Z
2022-07-21T23:31:09.4166920Z Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
2022-07-21T23:31:09.4268110Z
2022-07-21T23:31:09.4346220Z You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
2022-07-21T23:31:09.4354850Z
2022-07-21T23:31:09.4355920Z See https://docs.gradle.org/7.3.3/***guide/command_line_interface.html#sec:command_line_warnings
2022-07-21T23:31:09.4356610Z
2022-07-21T23:31:09.4357460Z Execution optimizations have been disabled for 7 invalid unit(s) of work during this build to ensure correctness.
2022-07-21T23:31:09.4358360Z Please consult deprecation warnings for more details.
2022-07-21T23:31:09.4359700Z 434 actionable tasks: 413 executed, 21 up-to-date
2022-07-21T23:31:09.4360240Z
2022-07-21T23:31:09.4360860Z FAILURE: Build failed with an exception.
2022-07-21T23:31:09.4361330Z
2022-07-21T23:31:09.4361890Z What went wrong:
2022-07-21T23:31:09.4363040Z Execution failed for task ':app:compileReleaseJavaWithJavac'.
2022-07-21T23:31:09.4364000Z > Compilation failed; see the compiler error output for details.
2022-07-21T23:31:09.4364520Z
2022-07-21T23:31:09.4365050Z Try:
2022-07-21T23:31:09.4366110Z > Run with --stacktrace option to get the stack trace.
2022-07-21T23:31:09.4367330Z > Run with --info or --debug option to get more log output.
2022-07-21T23:31:09.4368480Z > Run with --scan to get full insights.
2022-07-21T23:31:09.4368960Z
2022-07-21T23:31:09.4370030Z * Get more help at https://help.gradle.org
2022-07-21T23:31:09.4370480Z
2022-07-21T23:31:09.4371070Z BUILD FAILED in 8m 2s
2022-07-21T23:31:10.0066680Z Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1
2022-07-21T23:31:10.0097020Z at ChildProcess.
That's the error:
/Users/runner/work/1/s/android/app/src/main/java/com/app/MainActivity.java:41: error: method does not override or implement a method from a supertype
At line 41 in your MainActivity you have an @Override
for a method that is missing in the superclass.
Closing as I consider this resolved. Feel free to reopen if not.
@cortinico I am also facing the same issue after making a new fresh react native app. Is there something we need to change?
+1
Hey @cortinico could you consider re-open the issue, seems like is still happening by using npx react-native run-android --variant=release
/ ./gradlew assembleRelease
/ ./gradlew clean :app:assembleRelease
, I'm currently using the version 0.68.3.
In the beginning, I thought that was due to the gradle version, now I'm using the same version of build.grade: 7.0.4
but it continues without working, even following exactly the versions from react native upgrade helper.
related issue 1 related issue 2
The only way to generate a release version is by following this post, but I think is not the right way to do it.
I would like to know if the problem is related to "react.gradle" / "react-native-gradle-plugin" / "metro bundler" any idea?
System:
OS: macOS 12.5
CPU: (8) arm64 Apple M1
Memory: 109.53 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
Watchman: 2022.09.05.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/myuser/.rvm/gems/ruby-3.1.1/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.3 => 0.68.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Thanks a lot.
Description
I keep getting the below error after upgrading my rn app to 0.68.2.
Version
0.68.2
Output of
npx react-native info
Steps to reproduce
Build android with rn 0.68.2
Snack, code example, screenshot, or link to a repository
My android/app/build.gradle file
My android/build.gradle file
My android/app/src/main/java/com/app/MainApplication.java file