Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
VictorZhx opened this issue Nov 7, 2022 · 1 comment
Open

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

VictorZhx opened this issue Nov 7, 2022 · 1 comment

Comments

@VictorZhx
Copy link

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

@Leifzhang
Copy link
Owner

看起来可能就是导包问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants