Kri*_*non 7 java android intellij-idea kotlin flutter
运行 flutter build apk 时,我得到以下信息:
\nw: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:\n    C:/Users/username/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.50/50ad05ea1c2595fb31b800e76db464d08d599af3/kotlin-stdlib-jdk7-1.3.50.jar (version 1.3)\n    C:/Users/username/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.50/b529d1738c7e98bbfa36a4134039528f2ce78ebf/kotlin-stdlib-1.3.50.jar (version 1.3)\n    C:/Users/username/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.50/3d9cd3e1bc7b92e95f43d45be3bfbcf38e36ab87/kotlin-stdlib-common-1.3.50.jar (version 1.3)\n    C:/Users/username/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.10/da6a904b132f0402fa4d79169a3c1770598d4702/kotlin-stdlib-1.5.10.jar (version 1.5)\n    C:/Users/username/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.10/c49d0703d16c6cb1526cc07b9b46486da1dd8a60/kotlin-stdlib-jdk7-1.5.10.jar (version 1.5)\n    C:/Users/username/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.10/6b84d926e28493be69daf673e40076f89492ef7/kotlin-stdlib-common-1.5.10.jar (version 1.5)\nw: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath\n我已经完成了我在网上和这个小组中找到的一些建议,但到目前为止没有任何效果。在 android\\build.gradle 中:
\nbuildscript {\n    ext.kotlin_version = '1.5.10'\n    repositories {\n        google()\n        jcenter()\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:4.2.1'\n        classpath 'com.android.tools.build:gradle:4.2.1'\n        classpath "org.jetbrains.kotlin:kotlin-stdlib:1.5.10"\n        classpath "org.jetbrains.kotlin:kotlin-stdlib-common:1.5.10"\n        classpath "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.10"\n\n    }\n}\n在 app\\build.gradle 中:
\ndependencies {\n    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.10"\n    implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.10"\n    implementation "org.jetbrains.kotlin:kotlin-stdlib-common:1.5.10"\n}\n我还运行了 flutter pub Upgrade --major-versions
\n我之前已经能够毫无问题地构建我的 apk,我将 workmanager 添加到我的 pubsec.yaml 中,这个问题开始出现,但是我删除了该包,问题仍然存在。任何帮助都很感激我已经坚持了一段时间了!
\nflutter doctor -v 的输出
\n[\xe2\x88\x9a] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19041.1288], locale en-BZ)\n    \xe2\x80\xa2 Flutter version 2.2.2 at C:\\flutter\n    \xe2\x80\xa2 Framework revision d79295af24 (4 months ago), 2021-06-11 08:56:01 -0700\n    \xe2\x80\xa2 Engine revision 91c9fc8fe0\n    \xe2\x80\xa2 Dart version 2.13.3\n\n[\xe2\x88\x9a] Android toolchain - develop for Android devices (Android SDK version 31.0.0)\n    \xe2\x80\xa2 Android SDK at C:\\Users\\username\\AppData\\Local\\Android\\sdk\n    \xe2\x80\xa2 Platform android-31, build-tools 31.0.0\n    \xe2\x80\xa2 Java binary at: C:\\Program Files\\Android\\Android Studio\\jre\\bin\\java\n    \xe2\x80\xa2 Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)\n    \xe2\x80\xa2 All Android licenses accepted.\n\n[\xe2\x88\x9a] Chrome - develop for the web\n    \xe2\x80\xa2 Chrome at C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\n\n[\xe2\x88\x9a] Android Studio (version 4.2)\n    \xe2\x80\xa2 Android Studio at C:\\Program Files\\Android\\Android Studio\n    \xe2\x80\xa2 Flutter plugin can be installed from:\n       https://plugins.jetbrains.com/plugin/9212-flutter\n    \xe2\x80\xa2 Dart plugin can be installed from:\n       https://plugins.jetbrains.com/plugin/6351-dart\n    \xe2\x80\xa2 Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)\n\n[\xe2\x88\x9a] IntelliJ IDEA Community Edition (version 2021.1)\n    \xe2\x80\xa2 IntelliJ at C:\\Program Files\\JetBrains\\IntelliJ IDEA Community Edition 2021.1.2\n    \xe2\x80\xa2 Flutter plugin version 57.0.5\n    \xe2\x80\xa2 Dart plugin version 211.7665\n\n[\xe2\x88\x9a] VS Code (version 1.59.1)\n    \xe2\x80\xa2 VS Code at C:\\Users\\kvernon\\AppData\\Local\\Programs\\Microsoft VS Code\n    \xe2\x80\xa2 Flutter extension can be installed from:\n       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter\n\n[\xe2\x88\x9a] Connected device (2 available)\n    \xe2\x80\xa2 Chrome (web) \xe2\x80\xa2 chrome \xe2\x80\xa2 web-javascript \xe2\x80\xa2 Google Chrome 94.0.4606.81\n    \xe2\x80\xa2 Edge (web)   \xe2\x80\xa2 edge   \xe2\x80\xa2 web-javascript \xe2\x80\xa2 Microsoft Edge 94.0.992.47\n\n\xe2\x80\xa2 No issues found!\n小智 17
使用
ext.kotlin_version = '1.6.10'
并将 jdk7 更改为 Java jdk8
前
dependencies {
 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
后
dependencies {
 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
在遇到同样的问题后回到这里,无法弄清楚我第一次做了什么,但基本上我需要弄清楚如何升级 android/app/build.gradle 中的 gradle 版本:(classpath 'com.android.tools.build:gradle:7.3.1'我在 4.2 上有这个。 2)
然后我必须在 android/gradle/wrapper/gradle-wrapper.properties 中进行相同的更新,如下所示distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
然后构建没有错误。
| 归档时间: | 
 | 
| 查看次数: | 12072 次 | 
| 最近记录: |