如何解决找不到方法jackOptions作为参数,为什么?
我添加时
jackOptions {
enabled true
}
我遇到了错误
在DefaultConfig_Decorated {name = main,Dimension = null,minSdkVersion = DefaultApiVersion {mApiLevel = S,kVers =' mApiLevel = 30,mCodename ='null'},renderscriptTargetApi = null,renderscriptSupportModeEnabled = null,renderscriptSupportModeBlasEnabled = null,renderscriptNdkModeEnabled = null,versionCode = 1,versionName = 1.0,applicationId = com.example.myapplication,testApplicationId = null,testInstrumentationRunner = androidx .test.runner.AndroidJUnitRunner,testInstrumentationRunnerArguments = {},testHandleProfiling = null,testFunctionalTest = null,signingConfig = null,resConfig = null,mBuildConfigFields = {},mResValues = {},mProguardFiles = [],mConsumerProguardFiles = [holder] {},类型为com.android.build.gradle.internal.dsl.DefaultConfig的mWearAppUnbundled = null}。
我该如何解决??
这是应用程序的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 14
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs",include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
}
解决方法
旧的Jack编译器已经消失了两年。不要在现代项目的Gradle脚本中添加jackOptions
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。