cannot find symbol import com.google.android.gms.R - android

i'm getting this error "cannot find symbol import com.google.android.gms.R" while trying to execute app in android studio,
app was developed in eclipse and imported to android studio.
Error details:
symbol: class R
location: package com.google.android.gms
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:app:compileDebugJavaWithJavac FAILED
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.

Did you try Build->clean project and then Build->Rebuild project, File->Invalidate caches and restart. These may work, not sure. I used to do these steps usually for these kind of errors

Related

plain_notification_token failed to Compile in Flutter

I added this code to my flutter pubspec.yaml file
plain_notification_token:
git:
url: https://github.com/zionnite/plain_notification_token.git
but whenever I run the app on my android I encounter an error
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
/Users/apple/.pub-cache/git/plain_notification_token-3709a43167c63bd8f22570afe4fb21fe2e982c39/android/src/main/java/net/kikuchy/plain_notification_token/PlainNotificationTokenPlugin.java:77: error: local variable result is accessed from within inner class; needs to be declared final
result.success(null);
^
/Users/apple/.pub-cache/git/plain_notification_token-3709a43167c63bd8f22570afe4fb21fe2e982c39/android/src/main/java/net/kikuchy/plain_notification_token/PlainNotificationTokenPlugin.java:81: error: local variable result is accessed from within inner class; needs to be declared final
result.success(task.getResult().getToken());
^
Note: /Users/apple/.pub-cache/git/plain_notification_token-3709a43167c63bd8f22570afe4fb21fe2e982c39/android/src/main/java/net/kikuchy/plain_notification_token/PlainNotificationTokenPlugin.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 ':plain_notification_token: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 3m 41s
Exception: Gradle task assembleDebug failed with exit code 1
please how do i resolve this?
The original package was updated recently, perhaps try the official one from pub.dev - https://pub.dev/packages/plain_notification_token, instead of the forked one from GitHub.
plain_notification_token: 0.0.4

Flutter Project getting

Launching lib/main.dart on Redmi 4 in debug mode...
Running Gradle task 'assembleDebug'...
Note: /Users/mac/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-11.2.4/android/src/main/java/io/flutter/plugins/firebase/messaging/JobIntentService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/mac/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_share-2.0.0/android/src/main/java/com/example/fluttershare/FlutterSharePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Users/mac/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-6.1.3/android/src/main/java/com/baseflow/permissionhandler/ServiceManager.java:152: warning: [deprecation] getDefaultAdapter() in BluetoothAdapter has been deprecated
final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
^
error: warnings found and -Werror specified
1 error
1 warning
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':permission_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 39s
Exception: Gradle task assembleDebug failed with exit code 1
I am getting this issue on my project since 2 days, I have tried every solution provided in the google or stack overflow please help me out with this issue.
type
flutter clean
on your integrated terminal , and build again.

Getting error for KeyguardManager system service while developing finger print using ionic cordova and running on android

error: cannot find symbol
.getSystemService(this, KeyguardManager.class);
^
symbol: method getSystemService(BiometricActivity,Class<KeyguardManager>)
location: class ContextCompat
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
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
BUILD FAILED in 5s
> Task :app:compileDebugJavaWithJavac FAILED
24 actionable tasks: 1 executed, 23 up-to-date
E:\IONIC\Walkin\platforms\android\gradlew: Command failed with exit code 1 Error output:
E:\IONIC\Walkin\platforms\android\app\src\main\java\de\niklasmerz\cordova\biometric\BiometricActivity.java:89: error: cannot find symbol
.getSystemService(this, KeyguardManager.class);
^
symbol: method getSystemService(BiometricActivity,Class<KeyguardManager>)
location: class ContextCompat
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
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
BUILD FAILED in 5s
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --device exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.

React-native android studio Build Failed

When I do build->rebuild project the build fails in the android studio. I have the error message posted below. This is very strange because I didn't change anything, all I tried was to create a new AVD and the next thing you know trying to build it causes an error. Now I can't get it to run. I am hesitant to try some random quick fix because everything was working fine until I created a new AVD.
> Task :app:compileDebugJavaWithJavac FAILED
/Users/waltershub/Desktop/Fluz-Develop/fluzfluz-frontend/fluzclient/android/app/src/main/java/com/fluzclient/MainApplication.java:22: error: cannot find symbol
import io.branch.referral.Branch;
^
symbol: class Branch
location: package io.branch.referral
/Users/waltershub/Desktop/Fluz-Develop/fluzfluz-frontend/fluzclient/android/app/src/main/java/com/fluzclient/MainApplication.java:98: error: cannot find symbol
Branch.getAutoInstance(this);
^
symbol: variable Branch
location: class MainApplication
Note: /Users/waltershub/Desktop/Fluz-Develop/fluzfluz-frontend/fluzclient/android/app/src/main/java/com/fluzclient/MainActivity.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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.0-milestone-1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 19s
409 actionable tasks: 381 executed, 28 up-to-date
Branch SDK is not properly imported in your React project.
https://docs.branch.io/pages/apps/react-native/
Follow YARN installation to add dependencies in the project.

android studio run programs

I try an android studio. It is ok at the beginning. When I do a activity with many java content, it cannot run the program. It has the below error:
Gradle:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':ImageCropper:compileDebug'.
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.
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
After I comment the code it is ok. There is no problem with code. How to deal with this?

Categories

Resources