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.3.3,AGP7.2.0,编译报错如下,如何解决 #1726

Open
uscj opened this issue Aug 16, 2023 · 1 comment
Open

gradle7.3.3,AGP7.2.0,编译报错如下,如何解决 #1726

uscj opened this issue Aug 16, 2023 · 1 comment

Comments

@uscj
Copy link

uscj commented Aug 16, 2023

Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'apkData' for ApkVariantOutputImpl_Decorated{variantOutput=VariantOutputImpl(versionCode=property(java.lang.Integer, fixed(class java.lang.Integer, 1)), versionName=property(java.lang.String, fixed(class java.lang.String, 1.4.8)), enabled=property(java.lang.Boolean, fixed(class java.lang.Boolean, true)), variantOutputConfiguration=VariantOutputConfigurationImpl(isUniversal=false, filters=[]), baseName=manual-debug, fullName=manualDebug, outputFileName=property(java.lang.String, fixed(class java.lang.String, app-manual-debug.apk)))} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.

@lovejhf
Copy link

lovejhf commented Aug 18, 2023

if (variant.metaClass.hasProperty(variant, 'packageApplicationProvider')) {
def packageAndroidArtifact = variant.packageApplicationProvider.get()
if (packageAndroidArtifact != null) {
try {
from new File(packageAndroidArtifact.outputDirectory.getAsFile().get(), variant.outputs.first().variantOutput.outputFileName.get())
} catch (Exception e) {
from new File(packageAndroidArtifact.outputDirectory, variant.outputs.first().variantOutput.outputFileName.get())
}
} else {
from variant.outputs.first().mainOutputFile.outputFile
}
} else {
from variant.outputs.first().outputFile
}

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