Gradle task failing when updating to gradle 7.3.3 - android

I have updated my project with gradle version 7.3.3 but getting the below error: Any suggestion.
Some problems were found with the configuration of task ':compileDebugRenderscript' (type 'RenderscriptCompile').
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.tasks.RenderscriptCompile' method 'useAndroidX()' should not be annotated with: #Input.
After scan:
* Exception is:
org.gradle.internal.execution.WorkValidationException: Some problems were found with the configuration of task ':compileDebugRenderscript' (type 'RenderscriptCompile').
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.tasks.RenderscriptCompile' method 'useAndroidX()' should not be annotated with: #Input.
Reason: Input/Output annotations are ignored if they are placed on something else than a getter.
Possible solutions:
1. Remove the annotations.
2. Rename the method.

Related

gradle with an exception while running a plugin: Cannot query the value of this property because it has no value available

I got such an error
Execution failed for task ':business:product:card:iLintCheck'.
Could not resolve all dependencies for configuration ':business:product:card:debugRuntimeClasspath'.
Cannot query the value of this property because it has no value available.
The value of this property is derived from:
- task ':common:base:packageDebugRenderscript' property 'headersDir'
and the stack of errors is here:
The value of this property is derived from:
- task ':thirdpart:multitype:processDebugManifest' property 'manifestOutputFile'
at org.gradle.api.internal.provider.AbstractMinimalProvider.get(AbstractMinimalProvider.java:86)
at org.gradle.api.internal.artifacts.dsl.LazyPublishArtifact.getDelegate(LazyPublishArtifact.java:94)
at org.gradle.api.internal.artifacts.dsl.LazyPublishArtifact.getName(LazyPublishArtifact.java:64)
at org.gradle.api.internal.artifacts.publish.DecoratingPublishArtifact.getName(DecoratingPublishArtifact.java:51)
at org.gradle.api.internal.artifacts.publish.DecoratingPublishArtifact_Decorated.getName(Unknown Source)
at org.gradle.internal.component.model.DefaultIvyArtifactName.forPublishArtifact(DefaultIvyArtifactName.java:36)
at org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata.<init>(PublishArtifactLocalArtifactMetadata.java:40)
at org.gradle.internal.component.local.model.DefaultLocalComponentMetadata.addVariant(DefaultLocalComponentMetadata.java:157)
at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.DefaultLocalComponentMetadataBuilder$1.visitChildVariant(DefaultLocalComponentMetadataBuilder.java:66)
at org.gradle.api.internal.artifacts.configurations.DefaultVariant.visit(DefaultVariant.java:72)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationPublications.collectVariants(DefaultConfigurationPublications.java:95)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.collectVariants(DefaultConfiguration.java:934)
......
The magic thing is that when I use jvm remote debug, it will success. While just running, it will error.
The AGP version I used is 4.1, gradle version is 6.5

Conflict with Huawei HMS plugin in android with gradle 7.0.0

I'm getting this error with Gradle 7.0 while it was working fine for 6.8.3
agcp-gradle-7-error
AGCPlugin
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ':app:processDebugAGCPlugin' (type 'AGCPluginTask').
Type 'AGCPluginTask' property 'randomEncryptComponent' of type boolean shouldn't be annotated with #Optional.
Reason: Properties of primitive type cannot be optional.
Possible solutions:
Remove the #Optional annotation.
Use the java.lang.Boolean type instead.
Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#cannot_use_optional_on_primitive_types for more details about this problem.
I no longer get any errors with:
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
and
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
Currently Gradle 7.0 is not supported. As I hear, it will be supported at the end of June.

Execution failed for task ':app:bintrayUpload' and Execution failed for task ':app:bintrayPublish'

Cannot cast object 'task ':bintrayUpload'' with class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask_Decorated' to class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask'
Cannot cast object 'task ':asista-ui:bintrayUpload'' with class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask_Decorated' to class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask'
New Dependency added to My project and this dependency was writted in kotlin but i am Using language for Java.So,My App Displayed a error Message for Adding a Kotlin Version.I Am added a Kotlin Version 1.0.50 something.
So I Solved this Error For Following->
Remove the Kotlin Version and Its using Place and Its Solved..And Update your gradle built version for Latest...
Another Error For Displayed in bintrayPublish failed
this error solved for using this Method->
**Change bintray latest Version.(E.g:1.8.4) **

Dokka failure: com.intellij.psi.impl.source.PsiClassImpl cannot be cast to com.intellij.psi.PsiJavaFile

I have a build that generates Android artefacts (mainly an .aar) and bundles in dokka-generated docs (codebase is Kotlin+Java).
With some recent changes dokka started failing with this cryptic error:
> Task :mylib:dokka FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mylib:dokka'.
> com.intellij.psi.impl.source.PsiClassImpl cannot be cast to com.intellij.psi.PsiJavaFile
Any help would be appreciated. I currently cannot seem to trace the source of this.
I can't pin-point the root of the problem but I can say for sure that Dokka has some issues with annotation classes.
In my changes, I had initially introduced a new annotation class based on Android's #IntDef inside an abstract class (alongside associated helper methods), written in Java.
These 2 steps seemed to have helped:
Switching to Kotlin for the annotation class' implementation, then defining the annotation class at a file's root scope (rather than as an inner item of a class).
Suppressing the annotation's package in Dokka's config, i.e. -
dokka {
...
packageOptions {
prefix = "com.mylib.myannotation"
suppress = true
}
}
The end result is that the documentation cannot reference the annotated class (that's no surprise, as it was suppressed), but the javadoc generation fully succeeded.

androidX jetifier - Is there a way to ignore jetifying a .JAR?

Trying to update my app to androidX dependencies. Followed instructions here, and compilation failed.
The error came from JetifyTransform task failing to process a certain .JAR dependency (FYI - Samsungs Spass SDK) :
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptGenerateStubsStandardNo_vendorDebugKotlin'.
> Could not resolve all artifacts for configuration ':app:standardNo_vendorDebugCompileClasspath'.
> Failed to transform file 'pass-v1.2.2.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
> Failed to transform '/Users/hanandann/StudioProjects/ArnakPaymentsAndroid/Payments/app/libs/pass-v1.2.2.jar' using Jetifier. Reason: null. (Run with --stacktrace for more details.)
> Failed to transform file 'pass-v1.2.2.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
> Failed to transform '/Users/hanandann/StudioProjects/ArnakPaymentsAndroid/Payments/app/libs/pass-v1.2.2.jar' using Jetifier. Reason: null. (Run with --stacktrace for more details.)
Trying to jetify with jetifier-standalone tool had similar results:
Hanans-MacBook-Pro:bin hanandann$ ./jetifier-standalone -i /Users/hanandann/StudioProjects/.../app/libs/pass-v1.2.2.jar -o /Users/hanandann/StudioProjects/.../app/libs/pass-v1.2.2jet.jar
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
at org.objectweb.asm.ClassReader.readFrameType(ClassReader.java:2313)
at org.objectweb.asm.ClassReader.readFrame(ClassReader.java:2269)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1448)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:698)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.android.tools.build.jetifier.processor.transform.bytecode.ByteCodeTransformer.runTransform(ByteCodeTransformer.kt:39)
at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:443)
at com.android.tools.build.jetifier.processor.archive.ArchiveFile.accept(ArchiveFile.kt:49)
at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:425)
at com.android.tools.build.jetifier.processor.archive.Archive.accept(Archive.kt:76)
at com.android.tools.build.jetifier.processor.Processor.transformLibrary(Processor.kt:421)
at com.android.tools.build.jetifier.processor.Processor.transform(Processor.kt:247)
at com.android.tools.build.jetifier.processor.Processor.transform$default(Processor.kt:234)
at com.android.tools.build.jetifier.standalone.Main.run(Main.kt:157)
at com.android.tools.build.jetifier.standalone.Main$Companion.main(Main.kt:109)
at com.android.tools.build.jetifier.standalone.Main.main(Main.kt)
Now, I don't really mind if SDK's don't get jetified, so I tried setting android.enableJetifier=false in my gradle.properties file, but compilation failed again for a different reason- SupportMapFragment isn't compatible with androidX yet as is reported here
So I'm stuck. With jetify the .JAR won't transform. with it - SupportMapFarg is incompatible.
Any suggestions?
P.S. you know what would be nice? if there was an ignore option for the jetifying function
added this to gradle.properties:
android.jetifier.blacklist = pass
as suggested by folks at google here.
Be warned - this feature is experimental and unsupported.
Update- current syntax is android.jetifier.ignorelist={your.ignored.lib} as Suggested by #YaMiN
Currently android.jetifier.blacklist is deprecated.
It was removed in version 7.0 of the Android Gradle plugin.
This property has been replaced by android.jetifier.ignorelist
If you need to ignore just a specific .jar file from the jetifier. You can add the file name in the gradle.properties like on the last line from this example.
android.useAndroidX=true
android.enableJetifier=true
android.jetifier.blacklist=liblinphone-4.0.1-debug-symbols.jar
Add this in project's gradle.properties:
android.jetifier.blacklist =xx.aar,yy.jar
split the black list with comma
update on 2022/06/07
If you use gradle 7, it change to android.jetifier.ignorelist

Categories

Resources