flutter ext.kotlin_version 不构建 apk

问题描述 投票:0回答:1

我有旧项目需要更新,更新代码为sdk后:^3.5.0 我遇到了 ext.kotlin_version 问题,问题始于所有 Gradle 都在新结构中,所以我无法用搜索结果解决它

这里是“flutter build apk”时的日志

e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/7428d87eca04b8a66b03c2875f74aed6/transformed/fragment-1.7.1-api.jar!/META-INF/fragment_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/3e80ee7d0bbfaf800710e08738ee8d47/transformed/jetified-activity-1.8.1-api.jar!/META-INF/activity_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/e5a134e3998c339ac98114dba08f806b/transformed/jetified-lifecycle-livedata-core-ktx-2.7.0-api.jar!/META-INF/lifecycle-livedata-core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/cc2e34c1141d5416fc8834f9fbd0b13b/transformed/lifecycle-livedata-2.7.0-api.jar!/META-INF/lifecycle-livedata_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/6efc486cc614b1c134085cbfe0dc1ea1/transformed/lifecycle-viewmodel-2.7.0-api.jar!/META-INF/lifecycle-viewmodel_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/66a15401fa95fa1def8bcb39dad50d48/transformed/lifecycle-livedata-core-2.7.0-api.jar!/META-INF/lifecycle-livedata-core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/7cb5459602d20c6c9df4ece3d17e4097/transformed/jetified-lifecycle-process-2.7.0-api.jar!/META-INF/lifecycle-process_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/modules-2/files-2.1/androidx.lifecycle/lifecycle-common/2.7.0/85334205d65cca70ed0109c3acbd29e22a2d9cb1/lifecycle-common-2.7.0.jar!/META-INF/lifecycle-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/818745901e6e8b25a6c3ef15130c84d6/transformed/lifecycle-runtime-2.7.0-api.jar!/META-INF/lifecycle-runtime_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/310070c73b9e3fa50e93681b69530d3f/transformed/jetified-lifecycle-viewmodel-savedstate-2.7.0-api.jar!/META-INF/lifecycle-viewmodel-savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/8f74a46915e4902e43fc2ba4d5115365/transformed/jetified-core-ktx-1.13.1-api.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/a174211aaae51cc22f97d3830203be9a/transformed/core-1.13.1-api.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/ab76a8d862156f391d4c9c67a7f8d883/transformed/jetified-savedstate-1.2.1-api.jar!/META-INF/savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/7bf56b97a18154574b7fd11eb5e856ee/transformed/jetified-window-1.2.0-api.jar!/META-INF/window_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/ea71884a7a9f9ec5614eb47fe12fe2b6/transformed/jetified-window-java-1.2.0-api.jar!/META-INF/window-java_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/f66114939cca7f864f09af78b910bb1f/transformed/jetified-kotlinx-coroutines-core-jvm-1.7.1.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/442fc1ee1afc19819871375e623c976a/transformed/jetified-kotlinx-coroutines-android-1.7.1.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/8020430956ebf7f2e70e0169ef7f1774/transformed/jetified-kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/8020430956ebf7f2e70e0169ef7f1774/transformed/jetified-kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/8020430956ebf7f2e70e0169ef7f1774/transformed/jetified-kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Husamuldeen/.gradle/caches/transforms-3/ac89cfd23cf522f48151b0c70f16f4ac/transformed/jetified-kotlin-stdlib-common-1.8.22.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 2776 bytes (99.8% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'E:\AndroidStudioProjects\alatruqchi\key.jks' not found for signing config 'release'.

* 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 33s
Running Gradle task 'assembleRelease'...                           94.0s

┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.                                 │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update the  │
│ version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of            │
│ E:\AndroidStudioProjects\alatraqchy\android\settings.gradle.                                           │
│                                                                                                        │
│ Alternatively (if your project was created before Flutter 3.19), update                                │
│ E:\AndroidStudioProjects\alatraqchy\android\build.gradle                                               │
│ ext.kotlin_version = '<latest-version>'                                                                │
└────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleRelease failed with exit code 1
PS E:\AndroidStudioProjects\alatraqchy> 
PS E:\AndroidStudioProjects\alatraqchy>
PS E:\AndroidStudioProjects\alatraqchy>
PS E:\AndroidStudioProjects\alatraqchy>
PS E:\AndroidStudioProjects\alatraqchy> flutter build apk

Note: C:\Users\Husamuldeen\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_beep-1.0.0\android\src\main\java\com\gonoter\flutter_beep\FlutterBeepPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 2776 bytes (99.8% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'E:\AndroidStudioProjects\alatruqchi\key.jks' not found for signing config 'release'.

* 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 45s
Running Gradle task 'assembleRelease'...                           46.1s
Gradle task assembleRelease failed with exit code 1

这是我以前从未处理过的事情 请帮忙 谢谢你

flutter kotlin gradle build version
1个回答
0
投票

尝试构建gradle

allprojects {
    ext.kotlin_version = '1.6.0'\\ add this line
    repositories {
        google()
        mavenCentral()
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.