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.
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 a problem using jfeinstein10 Sliding Menu
I added the library into my root project folder. But I get this error :
Error:The SDK Build Tools revision (17.0.0) is too low for project
':SlidingMenu'. Minimum required is 19.1.0
But I'm already using "19.1.0" but it still says I'm using 17.0.0
Here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.repliklernet.replikler"
minSdkVersion 14
targetSdkVersion 22
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 'com.android.support:appcompat-v7:22.2.1'
compile group:'com.squareup.picasso', name:'picasso', version:'2.5.0'
compile project(':SlidingMenu')
}
What am I missing ?
If you look at the build.gradle file for the library, you can see that it references build tools 17: https://github.com/jfeinstein10/SlidingMenu/blob/master/library/build.gradle#L17
You need to update that line.
The error is actually giving you a hint by mentioning project ':SlidingMenu', referring to the project SlidingMenu.
Right click on the project folder and choose 'Open Module Setings'
Select 'app' on the Modules List(Left pane)
Select 'Properties' tab and will present you with 'Compile SDK Version', 'Build Tools Version'.
Click OK
Reference : https://www.youtube.com/watch?v=v4b7C6Q-9dI
You should change the build.gradle within your library
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.
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'
}
}