我无法编译Android Kotlin项目
我最近将应用程序从纯Java更新为Kotlin,但仅在单个活动中完成了该操作,但无法运行该项目。
摇篮日志
e:无法解析以下类的超类型。请确保您在类路径中具有必需的依赖项:com.google.android.gms.maps.model.LatLng类,未解析的超类:com.google.android.gms.internal.zzbfm类com.google.android.gms。
maps.model.CameraPosition,未解析的超类型: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(应用程序)
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()
}
上一章介绍了类型类的概念,这种模式使设计出来的程序既拥抱扩展性,又不放弃具体的类型信息。 这一章,我们还将继续探究 Scala 的类型系统,讲讲另一个特性, 这个特性可以将 Scala 与其他主流编程语言区分开:依赖类型,特别是,路径依赖的类型和依赖方法类型。 一个广泛用于反对静态类型的论点是 “the compiler is just in the way”, 最终得到的都是数据,为什么还要建立
我有一个名为.jar的罐子,它依赖于我的外部库。 执行会得到以下输出, 我尝试用两种方式运行jar 并为DependedClass获得了NoClassDefFoundError 按如下所示更改清单条目后 清单-版本:1.0 创建-由:1.6.0_05(Sun Microsystems Inc.) 主-类:com.os.hw.helloworld 类-路径:c://users/vinay/deskt
我在 ubuntu 上使用 android studio 1.5.1。我想将谷歌分析添加到我的Android应用程序中。所以我遵循了谷歌分析文档,但是当我将mavenCentral()更改为jcenter()时,Android studio无法解析此类路径: 当我按下“同步项目与Gradle文件`按钮”,Android studio大约需要15分钟,最后说: 错误:连接超时。如果您使用HTTP代理
我在我的新Android Studio版本中遇到了以下错误,基本的hello world也没有在gradle中构建。云你也请帮忙。 这是我在新的android Studio版本中收到的错误: 我的分级文件如下 这是我得到的日志 无法解析“”的依赖项:app@debug/compileClasspath“:无法解析com.android.support:appcompat-v7:28.0.0-rc0
几天来,我一直在尝试使用nativescript。我的所有安装都进行得很好,但在执行tns运行的android——emulator时,它给了我以下错误: MiC@USERMINGW32 ~/Android项目/HelloWorld$tns运行Android搜索设备。。。跳过准备。正在生成项目。。。Gradle构建。。。 失败:生成失败,出现异常。 > 问题:配置根项目“HelloWorld”时出现
我有一个spring boot应用程序,在pom.xml中添加了starter-data-jpa依赖项。我可以清楚地在maven dependency一节中找到javax.persistence包。但我无法使用注释。手动输入.entity,eclipse会显示未解析的依赖关系。提前道谢。 这是我的pom.xml文件。 null