Error React Native run Android - Task :app:compileDebugJavaWithJavac FAILED

Viewed 583

I have an app running perfectly on iOS but when I try to run on Android, I get the Task :app:compileDebugJavaWithJavac FAILED error, tried some internet solutions but nothing solved the problem. When I run npx react-native run-android I get the error below:


Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
368 actionable tasks: 2 executed, 366 up-to-date
/Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:120: error: cannot find symbol
      new AppCenterReactNativeAnalyticsPackage(getApplication(), getResources().getString(com.empathoapp.R.string.appCenterAnalytics_whenToEnableAnalytics)),
                                                                                                                 ^
  symbol:   variable appCenterAnalytics_whenToEnableAnalytics
  location: class string
/Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:121: error: cannot find symbol
      new AppCenterReactNativeCrashesPackage(getApplication(), getResources().getString(com.empathoapp.R.string.appCenterCrashes_whenToSendCrashes)),
                                                                                                               ^
  symbol:   variable appCenterCrashes_whenToSendCrashes
  location: class string
Note: /Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/src/debug/java/com/empathoapp/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> 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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 39s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:120: error: cannot find symbol
      new AppCenterReactNativeAnalyticsPackage(getApplication(), getResources().getString(com.empathoapp.R.string.appCenterAnalytics_whenToEnableAnalytics)),
                                                                                                                 ^
  symbol:   variable appCenterAnalytics_whenToEnableAnalytics
  location: class string
/Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:121: error: cannot find symbol
      new AppCenterReactNativeCrashesPackage(getApplication(), getResources().getString(com.empathoapp.R.string.appCenterCrashes_whenToSendCrashes)),
                                                                                                               ^
  symbol:   variable appCenterCrashes_whenToSendCrashes
  location: class string
Note: /Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/src/debug/java/com/empathoapp/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.```

Tried to change JAVA PATH, I have no idea what could I do to fix that
0 Answers
Related