gpt4 book ai didi

android - 类路径中的运行时 JAR 文件的版本为 1.4,比 API 版本 1.5 旧?

转载 作者:行者123 更新时间:2023-12-04 23:38:25 26 4
gpt4 key购买 nike

我在尝试构建我的应用程序的发布版本时遇到此错误。我没有使用 kotlin 依赖项,所以有人可以告诉我如何解决这个问题吗?
错误日志:

Runtime JAR files in the classpath have the version 1.4, which is older than the API version 1.5. Consider using the runtime of version 1.5, or pass '-api-version 1.4' explicitly to restrict the available APIs to the runtime of version 1.4. You can also pass '-language-version 1.4' instead, which will restrict not only the APIs to the specified version, but also the language featuresw: /Users/meggan/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.4.32/3546900a3ebff0c43f31190baf87a9220e37b7ea/kotlin-stdlib-jdk7-1.4.32.jar:


我的 build.gradle(应用程序):
buildscript {
repositories {
google()
maven { url 'https://plugins.gradle.org/m2/' }
}

}

plugins {
id 'com.android.application'
id 'com.onesignal.androidsdk.onesignal-gradle-plugin'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}

android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "com.myapp.app"
minSdkVersion 21
targetSdkVersion 30
versionCode 10
versionName "1.0"
vectorDrawables.useSupportLibrary = true
resConfigs "en"
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude("META-INF/*.kotlin_module")
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Google Design & Support Dependency
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.annotation:annotation:1.2.0'

// Layout Libs
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.ogaclejapan.smarttablayout:library:2.0.0@aar'

// Connectivity Libs
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.android.volley:volley:1.2.1'

// Firebase
implementation platform('com.google.firebase:firebase-bom:28.4.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-crashlytics'

// OneSignal
implementation 'com.onesignal:OneSignal:[4.0.0, 4.99.99]'

}
项目 build.gradle:
buildscript {
repositories {
google()
jcenter()
mavenCentral()
gradlePluginPortal()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'

// Add the Crashlytics Gradle plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

只需运行 即可修复它使缓存无效/重新启动 在安卓工作室!

关于android - 类路径中的运行时 JAR 文件的版本为 1.4,比 API 版本 1.5 旧?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69381771/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com