I have just upgraded my Android Studio but when I try to build/compile the project, I get the following error:
`Error:Execution failed for task ':libraries:facebook:preBuild'.
Build Tools Revision 19.0.0+ is required.`
My gradle looks like this:
Dependencies
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
apply plugin: 'android'
Android
compileSdkVersion 19
buildToolsVersion "19.0.3"
SDK Manager:
As you can see, I have installed pretty much every Android SDK Build-tools version. yet still, the error persists.
Any ideas?
Update
Dependies - which is at the bottom of the gradle file:
dependencies {
compile 'com.android.support:support-v4:18.0.+'
compile 'com.google.maps.android:android-maps-utils:+'
compile project(':libraries:facebook')
compile 'com.google.android.gms:play-services:3.2.25'
compile files('libs/TestFlightLib.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/svg-android.jar')
}
I tried changing the support version to 19.0.+ but it still didn't work.
I was looking in the wrong Gradle. The error specified that the error is coming from the "Facebook" gradle and not the gradle which belongs to the app. Each library has it's own gradle. So, the facebook's gradle's builTolsVersion was 18.0.0 instead of 19.0.0.
Duh!
Have you tried right-clicking your project-> Android Tools->Add Support Library-> select Android Support Library, revision 19, click on Accept Licence and Install.
Try to invalidate caches / restart , it fixed this like this after updated AS.
File-> Invalidate caches/restart -> Invalidate And restart.
The file <YourProject>/app/build.graddle should be changed to match version of the files you have in the SDK Manager (green icon of the robot with arrow pointing down - just under Help menu). You have two options:
1) download the version you need (in SDK Manager) for which Android Studio shows links to click on them to download proper version)
2) modify the file above to match version(s) of the files you have in your SDK Manager (ie probably version numbers matching your updated-to-latest-greatest-version)
Then rebuild your project.
The way I fix this problem was by pasting the code, into the android of your graddle file
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
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.
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 have many problem with import module in android studio.
The first time when i tried to import module , gradle said : target sdk not found.
Then i installed target sdk , gradle said target platform-tools not found. And these errors not solving with installing sdk and platform-tools.
I have these errors while try to import sherlockactionbar and many else library.
gradle version : 2.8
Please tell me how to solve this problem.
build.gradle of my app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "a.x.e.h.myapplication"
minSdkVersion 19
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':mylibrary')
compile project(':actionbarsherlock')
compile project(':actionbarsherlock-fest')
compile project(':actionbarsherlock-i18n')
}
error when i added dependency module:
Error:failed to find Build Tools revision 17.0.0
Install Build Tools 17.0.0 and sync project
May be you are using a build tool not existing in your installation.
Open your SDK Manager and download the latest Build Tools (23.0.2).
Update your build.gradle files (in your app and in your modules).
To do it change this line:
buildToolsVersion "20.0.0"
with
buildToolsVersion "23.0.2"
You should check your Project Structure and put the correct Path to the Android SDK.
Error:failed to find Build Tools revision 17.0.0
Install Build Tools 17.0.0 and sync project
I've solved the same problem with simply clicking on link above ( Install Build Tools 17.0.0 and sync project), Android Studio automatically downloaded Build Tools revision 17.0.0 and all now is working correctly.
I am using Android Studio 1.2.2 to develop an Android Application. In my build.gradle file, I have defined the compileSdkVersion to 21 since the beginning of the work. Now I wanted to change that to 19, since this software actually will never be installed on an Android device, that runs a higher version than Android 4.4
When I try to change this value to 19, the project does not compile anymore.
After the change of the version value I have:
synced the project
cleaned the project
rebuild the project (tried)
But the following error occurs:
In the file /projectpath/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values-v21/values-v21.xml it marks 103 errors, saying "cannot resolve symbol".
values-v21.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/lmp-mr1-supportlib-release/frameworks/support/v7/appcompat/res/values-v21/styles_base_text.xml -->
<eat-comment/>
<style name="Base.TextAppearance.AppCompat" parent="android:TextAppearance.Material"/>
<style name="Base.TextAppearance.AppCompat.Body1" parent="android:TextAppearance.Material.Body1"/>
<style name="Base.TextAppearance.AppCompat.Body2" parent="android:TextAppearance.Material.Body2"/>
<style name="Base.TextAppearance.AppCompat.Button" parent="android:TextAppearance.Material.Button"/>
....
cannot resovle symbol android:TextAppearance.Material
cannot resovle symbol android:TextAppearance.Material.Body1
cannot resovle symbol android:TextAppearance.Material.Body2
cannot resovle symbol android:TextAppearance.Material.Button
and so on...
What is causing this error? What can I do to make it compile again?
When I change back the compileSdkVersion to 21, everything works normal again.
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '23.0.0 rc3'
defaultConfig {
applicationId 'com.appname.id'
minSdkVersion 17
targetSdkVersion 19
versionCode 1
versionName "0.0.2 Alpha"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
to use appcompat-v7:22.2.0 you have to compile against API 21. There's no harm in doing it, even if it will never run on devices running 21.
You can try some older version of the app compat, but then you will be missing in "cool new features" and bug fixes from the latest app compat.
If this might help someone, after MANY trials and errors, I found that I was targeting the wrong SDK version (an older one) in the build.gradle file corresponding to "library". To change this you can do it by hand or go to the Module Settings Menu (right click on your project folder -> Open Module Settings. Then in "library" - Properties you can change the Compile Sdk and the Build Tools Versions
make sure you have installed API 19 in sdk manager
I imported a project into Android Studio from Eclipse. It was building successfully in Eclipse.
At the end of importing process I got this error:
Gradle project sync failed. Basic functionality will not work
In the Gradle console I get the following error:
Error:Failed to find: com.android.support:appcompat-v7:20.+
I have already installed google support repository as mentioned in other places.
This is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "21.0.0"
defaultConfig {
applicationId "com.entujn.demo"
minSdkVersion 10
targetSdkVersion 19
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.txt'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:20.+'
compile files('libs/commons-lang3-3.3.2.jar')
}
local.properties:
sdk.dir=/home/pankaj/adt-bundle-linux-x86_64-20140702/sdk
SDK directory structure screenshot
Looks like the appcompat stuff is not present at the right place, how do I fix it ?
Looks like Android Studio uses another copy of SDK, which does not have Android Support repository installed. Please make sure it has all needed components installed.