I'm fairly new to this and would like it if someone could like really dumb this down for me. I have been receiving these 4 errors constantly and its pretty frustrating.
I'm currently using Android Studio on a mac. These errors pop up when I try to create the build and I've tried searching online for this problem but this is what I found LINK and still did not help.
/Users/name/Desktop/test/game/BaseGameUtils/src/main/java/com/google/example/games/basegameutils/GameHelper.java
Error:(32, 39) error: package com.google.android.gms.appstate does not exist
Error:(293, 28) error: cannot find symbol variable AppStateManager
Error:(294, 30) error: cannot find symbol variable AppStateManager
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details. Error:Execution failed for task ':BaseGameUtils:compileDebugJava'.
> Compilation failed; see the compiler error output for details.
This doesn't allow me to create any build
Information:BUILD FAILED
/Users/name/Desktop/test/game/BaseGameUtils/src/main/java/com/google/example/games/basegameutils/GameHelper.java:32: error: package com.google.android.gms.appstate does not exist
import com.google.android.gms.appstate.AppStateManager;
^
/Users/name/Desktop/test/game/BaseGameUtils/src/main/java/com/google/example/games/basegameutils/GameHelper.java:293: error: cannot find symbol
builder.addApi(AppStateManager.API);
^
symbol: variable AppStateManager
location: class GameHelper
/Users/name/Desktop/test/game/BaseGameUtils/src/main/java/com/google/example/games/basegameutils/GameHelper.java:294: error: cannot find symbol
builder.addScope(AppStateManager.SCOPE_APP_STATE);
^
symbol: variable AppStateManager
location: class GameHelper
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':BaseGameUtils:compileDebugJava'.
> 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.
It seems that:
the package com.google.android.gms.appstate is not found. You haven't linked it to your program.
AppStateManager is not recognized, but it is the consequence of the first error.
Related
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
I can't setup properly what I am doing, let's explain as much as I can : I work with someone who started an Ignite project with the Andross package, I cloned the repo and tried to run the app using this tutorial, I did everything properly and was able to run my virtual device, but I had to chmod 777 my node_modules/ and my android/ for some reasons, and yet it won't work, I read here that i had to npm i jetifier but it didn't do much, tbh I have no idea what I'm doing, I really require help.
This is what I get when trying to react-native run-android :
react-native run-android
warn The following packages use deprecated "rnpm" config that will stop working from next release:
- react-native-vector-icons: https://github.com/oblador/react-native-vector-icons
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-device-info (to unlink run: "react-native unlink react-native-device-info")
- react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")
- react-native-i18n (to unlink run: "react-native unlink react-native-i18n")
- react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1007 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
> Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 1 executed, 26 up-to-date
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool<RNGestureHandlerEvent> EVENTS_POOL =
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool<RNGestureHandlerStateChangeEvent> EVENTS_POOL =
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
Note: /home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-gesture-handler: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 1s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool<RNGestureHandlerEvent> EVENTS_POOL =
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool<RNGestureHandlerStateChangeEvent> EVENTS_POOL =
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
Note: /home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-gesture-handler: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 1s
at checkExecSyncError (child_process.js:601:13)
at execFileSync (child_process.js:621:13)
at runOnAllDevices (/usr/local/lib/node_modules/react-native/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:75:39)
at buildAndRun (/usr/local/lib/node_modules/react-native/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:169:41)
at then.result (/usr/local/lib/node_modules/react-native/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:135:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
I will gladly give any other information you guys need to help me.
Latest version of react-native requires AndroidX. you have to jetify the project, until the maintainers updates their package, using:
npm install --save-dev jetifier && npx jetify
after that just
react-native run-android
i have some problems with my ionic project.
I wrote something like
ionic build android --release
And got mistake like:
:compileDebugJava
D:\myApps\mobileApp\shymbulak\platforms\android\src\org\apache\cordova\camera\CordovaUri.java:78: error: cannot find symbol
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
^
symbol: variable M
location: class VERSION_CODES
Note: D:\myApps\mobileApp\shymbulak\platforms\android\src\jp\phi\cordova\plugin\videoplayer\VideoPlayerPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileDebugJava'.
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: 3.078 secs
D:\myApps\mobileApp\shymbulak\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\myApps\mobileApp\shymbulak\platforms\android\gradlew cdvBuildDebug -b D:\myApps\mobileApp\shymbulak\platforms\android\build.gradle -
Dorg.gradle.daemon=true"
Error: cmd: Command failed with exit code 1
I have got the same problem. As a workaround, you can configure a fix dependecy for the camera plugin.
in package.json:
"cordovaPlugins": [
...
"cordova-plugin-camera#2.3.0",
...
I think you may be used the wrong version of the plug-in.
I am using this for configuring eclipse in windows 8.1. I compiled hadoop 2.7.2; when I entered
ant jar -Dversion=2.7.2 -Declipse.home=C:/eclips/eclipse -Dhadoop.home=D:/Hadoop/hadoop-2.7.2
Buildfile:C:\hadoop2x-eclipse-plugin\src\contrib\eclipse-plugin\build.xml
I got lots of errors. I don't know where I should find compiler output and what is NewDriverWizard?
pache\hadoop\eclipse\NewDriverWizard.java:22: error: package org.eclipse.core.ru
ntime does not exist
[javac] C:\hadoop2x-eclipse-plugin\src\contrib\eclipse-plugin\src\java\org\a
pache\hadoop\eclipse\NewDriverWizard.java:24: error: package org.eclipse.jdt.cor
e does not exist
[javac] C:\hadoop2x-eclipse-plugin\src\contrib\eclipse-plugin\src\java\org\a
pache\hadoop\eclipse\NewDriverWizard.java:25: error: package org.eclipse.jdt.int
ernal.ui.wizards does not exist
.
.
.
BUILD FAILED
C:\hadoop2x-eclipse-plugin\src\contrib\eclipse-plugin\build.xml:76: Compile fail
ed; see the compiler error output for details.
I'll copy and paste the message from the message gradle build.
Error:(14, 5) error: illegal start of expression
Error:(14, 12) error: illegal start of expression
Error:(14, 28) error: ';' expected
Error:(14, 35) error: ';' expected
Error:(18, 2) error: reached end of file while parsing
:app:compileDebugJavaWithJavac FAILED
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Information:BUILD FAILED
Information:Total time: 15.311 secs
Information:6 errors
Information:0 warnings
Information:See complete output in console
What IDE you use?
Re-check your code. There must be few lines with marked by red cross or similar. In error it says few semicolons are missing. You may probably forgot to put semicolons or it may be just caused from bracket/braces structure error. Just check the marked lines and few lines above and below.
And if you put your code here, it might help others to help you.
Clean or Rebuild the project. This error can be solved.