【发布时间】:2017-05-27 07:41:17
【问题描述】:
完整的例外是:
错误:java.lang.RuntimeException:java.lang.RuntimeException:com.android.build.gradle.shrinker.ClassLookupException:无效的类引用:java/rmi/server/RemoteStub
错误:java.lang.RuntimeException:com.android.build.gradle.shrinker.ClassLookupException:无效的类引用:java/rmi/server/RemoteStub
错误:com.android.build.gradle.shrinker.ClassLookupException:无效的类引用:java/rmi/server/RemoteStub
我正在使用 Kotlin 和 GreenDao。
我的毕业生:
apply plugin: 'org.greenrobot.greendao'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 19
targetSdkVersion 25
versionCode 4
versionName "0.0.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
buildTypes.each {
it.buildConfigField 'String', 'GreenDAODatabaseName', '"App_Database"'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
第二个gradle文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.2-4'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
到目前为止,我在应用程序中所做的只是添加了一些用 kotlin 编写的 UI 类(片段和活动)。 greenDAO 存在两个实体。在我添加 kotlin proguard 之前完美运行。
【问题讨论】:
标签: android android-studio gradle kotlin