android unable to build the project showing install missing files - android

Codes of build.gradle(Module.app)
After,creating my project it was showing incompatible version.So,Found in internet to modify my gradle file but after modifying gradle file and changing compile sdk from 26 to 27 it's showing install the missing file .
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.example.thelost.fisp_beta10"
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 {
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:27.+'
compile 'com.android.support:recyclerview-v7:27.+'
compile 'com.android.support:design:27.+'
compile 'com.android.support:cardview-v7:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Error: Showing in my project

Click on the error if any, it will automatically download.
From the docs
You should always keep your Build Tools component updated by
downloading the latest version using the Android SDK Manager. If
you're using Android plugin for Gradle 3.0.0 or higher, your project
automatically uses a default version of the build tools that the
plugin specifies. To use a different version of the build tools,
specify it using buildToolsVersion in your module's build.gradle,
The latest buildToolsVersion is 27.0.1
So change
buildToolsVersion "27.0.2"
to
buildToolsVersion "27.0.1"
and sync your project.

try this in app level gradle
repositories {
maven {
url "https://maven.google.com"
}
}

Related

I can't see the design page and a few other issues

After I update the android studio to version 3.0.1, when I open my project. I have get some error and I can't see the design page but if I run the app. I have no issue.
First this error:
Warning:The specified Android SDK Build Tools version (23.0.3) is
ignored, as it is below the minimum supported version (26.0.2) for
Android Gradle Plugin 3.0.1. Android SDK Build Tools 26.0.2 will be
used. To suppress this warning, remove "buildToolsVersion '23.0.3'"
from your build.gradle file, as each version of the Android Gradle
Plugin now has a default version of the build tools.
The second error:
Failed to load AppCompat ActionBar with unknown error.
This is my build.gradle(app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "ir.hosseinyha.kardoon"
minSdkVersion 16
targetSdkVersion 23
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:23.0.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
Tanks for help
You should upgrade all your com.android.support dependencies to minimum supported versions (26.0.2+).
Also change tarcompileSdkVersion, buildToolsVersion, targetSdkVersion to actual values (26+ but better to support latest - 28). Note that dependencies should have same version as buildTools and targetSdk.

Android studio 2.3.3 build error with gradle-3.3.3 and android-plugin-2.3.3

In android studio-2.3.3
Error:java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
It's a hello world application.
How can I solve this error?
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.shibly.myapplication"
minSdkVersion 10
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'
testCompile 'junit:junit:4.12'
}
try to look in this :
Gradle on Android Studio loading with error
"I had the same problem. I fixed it by downgrading my build tools version from 24.0.1 to 23.0.3.
Download older build tool version from http://dl.google.com/android/repository/build-tools_r23.0.3-linux.zip
, Extract the downloaded file and paste it in your SDK build-tools directory( mostly /home/user/Android/Sdk/build-tools)
,
Now in your app:gradle file change the buildToolsVersion to "23.0.3"
, Sync your gradle file and you should be good to go
Hope google fixes its build-tools bug"

Gradle: espresso-core & appcompat failed to resolve; SDK installation doesn't have the extras

I've installed Android Studio and I've tried to create app.
My build.gradle module file is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.a79231.myapplication"
minSdkVersion 22
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.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
testCompile 'junit:junit:4.12'
}
I have installed sdk tools and 26.0.0 is installed
I've got the errors:
Error:(23, 24) Failed to resolve: com.android.support.test.espresso:espresso-core:2.0
Install Repository and sync projectShow in File
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:26.+
Install Repository and sync projectShow in File
SDK installation doesn't have the extras
Event Log says: Android SDK Tools Version 24.0.2 or later is required. Install latest SDK Tools. Why? I have 26.
I tried to change espresso-core:2.0 to espresso-core:2.2.2 and appcompat-v7:26.+ to appcompat-v7:26.0.0 but the errors are the same.
Also I tried to reinstall Android Studio. Result is the same.
Add to the main build.gradle in repositories block
maven { url 'https://maven.google.com' }

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.

Android Studio - Unable to find optional library: org.apache.http.legacy

I am making an android app which features navigation drawer. I remember that I used some features that requires sdk version to be 24 so compileSdkVersion needs to be 24 as well as the targetSdkVersion, but my android phone is only 19 so I don't see the app downloaded on my phone, it is opened once I finished running the project but when I close the tab on my phone, I cannot open it again. So I tried to change the compileSdkVersion and targetSdkVersion to 19 but I'm having this error: Unable to find optional library: org.apache.http.legacy
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.marivel.cruz.threatmapping"
minSdkVersion 17
targetSdkVersion 19
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'
}
}
signingConfigs {}
buildTypes {}
useLibrary 'org.apache.http.legacy'
}
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:19.+'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services-maps:9.8.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services:9.8.0'
testCompile 'junit:junit:4.12'
}
This might seem like a workaround, but try commenting out the use library line and add the following under dependencies in your gradle build file :
dependencies {
compile files('libs/httpclient-4.4.jar')
compile files('libs/httpcore-4.4.jar')
compile files('libs/httpmime-4.3.6.jar')
}
You will have to download those files from apache and add them to your libs directory. This has worked for me before, but as I said, it feels a bit like a workaround.
You can find those jar files here:
Httpclient
Httpcore
Httpmime

Categories

Resources