New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build failed when updating to latest version #729
Comments
Any updates or workarounds? |
For me it worked to update the Kotlin version in the build.gradle file to 1.9.0 |
Yep, that worked in our environment as well. Thanks! |
It work, but many other packages are incompatible with this Kotlin version, so I can't use it in my project.
|
Any other workarounds? |
A problem occurred evaluating project ':app'.
|
save my day, thanks |
try to update the minSdkVersion |
It seems to me that the issue is in fact that to use Kotlin 1.9.x project needs to already be on Android Gradle Plugin 8. I have already discovered it in Plus Plugins and this is the reason why I am reverting Kotlin version back to Error comes from R8 in AGP older than 8.x not supporting Kotlin 1.9.x as it can be seen here: https://developer.android.com/build/kotlin-support |
Hi all, i'm testing if downgrading the version won't break anything. If not, then ill release a new version with downgraded kotlin version. |
Hi! I had the same problem, but managed to run app.
use with this configuration app runs without errors |
the only thing that worked for me was adding this to app/build.gradle
|
@mhd-ghaith-abtah Are you still having this issue when using version 3.5.1? We recently did a downgrade to Kotlin 1.7.x due to an issue with Kotlin 1.9.x |
This worked for me. I was previosloy using classpath 'com.android.tools.build:gradle:7.4.2' |
@thiagosoaress2 I advise not using Is there a specific reason why you need Kotlin version 1.9.0 ? The plugin was downgraded back to Kotlin 1.7.x due to complaints from other users. There shouldn't be an issue with the |
After long fight with gradle, kotlin 1.8.0 |
delete folder .gradle, go to inside build, delete all folders, or just delete folder build, then setup like this just in case (optional) |
deleting of |
The following configuration worked for me when migrating to AGP8:
Forks (if required): |
Launching lib/main.dart on sdk gphone64 x86 64 in debug mode... FAILURE: Build failed with an exception.
BUILD FAILED in 38s ┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐ this is the error def flutterRoot = localProperties.getProperty('flutter.sdk') def flutterVersionCode = localProperties.getProperty('flutter.versionCode') def flutterVersionName = localProperties.getProperty('flutter.versionName') buildscript {
} apply plugin: 'com.android.application' def keystoreProperties = new Properties() android {
} flutter { dependencies { |
please help |
The mobile_scanner example application runs fine with Kotlin 1.9.x, however, your combination of dependencies might not be compatible with Kotlin 1.9.x Does it work if you switch to Kotlin 1.8.x ? |
No it doesn't work |
We are going to need the full gradle build log to see what the actual issue is. Could you open the native Android project and run a Gradle build with the I also noticed, you are running Gradle 8, with Java 8. Could you ty to upgrade Java to Java 17? (see the example app for the Java 17 configuration) |
java.lang.RuntimeException: Cannot find service com.android.tools.idea.explainer.IssueExplainer (classloader=PluginClassLoader(plugin=PluginDescriptor(name=Android, id=org.jetbrains.android, descriptorPath=plugin.xml, path=/snap/android-studio/140/plugins/android, version=231.9392.1.2311.11076708, package=null, isBundled=true), packagePrefix=null, instanceId=117, state=active), client=null) |
The service Could you run Gradle directly, through Android Studio? |
Sir could you please run the repo on your pc and check it i am will be very grateful to you please i am a beginner so am not able to understand the errors and what to do please could you check it and see |
I will have a look at the Gradle error with the mobile_scanner example app. |
Might not be a good idea to everyone, but try to increase the |
This worked for me |
me too! |
This worked for me too |
This case work for me minSdkVersion 23 plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.2.2" apply false
id "org.jetbrains.kotlin.android" version "1.9.22" apply false
id "com.google.gms.google-services" version "4.3.15" apply false
} |
Just updating the minSdkVersion from 21 to 23 worked for me. Thanks @endruuu. |
@saty-a's suggestion is great but in my case it increased app size by 3x (from 90mb to 280mb) which is somewhat unacceptable, but it did compile and run without problems. |
inside android/build.gradle buildscript {
} worked for me |
Since this issue seems to be resolved by updating the min SDK and or Kotlin version of the Android project, I'm going to close this issue. |
I had a similar problem with Flutter
buildscript {
ext.kotlin_version = '1.9.0' // upgraded to kotlin 1.9
repositories {
google()
mavenCentral()
jcenter() // added this
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2' // using 7.2.2
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip # <== 7.6 Don't forget to run this command after changes cd android
./gradlew clean build --no-build-cache |
In case someone else runs into this issue, don't bump the |
Updating minSDK to 24 works for me but I am wondering what changed between 23 and 24 that fixes this issue? |
when I updated to latest version "mobile_scanner 3.4.1" I got this error when trying to run my project:
ERROR:D8: com.android.tools.r8.kotlin.H
FAILURE: Build failed with an exception.
Execution failed for task ':app:mergeExtDexDebug'.
BUILD FAILED in 27s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode. │
│ To disable the shrinker, pass the
--no-shrink
flag to this command. ││ To learn more, see: https://developer.android.com/studio/build/shrink-code │
└────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
I have seen your build.gradle file and you are using ext.kotlin_version = '1.9.0' which is not widely supported yet.
could please downgrade to 1.8.0 at least
this is my build.gradle file:
buildscript {
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
}
}
The text was updated successfully, but these errors were encountered: