Error while building Flutter APK for android-arm only - flutter

I got into this problem since last month. I can build APK for android-arm64, android-x86, all of them combined but not specifically for android-arm.
I use this command to build:-
flutter build apk --target-platform android-arm --analyze-size
After running this I'm getting the error:-
Building with sound null safety
Dart snapshot generator failed with exit code -2147483645
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\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
BUILD FAILED in 4m 54s
Running Gradle task 'assembleRelease'... 295.9s
Gradle task assembleRelease failed with exit code 1
Output for flutter doctor is:-
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.3, on Microsoft Windows [Version 10.0.22000.527], locale en-IN)
[√] 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 Community 2022 17.0.6)
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.65.0)
[√] Connected device (3 available)
[√] HTTP Host Availability
• No issues found!
I tried changing gradle versions to 6.7-all, 7.3.1-bin and 7.2-bin
I tried removing flutter folder and reinstalling it all

The problem was with flutter itself after the new update.
It is covered in this issue

Related

flutter new created project don't run

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

Flutter Build error is resulting to a error , Could not load compiled classes for build

The whole code was working well last week, and now I try to open the same project and run the flutter build apk
It shows below error
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':location'.
> Could not load compiled classes for build file 'D:\\flutter.pub-cache\\hosted\\pub.dartlang.org\\location-4.4.0\\android\\build.gradle' from cache.
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for the project ':location' of type org.gradle.api.Project.
> Could not get unknown property 'android' for the project ':location' of type org.gradle.api.Project.
* Try:
ore log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 16s
Gradle task assembly release failed with exit code 1
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
US)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.6)
[√] Android Studio (version 2021.3)
[√] Connected device (3 available)
[√] HTTP Host Availability
• No issues found!
I tried cleaning the pub cache folder and also running pub get commands, but the build is not succeeding

Android run time error:-jetified-kotlin-stdlib-jdk8-1.3.50.jar: Runtime JAR file has version 1.3 which is older than required for API version 1.5a

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)

this is the error I am getting every time I try to run the code that flutter provides in main.dart

FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\devsh\Desktop\programs_\StudioProjects\untitled\android\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Could not open proj generic class cache for build file 'C:\Users\devsh\Desktop\programs_\StudioProjects\untitled\android\app\build.gradle' (C:\Users\devsh\.gradle\caches\6.7\scripts\67wpoy60578g543vmv9v5k2r9).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60
* 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 8s
Exception: Gradle task assembleDebug failed with exit code 1
and this is not it. I have installed android studio still my flutter doctor shows me that I haven't installed it yet and also there is some license issue I don't know how to solve
this is my result of flutter doctor
C:\Users\devsh>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 10.0.19042.985], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
[√] VS Code (version 1.55.2)
[√] Connected device (2 available)
! Doctor found issues in 3 categories.
For the Android license issue, what happens when you run flutter doctor --android-licenses on the command line? Hopefully, it'll run you through the steps to accept the licenses.
For the unsupported class issue, does running a Gradle clean solve the problem? To do this, you should be able to navigate to the projects android directory on the command line and run gradlew clean.

Flutter: Error: Method not found: 'createClient'

I was running my flutter app yesterday afternoon and it was running well
but yesterday at night, I tried to run the app but the build failed with the error message being shown up
The Error Message
/C:/flutter-SDK/flutter_windows_v1.12.13+hotfix.8-stable/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/client.dart:35:23: Error: Method not found: 'createClient'.
factory Client() => createClient();
^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter-SDK\flutter_windows_v1.12.13+hotfix.8-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\flutter-SDK\flutter_windows_v1.12.13+hotfix.8-stable\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
BUILD FAILED in 1m 42s
Exception: Gradle task assembleDebug failed with exit code 1
=============================================================================================
flutter doctor:
[√] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.19041.685], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.52.1)
[√] Connected device (1 available)
• No issues found!
run below command:
flutter packages pub run build_runner build --delete-conflicting-outputs