Failed to find target with hash string 'android-24' in macOS - android

macOS Sierra
Android Studio Version 2.2.3
android-ndk-r13b
enter image description here
I have click "install missing platforms and sync project",now,in my directory android-ndk-r13b/platforms/,i did have android-24.
But the error still happens! Somebody else say that should edit file build.gradle,now my build.gradle contents is follow:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.mimo520.arderbud.myfirstandroidapplication"
minSdkVersion 22
targetSdkVersion 'N'
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.+'
testCompile 'junit:junit:4.12'
}
so how to fix this file? thanks!

Please, post your app's build.gradle (you've posted your project's build.gradle).
Often this problem is that you haven't current buildtools version, or your compile version doesn't match with the version of your buildtools and so on.

Related

Gradle sync failed: Plugin with id 'com.android.application' not found

I have updated my Android Studio from 2.x to 3.x. At first it showed gradle sync failed, then I fixed it somehow with the help of Stack Overflow. In that process I updated gradle. It fixed for some time later by following the steps in the Stack Overflow post. I deleted one file in gradle, now this is came out:
Gradle sync failed: Plugin with id 'com.android.application' not found
Please any one tell me how to fix it.
here is the file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.demoandroid.udacitybdcard"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), '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.1.0'
testCompile 'junit:junit:4.12'}

Running project on Android Studio fails because of missing app module

When I press on run in Android studio an Edit configuration windows pops up and says "Error: Module not specified".
I have added sources to the application libs folder by manually making a folder structure android/hardware/automotive/vehicle/V2_0 and copied the files in there.
Build completes without errors.
I haven't edited the MainActivity -class so it is all pre-generated code.
I believe this error has something to do with incorrect syntax when including but it seems to be hard to get it working :)
this is my settings.gradle file:
include ':app'
project(':app').projectDir = new File('libs/android/hardware/automotive/vehicle/V2_0')
and this is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.s26150.testingopencar"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), '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:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile project(":android.hardware.automotive.vehicle.V2_0")
testCompile 'junit:junit:4.12'
}
What could be the issue here?
thanks in advance.

After Downloading Android Studio 3.0 I am unable to compile my Projects in Android Studio 2.3.2

After Installing the Android Studio 3.0 Canary 4 I am unable to build the project in it and even I am unable to build the project in my old version of Android Studio 2.3.2
I have tried the following points
Added this line at gradle.properties - gradle.jvmargs=-Xmx1024m
tried Deleting the .gradle folder
Tried to run Android Studio as admin
Tried this also File>Invalidate Caches/Restart.
This is the screenshot
Any help is appreciable.
Thanks
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.android.ucssurvey"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
mavenCentral()
}
}
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:26.0.0-beta2'
compile 'com.android.support:design:26.0.0-beta2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
This issue was happening because my organisation have installed an antivirus which is Comodo Internet Security which is blocking the Firewall because of that some files are not updating.
After requesting to uninstalling the antivirus the issue is resolved.

The sdk platform-tools version (24.0.4rc1) is too old to check APIs compiled with 25

I am receiving following warning: "The sdk platform-tools version (24.0.4rc1) is too old to check APIs compiled with 25". But I updated my SDKs and tools. What might be the cause? I read and tried answers to similar problems but none of them did work.
My gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.***"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), '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.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.2.0'
testCompile 'junit:junit:4.12'
}
Screenshot
SDK

Unable to find Build Tools revision 25.0.0 rc1 in build.gradle

This is build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25 rc1"
defaultConfig {
applicationId "com.example.android.supportv13.sampleime"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
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.0.0'
compile 'com.android.support:support-v13:25.0.0'
testCompile 'junit:junit:4.12'
}
Whenever sync gradle project we are showing a dialog with following text
"All packages are not available for download! The following packages are not available:
- Package id build-tools;25.0.0-rc1"
Maybe just use an older version of gradle build. 23.0.3 works just fine for me.
According to the Android Developer Documentation website , the latest available build tool release is Build Tools, Revision 25.0.1 (November 2016). So you should change "25 rc1" to "25.0.1" in your build.gradle file.

Categories

Resources