My project is a simple app to print longitude and latitude
I´m using:
Linux Mint 19.3
classpath 'com.android.tools.build:gradle:4.1.3'
compileSdkVersion 31
and the results of the compilation is show below:
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 play-services-base-17.0.0.aar (com.google.android.gms:play-services-base:17.0.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /home/luis/.gradle/caches/transforms-2/files-2.1/bb3cc3ced1388fcd9c0c925717b75148/jetified-play-services-base-17.0.0.
> AAPT2 aapt2-4.1.3-6503028-linux Daemon #6: Unexpected error during compile '/home/luis/.gradle/caches/transforms-2/files-2.1/bb3cc3ced1388fcd9c0c925717b75148/jetified-play-services-base-17.0.0/res/drawable-xxhdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png', attempting to stop daemon.
How about minSDKVersion ?
try with:
compileSdkVersion 31
minSdkVersion 21
targetSdkVersion 29
and geolocator: ^7.6.0
It's related to your local cache.
There are two ways to solve this.
Try fluter pub cache repair.
Open Your Project ProjectName/android project in android studio and syn Gradle. And build it through the android studio.
At the end, I figured out to fix this problem at the android/build.gradle
downgraded 4.1.0 to 3.4.2. Why? because I have another app using this version.
dependencies {
//classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Related
Hi i'm getting issue while running ./gradlew assembleRelease after upgrading React native version 0.64 to 0.67, and upgraded gradle version 4.2.1 to 7.1.2, please help me to fix this issue.
Task :library:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':library:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR:/Users/vv/.gradle/caches/transforms-3/8e1dbca81dfad29f4aee913d13f7c843/transformed/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.
app/build.gradlew
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
kotlinVersion = "1.4.32"
kotlin_version = '1.4.32'
dokka_version = '0.10.1'
androidxCoreVersion = '1.7.0'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.1.2')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
}
}
I had a very similar issue. Changing Gradle back to 4.2.1 will solve the issue. I think something you depend on is built with an older compileSdkVersion that doesn't work with newer Gradle versions.
I don't know if this is a proper solution, but I had the same problem and I solved it by adding 'app:' like this:
gradlew app:assembleRelease
Hope this helps :)
Task :react-native-google-places:compileDebugRenderscript FAILED
What went wrong:
Could not resolve all files for configuration ':react-native-google-places:debugCompileClasspath'.
Could not resolve com.android.support:appcompat-v7:26.1.0.
Required by:
project :react-native-google-places
Cannot find a version of 'com.android.support:appcompat-v7' that satisfies the version constraints:
Dependency path 'FastGo:react-native-google-places:unspecified' --> 'com.facebook.react:react-native:0.59.3' --> 'com.android.support:appcompat-v7:28.0.0'
In the android/app/build.gradle file, specify the compileSdkVersion & buildToolsVersion as,
compileSdkVersion 26
buildToolsVersion "26.0.1"
Also make sure that you have installed SDK API level 26.
I checked and updated my android SDK (also react-native-image-crop-picker), but I couldn't find the version of support 27.+ all the time.
below are more information
FAILURE: Build failed with an exception.
-------------------------------------------------------
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-image-crop-picker'.
Could not resolve all dependencies for configuration ':react-native-image-crop-picker:_debugPublishCopy'.
Could not find com.android.support:appcompat-v7:27.1.0.
Searched in the following locations:
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.pom
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.jar
file:/C:/Users/***/Desktop/LastDesign/InsurAgentApp/android/sdk-manager/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.jar
Required by:
InsurAgentApp:react-native-image-crop-picker:unspecified > com.facebook.react:react-native:0.54.2
Could not find com.android.support:appcompat-v7:27.1.0.
Searched in the following locations:
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.pom
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.jar
file:/C:/Users/***/Desktop/LastDesign/InsurAgentApp/android/sdk-manager/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.jar
Required by:
InsurAgentApp:react-native-image-crop-picker:unspecified > com.github.yalantis:ucrop:2.2.2-native
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'com.facebook.react:react-native:+'
compile 'com.github.yalantis:ucrop:2.2.2-native'
compile 'id.zelory:compressor:2.1.0'
}
It seems that Gradle is looking for the specified libraries in your local storage.
Try adding the Google's Maven repository to your top-level build.gradle file.
Check if you have offline work on.
Go to:
File > Settings > write "offline" on the search bar > under Gradle, see if Offline Work is checked. If so, uncheck it.
When I upgrade android studio version to 2.3,and gradle version to 3.3,and android gradle plugin version to 2.3.0,and buildToolsVersion version to 25.0.0,It has some problem when I use this command "gradlew assembleRelease" to package my application.
Shrinking...
Printing usage to [E:\workspace\android_source\src\app\build\outputs\mapping\XXX\release\usage.txt]...
Removing unused program classes and class elements...
Original number of program classes: 10650
Final number of program classes: 10247
Optimizing...
Warning: Exception while processing task java.io.IOException: java.lang.NullPointerException
:app:transformClassesAndResourcesWithProguardForXXXRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForXXXRelease'.
> Job failed, see logs for details
* 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 mins 34.554 secs
but when I downgrade android gradle plugin to version 2.2.3,and buildToolsVersion to 23.0.1,It works well.
I have resolved this problem,It is because the proguard version is too low,if we update the gradle plugin,the version is greater than 2.3.0,we must use the proguard version 5.3.2 or higher,this is how to use the high proguard version,here is two solutions:
1.Add these code in build script method of your build.gradle file:
buildscript {
...
configurations.all {
resolutionStrategy {
force 'net.sf.proguard:proguard-gradle:5.3.3'
}
}
}
then,repackage.
2.To download proguard.jar by this link
.then,create a folder in root path of your project,put the jar in this folder,add these code in your build.gradle file:
buildscript {
repositories {
flatDir{dirs 'proguard'}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath ':proguard:'
}
}
then,repackage.
I'm getting this error:
Error:Execution failed for task ':ProjectName:compileUniversalDebugJava'.
> Could not find property 'bootClasspath' on com.android.build.gradle.AppExtension_Decorated#26fd94a1.
Why is that?
I'm building Android app with gradle on Android Studio.
Apparently I had to update com.android.tools.build:gradle:0.10.+ instead of com.android.tools.build:gradle:0.9.+. Here in my build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
...
}