AndroidAutoTrack
AndroidAutoTrack copied to clipboard
gradle7.0实现自定义插件报错
报错内容: An exception occurred applying plugin request [id: 'scan-privacyapi']
Failed to apply plugin 'scan-privacyapi'. Could not find method onVariants() for arguments [com.zhx.plugin.privacy.PrivacyApiPlugin$_apply_closure1@25be3b51] on extension 'androidComponents' of type com.android.build.gradle.internal.plugins.AppPlugin$ApplicationAndroidComponentsExtensionImplCompat. 部分源代码: def androidComponents = project.extensions.getByType(AndroidComponentsExtension.class)
androidComponents.onVariants { variant ->
variant.transformClassesWith(PrivacyApiTraceTransformNew.class,
InstrumentationScope.ALL) {
it.writeToStdout.set(true)
}
variant.setAsmFramesComputationMode(FramesComputationMode.COPY_FRAMES)
}
我用groovy写的,不知道错在哪里,请指教!
看起来可能就是导包问题