Can't generate the APK - debugging

The App works perfectly in debug variant but when I change it to release variant the build fails and it gives me this error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details, and also on my java classes (setContentView(R.layout.activity_main)) the R tells me it can't resolve symbol 'R'.
This only happens when I change the build variant to release to finish the app.
Thank you in advance!

Related

Build failed with an exception Could not resolve io.github.g00fy2:versioncompare:1.5.0

cordova.cmd build android --release
The "" tags were detected and are no longer supported. Please migrate to the "preference" tag "AndroidWindowSplashScreenAnimatedIcon".
cordova-plugin-androidx-adapter: Processed 34 source files in 588ms
Checking Java JDK and Android SDK versions
ANDROID_HOME=C:\Users\iamsh\AppData\Local\Android\Sdk (recommended setting)
ANDROID_SDK_ROOT=C:\android-sdk-windows (DEPRECATED)
Using Android SDK: C:\android-sdk-windows
Subproject Path: CordovaLib
Subproject Path: app
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Webtrikon\quickchicken\platforms\android\build.gradle' line: 21
What went wrong:
A problem occurred evaluating root project 'Quick Chicken'.
Could not resolve all files for configuration 'classpath'.
Could not resolve io.github.g00fy2:versioncompare:1.5.0.
Required by:
unspecified:unspecified:unspecified
> Could not resolve io.github.g00fy2:versioncompare:1.5.0.
> Could not get resource 'https://repo.maven.apache.org/maven2/io/github/g00fy2/versioncompare/1.5.0/versioncompare-1.5.0.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/io/github/g00fy2/versioncompare/1.5.0/versioncompare-1.5.0.pom'.
> The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.4.2/userguide/build_environment.html#gradle_system_properties
> Remote host terminated the handshake
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
Command failed with exit code 1: C:\Webtrikon\quickchicken\platforms\android\gradlew :app:bundleRelease -b C:\Webtrikon\quickchicken\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --release exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
how to solve this error, Stuck with it from past 4 days.

Error Building APK build Error> Task :app:packageRelease FAILED

I am trying to generate android APK build, and I am getting different errors every time, from different libraries
for example here it says > Task :react-native-fast-image:mergeReleaseResources FAILED
after that I didn't do anything I just re-run ./gradlew clean && ./gradlew assembleRelease and it shows me different error
and I am in the loop since yesterday, any clue what's the problem or maybe solution?
This can be fixed by configuring the max heap size for your project.
Add this to your android/gradle.properties
org.gradle.jvmargs=-Xmx2560m
For more options prefer this.

When i am trying to run my flutter app it getting an Error running gradle

i am getting an error when i trying to run the app. please help. The error in cmd is below -
Error running Gradle:
ProcessException: Process "C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\app\build.gradle' line: 14
What went wrong:
A problem occurred evaluating project ':app'.
ASCII
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with
--scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 14s
Command: C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
line nine in app-build-gradle is below-
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
There could be many reasons for such a error. I had a similar error. I would suggest you to open your project in android studio and check your gradel versions. I see by the name of you app that you are using firebase. Some of those plugins use Androidx. So migrating your project to Androidx might help. Here's how to migrate your project to Androidx.
Hope it helps!
I had the same issue this may because of the incompatibility of Gradle versions.
I opened the android part in Android Studio and updated Gradle as recommended by Android Studio with Alt+Enter and it solved my problem.
I can elaborate more if you can post more details about it e.g your app/gradle file.

Android resource compilation failed - resource file not found

I'm trying to assemble an Android app in Bamboo server, but I'm getting this error when the assemble comand run. Note: It works perfectly in local.
Command running:
gradlew assembleDebug
And the error I get:
Caused by: org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\aa6199e981580f79dc21c6ea06a3575f\res\drawable-mdpi-v4\quantum_ic_skip_next_white_24.png: error: file not found.
I've checked for the resource and its use, but it's not from my project code. It belongs to an external library: play-services-cast-framework
I've been also checking other similar post, but the error can be caused for many resources reasons, so I've not found a solution.
Some solutions suggest that is a problem at some gradle plugin version, but I'm already using version 3.3.1
Any help or clue?
Thanks!

Android studio build error

Tried to create my first project in android studio, using one of the examples im trying to run the application, but gradle gives me this build error (didnt change one line of code - just trying to run the Empty activity):
Gradle: FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':Passivelocation:packageDebug'.
org.bouncycastle.asn1.ASN1Integer.(J)V
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Ive tried adding info and debug while running the command on with the cli but i cant make much of the output it gives me.
Any suggestions?
I faced the same failure and the problem was with my jdk/jre because some time ago I added the Bouncy Castle Crypto APIs functionality by adding the jar to my jdk/jre path.
I tried a gradle build with a "clean" jdk/jre and problem was solved

Resources