java-无法解析以下类的超类型.请确保您在类路径中具有必需的依赖项:

java-无法解析以下类的超类型.请确保您在类路径中具有必需的依赖项:,第1张

概述我无法编译AndroidKotlin项目我最近将应用程序从纯Java更新为Kotlin,但仅在单个活动中完成了该应用程序,但无法运行该项目.摇篮日志e:Supertypesofthefollowingclassescannotberesolved.Pleasemakesureyouhavetherequireddependenciesintheclasspath:

我无法编译Android Kotlin项目

我最近将应用程序从纯Java更新为Kotlin,但仅在单个活动中完成了该应用程序,但无法运行该项目.

摇篮日志

e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencIEs in the classpath:
class com.Google.androID.gms.maps.model.LatLng, unresolved supertypes: com.Google.androID.gms.internal.zzbfm
class com.Google.androID.gms.maps.model.Cameraposition, unresolved supertypes: com.Google.androID.gms.internal.zzbfm

建立gradle(应用程式)

apply plugin: 'com.androID.application'apply plugin: 'kotlin-android-extensions'apply plugin: 'kotlin-androID'apply plugin: 'io.fabric'androID {    compileSdkVersion 28    buildToolsversion "28.0.3"    defaultConfig {        versionname "2.2.4"        versionCode 13        minSdkVersion 16        targetSdkVersion 27        testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"        vectorDrawables.useSupportlibrary = true    }    buildTypes {        deBUG {            applicationIDSuffix ".deBUG"            versionnameSuffix ".d.5"        }        release {            MinifyEnabled false            proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro'        }    }    flavorDimensions "server"    productFlavors {        prod {            applicationID "com.app.app"            dimension "server"            buildConfigFIEld "String", "SERVER_HOST", "\"http://www.test.cm\""    }        dev {            applicationID "dev.app.app"            versionnameSuffix ".dev"            dimension "server"            buildConfigFIEld "String", "SERVER_HOST", "\"http://localhost/test\""        }    }}dependencIEs {    implementation filetree(include: ['*.jar'], dir: 'libs')    androIDTestImplementation('com.androID.support.test.espresso:espresso-core:2.2.2', {        exclude group: 'com.androID.support', module: 'support-annotations'    })    implementation('com.crashlytics.sdk.androID:crashlytics:2.7.1@aar') {        transitive = true    }    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"    implementation 'com.github.sparklit:adbutler-androID-sdk:1.0'    implementation 'com.j256.ormlite:ormlite-core:4.48'    implementation 'com.j256.ormlite:ormlite-androID:4.48'    implementation 'com.squareup.okhttp:okhttp:2.4.0'    implementation 'com.androID.support:appcompat-v7:28.0.0'    implementation 'com.androID.support:cardvIEw-v7:28.0.0'    implementation 'com.androID.support:recyclervIEw-v7:28.0.0'    implementation 'com.androID.support:design:28.0.0'    implementation 'com.androID.support:support-vector-drawable:28.0.0'    implementation 'com.androID.support.constraint:constraint-layout:1.1.2'    implementation 'com.androID.support:support-v4:28.0.0'    implementation 'com.Google.androID.gms:play-services-location:15.0.0'    implementation 'com.Google.firebase:firebase-core:16.0.1'    implementation 'com.facebook.fresco:fresco:1.9.0'    implementation 'com.jakewharton.timber:timber:4.7.0'    implementation 'com.Google.androID.gms:play-services-maps:11.8.0'    testImplementation 'junit:junit:4.12'    def nav_version = "1.0.0-Alpha09"    implementation "androID.arch.navigation:navigation-fragment:$nav_version"    // use -ktx for Kotlin    implementation "androID.arch.navigation:navigation-ui:$nav_version"    // use -ktx for Kotlin    implementation 'devlight.io:navigationtabbar:1.2.5'}apply plugin: 'com.Google.gms.Google-services'repositorIEs {    mavenCentral()}

解决方法:

更新:已修复

的build.gradle(项目)

 ext.kotlin_version = '1.3.11'

的build.gradle(APP)

apply plugin: 'com.androID.application'apply plugin: 'kotlin-androID'apply plugin: 'kotlin-android-extensions'apply plugin: 'io.fabric'androID {    compileSdkVersion 28    buildToolsversion "28.0.3"    defaultConfig {        versionname "2.2.4"        versionCode 13        minSdkVersion 16        targetSdkVersion 27        testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"        vectorDrawables.useSupportlibrary = true    }    buildTypes {        deBUG {            applicationIDSuffix ".deBUG"            versionnameSuffix ".d.5"        }        release {        MinifyEnabled false            proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro'        }    }    flavorDimensions "server"    productFlavors {        prod {            applicationID "com.tfwm.lighting"            dimension "server"            buildConfigFIEld "String", "SERVER_HOST", "\"http://www.crescit.com\""        }        dev {            applicationID "dev.tfwm.lighting"            versionnameSuffix ".dev"            dimension "server"            buildConfigFIEld "String", "SERVER_HOST", "\"http://192.168.60.120\""        }    }}dependencIEs {    implementation filetree(include: ['*.jar'], dir: 'libs')    androIDTestImplementation('com.androID.support.test.espresso:espresso-core:2.2.2', {        exclude group: 'com.androID.support', module: 'support-annotations'    })    implementation('com.crashlytics.sdk.androID:crashlytics:2.7.1@aar') {        transitive = true    }    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"    implementation 'com.github.sparklit:adbutler-androID-sdk:1.0'    implementation 'com.j256.ormlite:ormlite-core:5.0'    implementation 'com.j256.ormlite:ormlite-androID:5.0'    implementation 'com.squareup.okhttp:okhttp:2.4.0'    implementation 'com.androID.support:appcompat-v7:28.0.0'    implementation 'com.androID.support:cardvIEw-v7:28.0.0'    implementation 'com.androID.support:recyclervIEw-v7:28.0.0'    implementation 'com.androID.support:design:28.0.0'    implementation 'com.androID.support:support-vector-drawable:28.0.0'    implementation 'com.androID.support.constraint:constraint-layout:1.1.3'    implementation 'com.androID.support:support-v4:28.0.0'    implementation 'com.Google.androID.gms:play-services-location:16.0.0'    implementation 'com.Google.firebase:firebase-core:16.0.7'    implementation 'com.facebook.fresco:fresco:1.9.0'    implementation 'com.jakewharton.timber:timber:4.7.0'    implementation 'com.Google.androID.gms:play-services-maps:16.1.0'    testImplementation 'junit:junit:4.12'    def nav_version = "1.0.0-Alpha09"    implementation "androID.arch.navigation:navigation-fragment:$nav_version"    // use -ktx for Kotlin    implementation "androID.arch.navigation:navigation-ui:$nav_version"    // use -ktx for Kotlin    implementation 'pub.devrel:easypermissions:1.1.1'    implementation 'devlight.io:navigationtabbar:1.2.5'}apply plugin: 'com.Google.gms.Google-services'repositorIEs {    mavenCentral()}
总结

以上是内存溢出为你收集整理的java-无法解析以下类的超类型.请确保您在类路径中具有必需的依赖项:全部内容,希望文章能够帮你解决java-无法解析以下类的超类型.请确保您在类路径中具有必需的依赖项:所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1095728.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存