安卓 ERROR: Could not find method jackOptions() for arguments

Android 2020-05-03 阅读 92 评论 0

问题描述

导入了 oppo 的推送 OPushDemo 项目,在 Android Studio 编译的时候出错。

ERROR: Could not find method jackOptions() for arguments [build_3s0nycrj8n2ia5mqjtlkgxner$_run_closure2$_closure5$_closure9@4b3ac3dc] on DefaultConfig_Decorated{name=main, dimension=null, minSdkVersion=DefaultApiVersion{mApiLevel=19, mCodename='null'}, targetSdkVersion=DefaultApiVersion{mApiLevel=26, mCodename='null'}, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptSupportModeBlasEnabled=null, renderscriptNdkModeEnabled=null, versionCode=210, versionName=v2.1.0_200503_a1bc44a600c, applicationId=com.heytap.push.demo, testApplicationId=null, testInstrumentationRunner=null, testInstrumentationRunnerArguments={}, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null, mBuildConfigFields={}, mResValues={appLabel=com.android.builder.internal.ClassFieldImpl@df725d61}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={versionCommit=a1bc44a600c, versionDate=191120}, mWearAppUnbundled=null} of type com.android.build.gradle.internal.dsl.DefaultConfig.
Open File

解决方法

官网说明 https://source.android.google.cn/setup/build/jack?hl=zh-cn,Jack 工具链已被弃用。Jack 是 Android 6.0-8.1 的默认 Android 构建工具链。

因此,只需在 build.gradle 文件中注释或者删除以下行。

jackOptions {
    enabled true
}
最后更新 2020-05-03
MIP.watch('startSearch', function (newVal, oldVal) { if(newVal) { var keyword = MIP.getData('keyword'); console.log(keyword); // 替换当前历史记录,新增 MIP.viewer.open('/s/' + keyword, {replace: true}); setTimeout(function () { MIP.setData({startSearch: false}) }, 1000); } }); MIP.watch('goHome', function (newVal, oldVal) { MIP.viewer.open('/', {replace: false}); });