I am trying to create signed APK an android,however I am getting IOException..
Exception is shown below..
Warning:io.realm.processor.RealmProcessor: can't find referenced class javax.lang.model.element.Element
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.
I am also facing this warnings.but finally adding (-ignorewarnings) using progaurd-rules.pro file from my applications.
this problem is resolved.
This bug happens when the versions of SDK, Build Tools and Gradle Plugins doesn't match (in terms of compatibility). The solutions is to verify if you are using the latest versions of them. The gradle plugins are placed in the build.gradle file of the project. Other versions are in the build.gradle file of the module. For example, for SDK 23, you must use the Build Tools 23.0.1 and gradle plugins version 1.3.1.
OR
include this in your Proguard config:
-dontwarn javax.lang.model.**
Related
I had to integrate a library into my app and the library had its gradle version as 4.0.0, while my app had 3.2.2 (or something). So it bumped into the queries tag in the library (in its Manifest) that it wouldn’t recognize. Therefore I have updated the gradle version in my app to be the same as the library, at 4.0.0 (now I put it as 4.1.0, the latest).
The problem is that I bump into the following error:
`Execution failed for task ‘:app:processCanaryDebugManifest’.
Could not get unknown property ‘manifestOutputDirectory’ for task ‘:app:processCanaryDebugManifest’ of type com.android.build.gradle.tasks.ProcessMultiApkApplicationManifest.
This is based on this warning:
API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
I haven’t been able to make any progress on this. I have ran the gradlew command with --stacktrace but all I get are errors from gradle, nothing specific. Do you know of any way to make this work? The only things I've found so far are issues with a Huawei thing, but it's not the case for me. Thanks!
PS. I'm not sure what additional info would be useful in this circumstance.
EDIT: I've downgraded to gradle 3.3.3 and commented out my new library dependecies, and now it says:
`Execution failed for task ':app:processCanaryDebugManifest'.
java.io.FileNotFoundException: property(interface org.gradle.api.file.Directory, transform(property(interface org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultProjectLayout$FixedDirectory, C:\build\myapp\app))))\AndroidManifest.xml (The filename, directory name, or volume label syntax is incorrect)`
I've got a legacy app I'm maintaining that builds fine when targeting API 28 but fails at Q.
The full error from the gradle build looks like this:
> Task :lintVitalRelease
Calling mockable JAR artifact transform to create file: /Users/spartygw/.gradle/caches/transforms-1/files-1.1/android.jar/5fe3ee8a258b0a02d9b262c195a9ab63/android.jar with input /Users/spartygw/Library/Android/sdk/platforms/android-Q/android.jar
> Task :lintVitalRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':lintVitalRelease'.
> Could not resolve all files for configuration ':androidApis'.
> Failed to transform file 'android.jar' to match attributes {artifactType=android-mockable-jar, returnDefaultValues=false} using transform MockableJarTransform
> Cannot create mockable android.jar
I've followed the guidelines for setting up the Android Q SDK from here.
I'm building from a command line outside of Android Studio.
I see the build progress through building the jni library but barfs immediately when it gets to java byte compilation.
EDIT: Because I can't include the entire gradle stack (limited to 30,000 bytes in a post) here is the synopsis:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':lintVitalRelease'.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':androidApis'.
Caused by: org.gradle.api.artifacts.transform.ArtifactTransformException: Failed to transform file 'android.jar' to match attributes {artifactType=android-mockable-jar, returnDefaultValues=false} using transform MockableJarTransform
Caused by: java.lang.RuntimeException: Cannot create mockable android.jar
Caused by: java.util.zip.ZipException: invalid entry compressed size (expected 1821 but got 1807 bytes)
at com.android.builder.testing.MockableJarGenerator.createMockableJar(MockableJarGenerator.java:96)
at com.android.build.gradle.internal.dependency.MockableJarTransform.transform(MockableJarTransform.java:54)
... 109 more
Suppressed: java.util.zip.ZipException: invalid entry compressed size (expected 1821 but got 1807 bytes)
Those of you who are coming through google search and already have the latest gradle installed
Just delete the Android Q SDK and reinstall. The jars from left over beta install is probably messing with the final release
Anyone who might be coming here from a google search, I found the answer.
In the release notes for Android Q Beta 2 I found in the release notes this blurb:
When using Gradle 3.2.0 for projects targeting Android Q, you might encounter a lint-related issue with an error message similar to "Could not transform android.jar to a mockable jar." This issue does not occur in Gradle 3.3.0 and later.
If you are working on an app that targets Android Q and are unable to upgrade to Gradle 3.3.0 or later, you can use one of the following workarounds:
- Disable lint for release builds
- Unzip and rezip android.jar
Sure enough, unzipping and rezipping the android.jar allowed me to build and deploy to my test Android Q device
Go to Tools>SDK manager>platform tools and install/update SDK platform tools for Android Q. You might need to delete the existing sdk platform tools for Android Q and reinstall
This is not a duplicate question. I have already tried all solutions related to this problem. But none of them are worked.
I have imported project to my system and got error.
To overcome with this error i have installed all build tools versions.
This is my build.gradle file.
My target sdk version and compile sdk version and build tool version are same.
I have downgraded the build tool version with specific target and compile sdk versions. But none of them are working for me.
I have also checked that Does it contain any Capital alphabet in values , drawable and other files. But all seems ok.
ERROR :
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Advanced help would be appreciated !
I'm working on an Android project with two projects inside it. When trying to run a build with gradlew (./gradlew build), I see the following error:
Execution failed for task ':example:lint'.
Could not initialize class
com.android.build.gradle.tasks.Lint$LintGradleIssueRegistry
With stacktrace enabled, this is listed as a java.lang.NoClassDefFoundError.
Oddly, the first time I ran this (which downloaded dependencies), the build failed with a different error:
Execution failed for task ':example:lint'.
lombok/ast/Node
The gradle wrapper that Android SDK created for the project is using Gradle 2.8.
Could this be a configuration issue with the project or my dev machine? I'm trying to avoid using the Android SDK lint tool as this complains about the projects using Gradle (and I hear it may miss some parts of these projects).
Turned out this was a configuration issue in our build.gradle. The following line had been added for testing and never removed:
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
As such, the classes needed for linting were missing.
The following discussion pointed us in the right direction, in case it's useful to anyone else:
https://github.com/evant/gradle-retrolambda/issues/96
After update Android studio and compile with api 23 could not generate release apk showing following warning after include
-dontwarn android.support.v4.
-dontskipnonpubliclibraryclassmembers
in build.gradle
Warning: there were 5 unresolved references to library class members. You probably need to update the library versions. Alternatively, you may have to specify the option
'-dontskipnonpubliclibraryclassmembers'
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning: Exception while processing task
java.io.IOException: Please correct the above warnings
first.:dazzledCars:transformClassesAndResourcesWithProguardForRelease
FAILEDError: Execution failed for task ':transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first.