FAILURE: Build failed with an exception. * Where: Build file 'F:\Developed App\untitled1\android\build.gradle' line: 24 - firebase

F:\Developed App\untitled1\android>gradlew signingReport
FAILURE: Build failed with an exception.
Where:
Build file 'F:\Developed App\untitled1\android\build.gradle' line: 24
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Could not open proj generic class cache for build file 'F:\Developed App\untitled1\android\app\build.gradle' (C:\Users\Raihan.gradle\caches\6.7\scripts\b8f
tacjwav9hf6p50aw09t36z).
> BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60
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 1s
F:\Developed App\untitled1\android>

Go to C:\Users\Raihan.gradle\caches\ and try to remove everything inside this caches folder.
Then remove untitled1/.gradle/caches/
If you're using an Android Studio, go to File -> Invalidate caches and restart
Hopefully, your problem will be solved

Related

Unable to build apk after adding firebase-analytics[Ionic, Cordova]

I am getting error when I try to build apk after adding firebase-analytics. It is showing error in console is
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\sampleproject\platforms\android\app\build.gradle' line: 428
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.google.gms.google-services']
> Cannot add extension with name 'googleServices', as there is an extension already registered with that name.
* 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 6s
Command failed with exit code 1: D:\sampleproject\platforms\android\gradlew cdvBuildDebug -b D:\sampleproject\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
The file googleservices is already present in my project before. As I am using Firebase authentication before in my project. Now the issue is, I can't edit the Gradle file as I am using Cordova to build the Apk.
I also gone through other stackoverflow question and answers, I commented out
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
in gradle but this is not the proper way to solve this problem.
Below this I am mentioning all the extensions I had in my project.
"#ionic-native/firebase-analytics": "^5.36.0",
"#ionic-native/google-plus": "^5.28.0",
"firebase": "^7.19.1",
"google-auth-library": "^6.0.6",
"cordova-plugin-firebase-analytics": "^6.1.0",
"cordova-plugin-firebase-lib": "^5.1.1",
For more clarification I attached the screenshot.
Thank you in advance.

Execution failed for task ':app:mergeDebugJavaResource'. - Gradle Task assemble

so I was trying to run my flutter project and then I got this error :
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> java.nio.file.FileSystemException: C:\Users\ASUS\Desktop\Programmin\Flutter\app_with_firebase\build\app\intermediates\merged_java_res\debug\out.jar: The process cannot access the file because it is being used by another process.
* 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 3s
Exception: Gradle task assembleDebug failed with exit code 1
I tried to do : File > Invalidate Chaches/Restart in Android studio, but it won't solve the problem. I also tried to do flutter clean, then flutter run, but It still shows me the same error.
I have no idea what to do now, any help is appreciated.
Thank you !
I did a bit more digging with SysInternals and jps and it turns out that the Kotlin Language Server wasn't releasing the lock on the build folder. For me, uninstalling the VS Code fwcd Kotlin extension (and replacing with a different Kotlin language extension, if required) was enough to fix the issue.
On Android Studio, all I can suggest is disabling/uninstalling the Kotlin plugin and seeing if that fixes it for you.

On running the emulator getting this error: Cause: invalid type code: 1D

Recently i installed android studio, and when i run the app for the first time it ran without any error but now, when i run it, it has given the error i.e.
Cause: invalid type code: 1D
and
Executing tasks: [:app:assembleDebug] in project /home/dell/AndroidStudioProjects/disha
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
* 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 95ms
Please help.
To resolve this error please make the changes below:
Install Java SDK version: 14 or above.
JDK Download link: https://www.oracle.com/java/technologies/javase-jdk14-downloads.html
And in gradle-wrapper.properties please use grade version 6.3 or above.

Execution failed for task ':firebase_auth:compileDebugJavaWithJavac'

After upgrading firebase_auth from earlier version to ^0.8.0+1 generates error for me.
Here is error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':firebase_auth:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 2s
Finished with error: Gradle task assembleDebug failed with exit code 1
According to the Changelog, you have to perform a migration in the Android project to AndroidX.
The details of the changes required are here.
See CHANGELOG:
0.8.0
Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.
Firstly set the compileSdkVersion to 28 in the android/app/build.gradle file.
Secondly add the following to your android/gradle.properties file:
android.useAndroidX=true
android.enableJetifier=true

Getting an error when adding a 3rd-party jar file

Good day,
I have modified the cordapp-tutorial demo application by modifying the gradle file \cordapp-tutorial\java-source\build.gradle. More specifically, I am adding a jar file to compile a 3rd party library. I'm making the following change to the build.gradle script
but it causes the following error for the M14 milestone release:
:java-source:configureCordappFatJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':java-source:configureCordappFatJar'.
Cannot invoke method contains() on null object
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I do not get this error when I am using milestone release M13
There was a bug in the 0.14.0 release of the Corda gradle plugins that caused this (a missing null check when checking with a dependency without a group).
The way to fix it would be to change the corda_gradle_plugins_version to 0.14.1.

Resources