AndroidAutoTrack icon indicating copy to clipboard operation
AndroidAutoTrack copied to clipboard

gradle7.0实现自定义插件报错

Open VictorZhx opened this issue 3 years ago • 1 comments

报错内容: 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写的,不知道错在哪里,请指教!

VictorZhx avatar Nov 07 '22 03:11 VictorZhx

看起来可能就是导包问题

Leifzhang avatar Nov 08 '22 02:11 Leifzhang