Record an error report about the error report after the project is upgraded to 2.5.0
error message 1:
Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
Solution:
in your project level gradle file, just increase ext.kotlin.version from any version you have to "1.4.32" or any latest version available. Path:/Android/build. Gradle
buildscript {
// ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.4.32'
repositories {
maven { url 'https://maven.aliyun.com/repository/google'}
maven { url 'https://maven.aliyun.com/repository/jcenter'}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public'}
// google()
// mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/google'}
maven { url 'https://maven.aliyun.com/repository/jcenter'}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public'}
// google()
// mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Error Message 2:
D8: Cannot fit requested classes in a single dex file (# methods: 76688 > 65536) com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The shrinker may have failed to optimize the Java bytecode.
Solution
:
Path: /android/app/build.gradle
,Change the minSdkVersion version to a larger one, e.g. 21
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.good_commodity"
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Read More:
- How to Fix Node SASS Error in Vue + webpack project after nodejs upgrade
- Flutter upgrade upgrade SDK SSL_ERROR_Syscall error [How to Solve]
- flutter, Unable to buy item, Error response code: 7 & flutter_inapp_purchase
- IDEA: How to Solve Springboot Project install Error
- How to Solve 0xc1900101 Error (Win10 upgrade Win11)
- [Solved] flutter Project Error: ScrollController attached to multiple scroll views, Failed assertion: line 109 pos 12
- [Solved] Project Upgrade Gradle error (Bugly is integrated)
- Solve Maven project running error Failed to clean project: Failed to delete
- [Solved] Flutter package flutter build apk Error: permission-handle
- How to Solve Error “Could not find com.android.tools.build:gradle:3.0.1”
- Flutter flutter doctor –android-licenses [How to Solve]
- Flutter android studio runs gradle build error: Could not resolve all artifacts for configuration’:classpath’.
- How to Solve Gradle Error: Plugin with id ‘jetty’ not found.
- How to Solve Hyperf Failed to Start Error After Aliyun ACM Installed
- Unable to find bundled Java version =>Mac Flutter [Android Studio Arctic Fox 2020.3.1]
- [Solved] Flutter compile error: Failed to find Build Tools revision 29.0.2
- How to Solve Android jetpack Room Schema export Error
- Kotlin: How to Solve kapt import error
- How to Solve Maven Error: Return code is: 501 , ReasonPhrase:HTTPS Required.
- How to Solve Error: Heartbeating to master:7182 failed.