I am upgrade my android project gradle 5.4.1-all to 6.5-bin, and upgrade build tools 4.0.0 to 4.1.0, then i am get an error like this
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not create task ':app:minifyReleaseWithR8'.
Cannot query the value of this provider because it has no value available.
upgrading build tools from 4.0.0 to 4.1.0 doesn't sound right to me--
To set the buildToolsVersion (e.g. to '30.0.5') in your build.gradle file, I suggest going to Tools > SDK Manager, then going to the "SDK Tools" tab; here I find the default view misleading, because it shows a certain version of the "Android SDK Platform-Tools" (the one you might have upgraded to) - but then when you tick the option "Show Package Details", you see another version actually installed.
And so I recommend setting the buildToolsVersion to this latter installed version.
Double check the type on what you are assigning to your compileSdkVersion in the build.gradle files.
If you are using a value from gradle.properties you need to parse it into an integer first or you will get this R8 task related crash due to that tasks configuration running triggering further resolution of dependency configurations.
so if you have something like this in your build.gradle:
android {
compileSdkVersion project.targetSdk
...
}
and this in your gradle.properties:
targetSdk=30
you need to parse the integer from the string.
android {
compileSdkVersion Integer.parseInt(project.targetSdk)
...
}
In gradle file, you must have buildtools version, something like:
buildToolsVersion 29.0.3
Make sure you have this version downloaded, the problem is mostly caused by you have no this build tools version.
Download it fron Android Studio sdk manager -> SDK tools tab.
a work around for me in build.gradle app level was to downgrade from:
compileSdkVersion 32
buildToolsVersion '32.0.0'
to :
compileSdkVersion 32
buildToolsVersion '30.0.3'
Noting that :
current config in build.grade project level is:
projectMinSdkVersion = 16
projectTargetSdkVersion = 30
Related
Let's say that you have a project A28 that uses android SDK 28 and build tools 28.
compileSdkVersion 28
buildToolsVersion '28.0.2'
This project has a dependency on project B23 that uses android SDK 23 and tools 23.0.0
When building A28, the build will fail. Instead of getting a useful error, I'm getting that a bunch of files (everything in B23) is missing and can't be linked (because it wasn't compiled by gradle, but there is no indication of that).
The only thing that may hint at the issue is:
WARNING: The specified Android SDK Build Tools version (23.0.0) is
ignored, as it is below the minimum supported version (28.0.3) for
Android Gradle Plugin 3.2.1. Android SDK Build Tools 28.0.3 will be
used. To suppress this warning, remove "buildToolsVersion '23.0.0'"
from your build.gradle file, as each version of the Android Gradle
Plugin now has a default version of the build tools.
But this says explicitly, that gradle will compile this project (B23) with 28.0.3 tooling version, not 23.0.0.
If I add
subprojects {
afterEvaluate { project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
}
}
}
}
to my build.gradle in order to explicitly override everything with buildTools 28 & sdk 28, the build succeeds.
Why does this happen? Am I missing something? Shouldn't the lower sdk & build tools already be overriden/ignored?
you can remove the buildToolsVersion altogether, from both projects. that is because the latest version according to the targetSdkVersion will be used. even 28.0.2 is below the minimum requirement of 28.0.3 for Gradle plugin 3.2.1.
I have a problem with a project that I take in collage.
After I open up the project I get this error:
"The specified Android SDK Build Tools version (23.0.3) is ignored, as
it is below the minimum supported version (27.0.3) for Android Gradle
Plugin 3.1.2."
Screenshot of message:
I have tried changing the buildToolsVersion but nothing happens.
I'm still new so cry if the question is not ok something.
Pretty simple. Simply install the appropriate SDK version.
Find this button:
Install the version you want / need:
Code!
Let me know how it turned out.
And please try to be more correct with your english.
UPDATE:
Go to your build.gradle (Module: app) and check if these match:
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
...
defaultConfig {
...
minSdkVersion 19
...
They should point to the same main version.
The "minSdkVersion" should be below the "buildToolsVersion", not the other way around.
So I just downloaded the lastest version of Android Studio (2.2.2). And I get this error when Run an emulator:
I searched and found it has something to do with JDK path, so I tried the non embedded one but still no result.
My setting for Project Structure is (embedded path):
Non-embedded path:
Perhaps my path is wrong? What is the solution for this?
Error is saying build failed , so I guess the error with your compileSdkVersion and buildToolsVersion.
Try changing something like this (in app level gradle file):
compileSdkVersion 23
buildToolsVersion "23.0.1"
NOTE: Both should be in same version. For example if you are choosing compileSdkVersion 22 then choose buildToolVersion as something like 22.0.1 or 22.0.2 or something that you have installed. Try versions and Android Studio will tell you if the version is installed or not
After upgrading gradle of my project (and library attached to it) from 2.1.3 -> 2.2.0 it doesn't build anymore and it says:
Error:Execution failed for task ':app:transformNative_libsWithStripDebugSymbolForDebug'.
java.lang.NullPointerException (no error message)
Anyone have a clue on why this is?
I found answer here:
https://stackoverflow.com/a/40117446/1088975
The point is to set both targetSdkVersion and compileSdkVersion to 22"
You need to change the following lines in build.gradle file:
android {
// SDK 24 worked for me - make sure you have the latest and update it accordingly.
compileSdkVersion 24
buildToolsVersion "24.0.2"
...
}
Maybe you can update the ndk version.
I update the ndk version from r10 to r13,and finally it worked.
You might want to check if the location of your NDK folder has any white space in it...if it has you can move your ndk folder to the c:\ drive and rebuild
Also, check the gradle versiom of your app and either upgrade or download later version, because some ndk versions do not support later gradle version
Failed to sync Gradle Project ‚HelloGlass‘
Error: Cause: failed to find target with hash string 'Google Inc.: Glass Development Kit Preview:19' in D:\Project\Android-SDK
Strangly, this error didn’t appear 3 days ago when I last built the project. I haven’t changed anything or used Android Studio since then.
These are the steps that I’ve tried to solve the issue:
restarted Android Studio and tried to build again
made sure that both gradle and my project use the same path for the Android SDK
made sure that I have the Google Glass Development Kit Installed in the SDK Manager (and all other packages for API 19 as well), also deleted and re-installed it
installed the latest Build Tools via the SDK Manager and consequently changed buildToolsVersion „23.0.1“ to „23.0.2“ in my gradle file
Replaced 'com.android.tools.build:gradle:2.0.0-alpha3' in my top-level gradle file with 'com.android.tools.build:gradle:2.0.0-alpha6' since this is the latest version
in gradle-wrapper.properties changed this line distributionUrl=https://services.gradle.org/distributions/gradle-2.8-all.zip
to this line:
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
and chose „use default gradle wrapper“ in the project options
cleared gradle caches in project/gradle and %HOME%/gradle
tried to build a new Google Glass Project from scratch in Android Studio – same problem
This is the relevant part of my gradle file:
android {
compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.helloglass"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
...
And my top-level gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
}
}
I don’t know what else to do. Any help is greatly appreciated!
I haven't found the reason for the problem, but after re-installing both Android Studio and Android SDK I can finally build the project.
Replace
compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
with
compileSdkVersion 23
then rebuild the project, hope it will work