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

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")

Related

Android Studio Exception: Gradle task assembleDebug failed

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?

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 :-(

Jenkins fails to execute app:processDebugResources with AarResourcesCompilerTransform error

I am trying to run all ui test for my app using jenkins ci/cd, but i constantly run into error, which cause by fail of app:processDebugResources command. When i build project at Android Studio it doesn't throw any error and build correctly.
After executing in jenkins connectedAndroidTest gradle command :
Task :app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform appcompat-1.3.0.aar (androidx.appcompat:appcompat:1.3.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for AarResourcesCompilerTransform: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\9398b1795b0a45e239a8370198c80687\transformed\appcompat-1.3.0.
> Android resource compilation failed
ERROR:AAPT: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\5b50c60af17e66ade7be3083cf0fe04d\transformed\androidx.appcompat: error: Не удается найти указанный файл. (2).
> Failed to transform appcompat-1.3.0.aar (androidx.appcompat:appcompat:1.3.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\9398b1795b0a45e239a8370198c80687\transformed\appcompat-1.3.0.
> Android resource compilation failed
ERROR:AAPT: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\5b50c60af17e66ade7be3083cf0fe04d\transformed\androidx.appcompat: error: Не удается найти указанный файл. (2).
> Failed to transform core-1.6.0.aar (androidx.core:core:1.6.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for AarResourcesCompilerTransform: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\619c06b67a6c841ffa9224727d661a21\transformed\core-1.6.0.
> Android resource compilation failed
ERROR:AAPT: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\308760ecdbed89bb153e932d840e53f3\transformed\androidx.core: error: Не удается найти указанный файл. (2).
Error Failed to transform core-1.6.0.aar repeat several times in report, but error text are the same every time.
My build.gradle:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-parcelize'
id 'com.shazam.fork'
}
apply plugin: 'com.shazam.fork'
android {
compileSdkVersion 30
defaultConfig {
configurations.all {
resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
}
applicationId "app.converter" // it's ok, nevermind
minSdkVersion 30
//noinspection OldTargetApi
targetSdkVersion 30
versionCode 5
versionName "5"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
}
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
buildFeatures {
viewBinding true
}
}
}
dependencies {
....
//noinspection GradleDependency
implementation 'androidx.appcompat:appcompat:1.3.0'
....
implementation 'androidx.core:core-ktx:1.6.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
}
Thanks in advance, will provide additional info on request.
UPD :
Adding -g C:\gradle-cache to gradle tasks in Jenkins triggered a new error:
22:14:03 * What went wrong:
22:14:03 Execution failed for task ':app:processDebugAndroidTestResources'.
22:14:03 > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
22:14:03 > Android resource linking failed
22:14:03 C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\ConverterKT\app\build\intermediates\packaged_manifests\debugAndroidTest\AndroidManifest.xml: error: failed to load XML file: Не удается найти указанный файл. (2).
UPD 2.
Updated gradle to 7.5 and addtional exception show up, however termial run in Android Studio
21:01:23 FAILURE: Build completed with 2 failures.
21:01:23
21:01:23 1: Task failed with an exception.
21:01:23 -----------
21:01:23 * What went wrong:
21:01:23 Execution failed for task ':app:processDebugResources'.
21:01:23 > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
21:01:23 > Android resource linking failed
21:01:23 C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\ConverterKT\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml: error: failed to load XML file: Не удается найти указанный файл. (2).
21:01:23
21:01:23
21:01:23 * Try:
21:01:23 > Run with --stacktrace option to get the stack trace.
21:01:23 > Run with --info or --debug option to get more log output.
21:01:23 > Run with --scan to get full insights.
21:01:23 ==============================================================================
21:01:23
21:01:23 2: Task failed with an exception.
21:01:23 -----------
21:01:23 * What went wrong:
21:01:23 Execution failed for task ':app:processDebugAndroidTestResources'.
21:01:23 > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
21:01:23 > Android resource linking failed
21:01:23 C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\ConverterKT\app\build\intermediates\packaged_manifests\debugAndroidTest\AndroidManifest.xml: error: failed to load XML file: Не удается найти указанный файл. (2).
(One of) the AndroidManifest.xml seems to be corrupt. One can write <?xml version="1.0" encoding="utf-8"?> into just any XML file, while the file itself doesn't feature UTF-8 encoding, this does not matter the least. Or plugin id 'kotlin-parcelize' might be related; usually this one is not required. I'd also suggest to get rid of this, unless there is a good reason:
configurations.all {
resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
}
While it won't even build locally, forget about building on Jenkins.

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.

Execution failed for task ':app:mergeExtDexXXXDebug'

I am using
Android Studio 3.5, gradle-5.4.1-all.zip,
com.android.tools.build:gradle:3.5.0,
org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
I got error when i rebuild project:
What went wrong:
Execution failed for task ':app:mergeExtDexProductionDebug'.
Could not resolve all files for configuration ':app:productionDebugRuntimeClasspath'.
Failed to transform artifact 'protobuf-java.jar (com.google.protobuf:protobuf-java:3.10.0)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.usage=java-runtime-jars}.
Execution failed for DexingWithClasspathTransform: C:\Users\xxx\.gradle\caches\modules-2\files-2.1\com.google.protobuf\protobuf-java\3.10.0\410b61dd0088aab4caa05739558d43df248958c9\protobuf-java-3.10.0.jar.
Error while dexing.
I had google, but i can not get solution for this case
Can you help me resolve this problem?
Thanks in advance.
Solution by OP.
I solved my problem with code below:
configurations.all {
resolutionStrategy {
force("com.google.protobuf:protobuf-java:3.11.0-rc-1")
}
}
In app build.gradle file add this-
android{
.........
aaptOptions {
cruncherEnabled = false
}
................
}
Now, build, clean and rebuild project.
If still not got the solution try to downgrade your build version and again build the project.

Categories

Resources