Flutter-how to solve thisin flutter? - android

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

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.

Flutter Bluetooth giving error when app run in permission handling

Pub get
The plugins flutter_twitter_login use a deprecated
version of the Android embedding. To avoid unexpected runtime
failures, or future build failures, try to see if these plugins
support the Android V2 embedding. Otherwise, consider removing them
since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the
plugin to the V2 embedding:
https://flutter.dev/go/android-plugin-migration.
Run Console
C:\src\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 warning
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':permission_handler:compileReleaseJavaWithJavac'.
> 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 4m 37s
try putting this command in the console to update to the latest version of the plugin
flutter pub upgrade --major-versions

Gradle failed while building the flutter project

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.

"No matching client found for package name ..." since I added firebase in my project

When I tried to launch my code on a virtual device, I've got this error:
Launching lib\main.dart on sdk gphone x86 arm in debug mode... Running
Gradle task 'assembleDebug'... Invalid depfile:
C:\Users\mchev\AndroidStudioProjects\fll_score_brainstormers.dart_tool\flutter_build\3ed18d41ff56fda06725619fd750edaa\kernel_snapshot.d Invalid depfile:
C:\Users\mchev\AndroidStudioProjects\fll_score_brainstormers.dart_tool\flutter_build\3ed18d41ff56fda06725619fd750edaa\kernel_snapshot.d
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
No matching client found for package name 'com.PhilippesGames.fll_score_brainstormers'
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 8m 17s
Exception: Gradle task assembleDebug failed with exit code 1
can you please help me ?

Categories

Resources