for using data in clients I added a hive package to my project
dependencies:
hive: ^2.2.3
hive_flutter: ^1.1.0
dev_dependencies:
hive_generator: ^1.1.3
build_runner: ^2.3.0
after the pub and running debug I got this error
**
Launching lib\main.dart on sdk gphone x86 in debug mode...
lib\main.dart:1
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':path_provider_android'.
Could not resolve all files for configuration ':path_provider_android:classpath'.
Could not find builder-3.3.0.jar (com.android.tools.build:builder:3.3.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.3.0/builder-3.3.0.jar
Could not find protos-26.3.0.jar (com.android.tools.analytics-library:protos:26.3.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/protos/26.3.0/protos-26.3.0.jar
Failed to notify project evaluation listener.
2
Could not get unknown property 'android' for project ':path_provider_android' of type org.gradle.api.Project.
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 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
**
Flutter is already up to date on channel stable
Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision eb6d86ee27 (8 days ago) • 2022-10-04 22:31:45 -0700
Engine • revision c08d7d5efc
Tools • Dart 2.18.2 • DevTools 2.15.0**
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.19042.2006], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2022 17.0.4)
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.72.1)
[√] Connected device (4 available)
[√] HTTP Host Availability
Also, I downloaded protos-26.3.0.jar and builder-3.3.0.jar and run these files but it did not happen.
what I missed?
maybe hive_flutter is an older project and not the updated one,
remove hive_flutter try to Go with hive only.
Related
just created new flutter project with the command flutter create test.
When start it failed with this error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file 'D:\sandbox\mobile-app\sheba\testapp\android\settings.gradle' (C:\Users\grebe\.gradle\caches\7.4\scripts\ea4ydi90mwjg9g63m7r6nimmx).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63
* 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 5s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Device: Emulated Android 12
Flutter doctor output is:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [version 10.0.22621.1105], locale fr-FR)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.15)
[!] Android Studio (version 2022.1)
X Unable to find bundled Java version.
[√] VS Code (version 1.74.3)
[√] Connected device (4 available)
[√] HTTP Host Availability
! Doctor found issues in 1 category.
Thanks for help :)
run " --flutter doctor " and share the result
is it your first project with flutter on your device ?
Also mention what is your device and it's OS version.
Problem: [!] Android Studio (version 2022.1) X Unable to find bundled Java version.
answer : Go to "C:\Program Files\Android\Android Studio" and then copy the content of jbr and paste the content into jre folder run doctor again
just change your gradle version to 7.6 .
follow the steps 1android>gradle>gradle-property
check this line distributionUrl=https://services.gradle.org/distributions/gradle-7.6-all.zip)
this 7.6 should not be 7.4 or less
Fail log
gw assembleDebug --scan
> Task :app:checkDebugDuplicateClasses FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class io.flutter.plugins.GeneratedPluginRegistrant found in modules flutter_debug-1.0-runtime (com.example.a.library_a:flutter_debug:1.0) and flutter_debug-2.0-runtime (com.example.b.library_b:flutter_debug:2.0)
Go to the documentation to learn how to Fix dependency resolution errors.
Steps to reproduce;
flutter create -t module --org com.example.a library_a
cd library_a
flutter pub add android_intent_plus
flutter build aar
cd ..
flutter create -t module --org com.example.b library_b
cd library_a
flutter pub add android_intent_plus
// Open pubspec.yaml and change android_intent_plus to 1.0.1
flutter build aar --build-number=2.0
Add both library_a and library_b to an android project. (I tested with a new project)
Build fails with duplicate class.
flutter doctor;
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 12.5.1 21G83 darwin-arm, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[!] Android Studio
✗ Unable to find bundled Java version.
[!] Android Studio
✗ Unable to find bundled Java version.
[!] Android Studio
✗ Unable to find bundled Java version.
[✓] Android Studio (version 2021.3)
[!] Android Studio
✗ Unable to find bundled Java version.
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2.3)
[✓] VS Code (version 1.74.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
I am flutter developer and I use pay plugin to integrate google pay in my app
first I was using olde kotlin version so I update to latest version
after update version of kotlin google pay button throw error I don't know what went wrong after doing flutter clean when I try to run my code it throw me error like I mention below can anyone suggess me how to deal with it
Here is error log:-
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> java.lang.OutOfMemoryError (no error message)
* 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 58s
Exception: Gradle task assembleDebug failed with exit code 1
Here is my flutter doctor result:-
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.5.2 20G95 darwin-x64, locale
en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.2)
[✓] VS Code (version 1.59.1)
[✓] Connected device (2 available)
I created a new flutter project and when run it, it gives that error
Target kernel_snapshot failed: Exception: The value of -DDartDefines is not formatted correctly.
The value must be a JSON-encoded list of strings but was:
[flutter.inspector.structuredErrors=true]
build failed.
FAILURE: Build failed with an exception.
* Where:
Script 'D:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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
Exception: Gradle task assembleDebug failed with exit code 1
I have tried flutter clean, and same error
flutter doctor log :
D:\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel master, v1.16.4-pre.69, on Microsoft Windows [Version 10.0.18363.959], locale en-US)
• Flutter version 1.16.4-pre.69 at D:\flutter
• Framework revision 19e7db585d (4 months ago), 2020-04-01 11:16:01 -0700
• Engine revision c9506cb8e9
• Dart version 2.8.0 (build 2.8.0-dev.18.0 eea9717938)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\user\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[!] VS Code (version 1.47.2)
• VS Code at C:\Users\user\AppData\Local\Programs\Microsoft VS Code
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
Process finished with exit code 0
According to what flutter doctor is giving you the problem might be related to Android Sdk not installed or not configured really well:
Flutter provides a command to update the Android SDK path: Use
flutter config --android-sdk <path-to-your-android-sdk-path>
You can install it directly from Android Studio:
To open the SDK Manager from Android Studio, click Tools > SDK Manager or click SDK Manager in the toolbar. You might have to uncheck "hide obsolete packages" and install the packages that were considered obsoletes.
Or you can install it from this link and configure it like I said before:
https://www.google.com/url?sa=t&source=web&rct=j&url=https://android-sdk.fr.uptodown.com/windows&ved=2ahUKEwi-itWCkuzqAhXTZTUKHa29CRMQFjACegQIAhAB&usg=AOvVaw1QSSVVMrZzFltXvboDbTeQ
After updating the flutter to 1.12.13+hotfix.8, Flutter gives strange errors on release build, but works perfectly fine in debug build
Error :
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'intent'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or
by setting the sdk.dir path in your project's local properties file at
'/Users/niyantras/tools/flutter/.pub-cache/hosted/pub.dartlang.org/intent-
1.1.0/android/local.properties'.
* 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
Flutter doctor :
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.42.0)
[✓] Connected device (1 available)
• No issues found!
Can someone help me in figuring out, thanks for the help.
flutter clean
flutter pub cache repair
let me know if the issue persists
check here, it's closed issues of flutter
Check for compilesdkversion everywhere in the folder and match it with one in android/app/build.gradle