所以,标题基本上概括了我的问题。有人知道如何解决它吗?上次我构建apk时,在AS 2.X上它工作正常,但是现在我正在使用Kotlin开发,所以我必须使用AS 3.0。
我使用的是AS 3.0 Canary 7(这个项目是一个新项目)
这是我库中的虚拟类(存储在“domain”.library.mylibrary中)
class Test {
fun hello(): String {
return "hello"
}
}
以下是我的(mylibrary)gradle文件:
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" //Declared in project level gradle: ext.kotlin_version = '1.1.3-2'
}
我的 gradlew.bat clean build --info 日志链接如下:https://pastebin.com/bfTZ5s4e。
./gradlew clean build --info
并附加日志。 - guenhtercmd
运行它(我猜你在使用Windows)。所以打开cmd
并导航到你的项目。然后使用gradlew.bat clean build --info
来调用它。输出将保留在你的cmd
会话中。 - guenhter