I'm getting the error:
WARN - ect.sync.idea.ProjectSetUpTask - Failed to find Build Tools revision 26.0.2
It is actually an error breaking my build but this wasn't copyable so I found this line in the log (the only place I could find reference to "26.0.2"
I've searched (Ctrl-Shift-F) for 26.0.2 everywhere and found just 2 occurrences of 26 in one file, the "app" level build.gradle:
android {
compileSdkVersion 26
defaultConfig {
targetSdkVersion 26
...
Which I changed to 27, my build tools is 27.0.3 which I use for other projects, I don't want another build tools. How can I communicate this to Android Studio?
Credit to https://stackoverflow.com/a/47425748/866333, I hope this offers easier sign posting:
android {
compileSdkVersion 27
// Add the following line, Android Studio is quite good for filtering bloat.
buildToolsVersion "27.0.3"
defaultConfig {
targetSdkVersion 27
...
I actually had to add a line, so I don't know where AS was reading 26.0.2 from, but this fix has worked on 2 of my projects. Oh, and because I'm now using the support lib (because its 2018):
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
will be on the wrong versions, fix by replacing the 3 occurrences of "26.1.0" with, eg, "27.1.1", as that was what the error messages was hinting at.
Related
I am getting the above error
My gradle looks like this
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.hypersignwalletcorekotlin"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
project.ext {
walletcore_version = "2.0.5"
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "com.trustwallet:wallet-core:$walletcore_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Not able to understand why is this happening.
Thanks
The Fix:
add ndkVersion to your module's build.gradle
android.ndkVersion "your-installed-ndk-version"
as in some examples. You could find your NDK version from the file $NDK/source.properties.
Background Info:
You probably using AGP/Android Studio version 3.6+: "From Android Gradle Plugin ( AGP ) 3.6+, there is a known good NDK concept added, which is the known good/tested NDK version when that AGP version was released". AGP will use that internal NDK version if:
you are not using the ndkVersion feature added in AGP 3.5
That internal NDKs are expected to be installed as side-by-side NDK place:
$SDK\ndk
if not installed:
AGP 3.6, AGP 4.0 will error out
AGP 4.1 would auto install it.
The internally embedded NDK version, most likely, will be out-of-date pretty quickly as newer NDKs are constantly being released: if you want to use a newer NDK version, you do need to configure gradle with ndkVersion.
Additional Doc:
Refer to the official documentation for details.
To install a specific version of the NDK, do the following:
With a project open, click Tools > SDK Manager.
Click the SDK Tools tab.
Select the Show Package Details checkbox.
Select the NDK (Side by side) checkbox and the checkboxes below it that correspond to the NDK versions you want to install. Android Studio installs all versions of the NDK in the android-sdk/ndk/ directory.
I do not use NDK, but still got this error. Clean project worked for me.
Build -> "Clean Project" and then rebuild.
That error happened to me when I run cordova build with Android Studio open. :D
I closed it and that's it.
You need to click the tool on above the bar option. Then you need to download the current ndk if not installed.
I just create a new emulator using the newest Android Studio version. It solved my problem. Hopefully, it may be an alternative...
Install NDK from SDK Manager -> SDK tools
and then just add this line in the android/app/build.gradle
android{
ndkVersion flutter.ndkVersion
}
You can install only the NDK that you need.
Go SDK Manager -> SDK tools -> Click in Show Package Details
Click and install.
After updating Android Studio from 2.3 to 3.0 I changed buildToolsVersion from 26.0.0 to 26.0.2 and after that I am getting this error:
Cannot resolve symbol '?attr/actionBarSize
Xml code:
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#color/colorPrimary"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:titleTextColor="#android:color/white"/>
Dependencies:
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
Nothing helped, but changing:
?attr/actionBarSize to ?android:attr/actionBarSize did the job.
That's actually a bug in few versions. Even if you won't fix it, Android will automatically fix it at runtime.
Update all your library versions to 26.1.0 (to the most recent version) and also add:
compile 'com.android.support:support-v4:26.1.0'
if you are using Android Studio 3.0.0 and above then use
implementation 'com.android.support:support-v4:26.1.0'
Sync your project and the error will automatically resolve because ?attr/actionBarSize is part of v4 library.
In the project directory hierarchy switch "Android" to "Project".
Then delete a folder ".idea/libraries", only "libraries".
Select an option from the menu "File -> Invalidate Caches / Restart... -> Invalidate and Restart".
Good day, I know this is a bit late.
but I have encountered this one too, when I updated to Android Studio 3.0
what i did is I changed
compile 'com.android.support:support-v4:26.1.0'
to
implementation 'com.android.support:support-v4:26.1.0'
Hope it can help somebody.
This is what I did to fix exactly the same problem.
1. Go to SDK manager.
2. Check Android API 27 and Android 8.0 (Oreo)
3. Click "Apply" to download and install those SDKs
4. In build.gradle, change the 'buildToolsVersion "26.0.1"' to 'buildToolsVersion "26.0.2"' and do a gradle sync.
Hope this can help fix your issue.
Your buildToolsVersion version differs from version in dependencies
(e.g. buildToolsVersion is 27.0.0
but implementation 'com.android.support:support-v4:27.0.1'). Make them the same.
my problem solved by changing compileSdkVersion and targetSdkVersion from 26 to the last version 27, also u need to upgrade ur dependencies to 27.
android {
compileSdkVersion 27
defaultConfig {
applicationId "com......"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
}
hope this solve ur problem too :)
Try to add this in your build.gradle(app) dependencies:
resolutionStrategy {
force libraries.support.appCompat
force libraries.support.design
force 'com.android.support:support-utils:26.0.1'
force 'com.android.support:support-compat:26.0.1'
}
This worked.
I have updated the compile and support lib versions from 26.x.x to 27.x.x.
I tried all the answers here and so many others from lots of places but only the below techniques worked for me.
The simple way is you just need to close the project then import the same project as a Gradle project
Or you can go to Project structure -> project -> change Gradel plugin = 4.4 and Android plugin version = 3.1.4.
Both of these above methods work.
Note: These versions(4.4, 3.1.4) are latest when I write this answer please use the latest version instead of these.
Same issue here, if you're using AndroidX add this :
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
Change R.attr.actionBarSize to androidx.appcompat.R.attr.actionBarSize.
Maybe you hava upgraded the version of gradle.
when my gradle version is 4.4 and plugin version is 3.1.1.It is ok.
this work:
delete all file in $HOME/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar
Changed all Support Library versions to the newest 27.1.1 and the error was gone.
please replace android support libraries.
from
27.1.1
to
28.0.0-alpha3
and replace 27 to 28 for following cases:
compileSdkVersion 28
buildToolsVersion "28.0.0"
targetSdkVersion 28
this will fix the issue.
Android beginner here...
I'm getting all sort of rendering errors, and eventually concluded it's got something to do with my gradle dependencies.
Now I found a nice tutorial which I've been following, http://www.android4devs.com/2015/06/navigation-view-material-design-support.html but I'm running to a problem extending it further, and there is something I don't think I understand.
Should I not be using the latest stable version of any library I can? Surely these libraries are backwards compatible?
If I am supposed to use the older version of library, to match the compile sdk (which I understand to mean I'm compiling for backwards compatibility, and supporting, say, lollipop API 21-22) then:
I would need a place to see a complete list of all versions of all libraries (which I cannot find), and
I would not be able to use new features like RecyclerView which only came in at Marshmallow API 23.
Am I missing something?
build.gradle (module app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.example.myFirstApp"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
...
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.intuit.sdp:sdp-android:1.0.3'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
Error message
The support library should not use a different version (26) than the compile sdk version (22).
You are using
compileSdkVersion 22
and
compile 'com.android.support:appcompat-v7:26.1.0'
error you are getting is because you are using compat version 26 while compileSdkversion is 22
You should update to compileSdkVersion to 26 and android studio will download required files so that your error will be removed. If you cannot update your compilesdk version to 26. Then change support library version to 22.2.1
compile 'com.android.support:appcompat-v7:22.2.1'
Got list of support libraries from link
https://developer.android.com/topic/libraries/support-library/rev-archive.html
and
https://developer.android.com/topic/libraries/support-library/revisions.html
I am new to Android Studio and whenever I try to build my project, there is an error when Gradle syncs. It says:
"Failed to find target with hash string 'android-25' in C:Users\Samyuktha\AppData\Local\Android\Sdk
Possible cause: Build properties not found for Android SDK Platform 25"
This happened when I first tried to build the app (I didn't modify anything). After this, I tried looking up solutions, and I went to the "Project Structure" menu and tried to change my compile SDK version and my build tools version. The problem is, the highest my compile SDK version goes is API 24 and the only available build tools option is 25.0.2. I set the compile SDK version to 24 and the build tools option to 25.0.2 and when I tried to run it, I got the error
"Error: Execution failed for task ':app:compileDebugAidl'. > java.lang.IllegalStateException: aidl is missing"
After this, I attempted to modify build.gradle, which is as follows (I changed compileSdkVersion, targetSdkVersion, and com.android.support:appcompat-v7:):
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.text'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Other things I've tried:
I tried using the SDK manager in Android Studio and installing everything with API 25. I clicked "Show Package Details" and installed the ones that appeared after clicking that also were API 25.
I tried running the standalone SDK manager in administrator mode and downloading build tools and everything under API 25 again
Thanks in advance
Launch SDK Manager -> Install the packages (SDK platform 25 and SDK build Tools 25.0.2).
If after installing, still the error occurs -
Build -> Rebuild Project.
You can try one thing...go to local sdk location and see what are the build tools you have downloaded. try those build versions.
I also faced same problem. I tried below things.
removed all dependencies apart from 'com.android.support:appcompat-v7:25.3.1'
changed constraint layout to relativelayout/linearlayout
go to sdk location and check which build tools i have.. in my case i had 23.0.1
so i edited compileSdkVersion as 23, buildToolsVersion as 23.0.1 support:appcompat as 23.1.1
I am facing a strange issue, i installed latest appcompat-v7:23.0.0
Where as i got to know i must not need it but i need to go with appcompat-v7:22.2.1 or appcompat-v7:22.0.0
I updated my gradle as per my needs but it always pickup appcompat-v7:23.0.0 which is not required, any one guide me how can i resolve this issue?
Since you are using
compile 'com.google.android.gms:play-services:+'
you are using the latest version compile 'com.google.android.gms:play-services:8.4.0' which has a dependency with support libraries v23.
You have to compile with API 23.
Change this line:
compileSdkVersion 23
If you don't want to use the api23 you can use a specific version like as
compile 'com.google.android.gms:play-services:7.8.0'
In general is not a good practice the use of + in your dependencies because you can't replicate the build in the future with the same libraries and you don't know which version you are using.
Also you can use api23 with Httpclient.
Just use:
android {
useLibrary 'org.apache.http.legacy'
}
More info here.
The useLibrary requires the gradle plugin 1.3.0 (classpath 'com.android.tools.build:gradle:1.3.0') or higher.
AppCompat (aka ActionBarCompat) started out as a backport of the
Android 4.0 ActionBar API for devices running on Gingerbread,
providing a common API layer on top of the backported implementation
and the framework implementation. AppCompat v21 delivers an API and
feature-set that is up-to-date with Android 5.0
You can use
compile 'com.android.support:appcompat-v7:22.0.1'
Finally
android {
compileSdkVersion 22
buildToolsVersion '22.0.1' // You can set buildToolsVersion '23.0.1'
Advice
You should use
compile 'com.google.android.gms:play-services:7.8.0' // or 8.4.0
Good Approach : Use latest Version .
you need to download the latest support repository from internal SDK
manager of Android Studio or from the stand alone SDK manager. Then
you can add compile 'com.android.support:appcompat-v7:23.0.1'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId ""
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
dependencies {
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services:7.8.0' // or 8.4.0
}
Edit
You can use this classpath
classpath 'com.android.tools.build:gradle:1.3.0'
Then Clean-Rebuild-Restart-Sync your project . Hope this helps .