Android Studio Exception: Gradle task assembleDebug failed - android

FAILURE: Build failed with an exception.
Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 920
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Could not create task ':app:packLibsflutterBuildDebug'.
> No signature of method: org.gradle.api.tasks.bundling.Jar.destinationDir() is applicable for argument types: (File) values: [C:\Users\Rana\AndroidStudioProjects\unistudent\build\app\intermediates\flutter\debug]
BUILD FAILED in 2m 4s
Exception: Gradle task assembleDebug failed with exit code 1
build.gradle:
dependencies
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.android.tools.build:gradle:7.4.1' //.1.0-alpha04
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Could not create parent directory for lock file C:\Program Files\Android\Android Studio\jbr\wrapper\dists\gradle-8.0-rc-5-bin\66yo301po1erkgqofao4h2334\gradle-8.0-rc-5-bin.zip.lck
I've tried everything on the internet, nothing works. Can you plz help me fix this?

Related

React Native Android: Execution failed for task ':app:signReleaseBundle'. java.lang.NullPointerException (no error message)

Problem
I am trying to build the app (React Native on Android) but it fails with this error:
Task :app:signReleaseBundle FAILED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:signReleaseBundle'.
A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable
java.lang.NullPointerException (no error message)
What I tried so far
Basically everything from this thread, but nothing worked. Which was in short mainy deleting modules / gradle and re-installing / cleaning.
Code
Not really sure about what to share here. This is from my android/build.gradle file:
kotlinVersion = "1.6.0"
buildToolsVersion = "31.0.0"
minSdkVersion = 23
compileSdkVersion = 33
targetSdkVersion = 33
EDIT:
After running ./gradlew :app:bundle --info I got this additional information:
What went wrong:
Could not determine the dependencies of task ':app:mergeReleaseNativeLibs'.
Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.
Searched in the following locations:
- file:/home/p/Development/mein-zke-mobile-app/node_modules/react-native/android/app/notifee/core/maven-metadata.xml
- file:/home/p/Development/mein-zke-mobile-app/node_modules/jsc-android/dist/app/notifee/core/maven-metadata.xml
- https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml
- https://dl.google.com/dl/android/maven2/app/notifee/core/maven-metadata.xml
- https://www.jitpack.io/app/notifee/core/maven-metadata.xml
Required by:
project :app > project :notifee_react-native
Googling let me to this thread, but the proposed workaround does not work unfortunately :-(

FAILURE: Build failed with an exception flutter error . help me

FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
Could not resolve all artifacts for configuration ':app:debugAndroidTestCompileClasspath'.
Could not find com.google.firebase:firebase-analytics:.
Required by:
project :app
I think you missed adding the platforms.
implementation platform('com.google.firebase:firebase-bom:29.0.1')
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics-ktx")

Android Studio 4.X.1 with error trustAnchors parameter must be non-empty

Guys I have started with stater project on Ionic using Capacitor. Trying to build Android build and seems like Android studio is failing with Gradle issues.
I have done below
ionic capacitor run android
My build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "variables.gradle"
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Issue:
Executing tasks: [build] in project /somelocation/android
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.6.1.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.6.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.6.1.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.6.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.google.gms:google-services:4.3.3.
Required by:
project :
> Could not resolve com.google.gms:google-services:4.3.3.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.google.gms:google-services:4.3.3.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.google.gms:google-services:4.3.3.
> Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
* 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 436ms
22:23:51: Task execution finished 'build'.
I am able build the project using Ionic commands but I would like to run this on emulator hence trying to open it on Android studio. When I try to import using android studio gradle sync dies with above exception. Any direction on this issue would help.
This is resolved. This error was happening when I am running projects with OpenJDK version openjdk-8u41-b04-linux-x64-14_jan_2020. Once I change it to use OpenJDK 14.0.2 it worked fine.

stuck with this for last 3 days.What can be the solution?

npm version 6.14.4
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve project :react-native-camera.
Required by:
project :app
Unable to find a matching configuration of project :react-native-camera: None of the consumable configurations have attributes.

Exception while trying to execute build in ionic application

I'm having a problem running the command 'ionic build android' , and I can not solve . Previously run the ionic command 'platform android add'.
D:\ionic\hello>ionic build android
Running command: "C:\Program Files (x86)\nodejs\node.exe" D:\ionic\hello\hooks\a
fter_prepare\010_add_platform_class.js D:\ionic\hello
add to body class: platform-android
ANDROID_HOME=C:\android-sdk-win
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:1.2.3.
Required by:
:android:unspecified
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gr
adle/1.2.3/gradle-1.2.3.pom'.
> peer not authenticated
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 1.585 secs
Error: Error code 1 for command: cmd with args: /s,/c,"D:\ionic\hello\platforms\
android\gradlew cdvBuildDebug -b D:\ionic\hello\platforms\android\build.gradle -
Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
I need to generate a package to perform a test on a android device.
my build.gradle is :
apply plugin: 'android'
buildscript {
repositories {
mavenCentral()
}
// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
// Allow plugins to declare Maven dependencies via build-extras.gradle.
repositories {
mavenCentral()
}
task wrapper(type: Wrapper) {
gradleVersion = '2.8'
}
...
How can I solve ?
Replace your old gradle-1.2.3-all.zip to new downloaded
https://services.gradle.org/distributions/gradle-2.2.1-all.zip and try again.
May be your Gradle file in your C:\Users\shashi.gradle\wrapper\dists\gradle-2.2.1-all

Categories

Resources