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.
Related
Launching lib\main.dart on SM M013F in debug mode...
lib\main.dart:1
C:\fl\flutter.pub-cache\hosted\pub.dartlang.org\permission_handler-7.2.0\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 16s
Exception: Gradle task assembleDebug failed with exit code 1
Please make sure you have a backup of the project. The permission handler version seems to be too old. Please use version 10.0.0 (latest) if you are using flutter version > 3 or 8.3.0 if less than flutter version 3.. please update the version in pubspec.yaml and try again
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
below is the exception which I have found while building the flutter project (Clone from GitLab).
Launching lib\main.dart on A37fw in debug mode...
Running Gradle task 'assembleDebug'...
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
error: warnings found and -Werror specified
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':connectivity: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 21m 31s
Exception: Gradle task assembleDebug failed with exit code 1
I've solved my problem by downgrade my jdk version to 14 to 11.
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.
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.