So, I built an app using targetSdkVersion 25, but then I realized that it's necessary to be higher than 26. I tried to upgrade it to API 27 and I am getting this error:
Error:(24, 13) Failed to resolve: com.android.support:appcompat-v7:27.0.0
Under this message there are three options:
Install Repository and sync project
Show in File Show in Project
Structure dialog
My build.gradle(Project):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.simon.onequoteaday"
minSdkVersion 14 //9
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-ads:11.0.0'
compile 'com.android.support:appcompat-v7:27.1.1'
}
I've also installed all API 27 SDK.
Any possible solutions? Thank you
Edit:
I've already used the solution provided by other threads but they don't solve my problem. I think my problem is different.
replace maven {url "https://maven.google.com"} with google(); the location has changed.
Change
buildtoolsversion '27.0.0'
and dependencies as:
compile 'com.android.support:appcompat-v7:27.0.0'
and stay connected to internet and download whatever repository it asks.
Hope it helps.
Installing the newest Android Studio version solved the problem
Related
I have project which was working fine till yesterday but this morning when i try to build it keeps throwing failed to resolved support-vector-Drawable error.
I try to clean and this error shows up
Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find support-vector-drawable.aar (com.android.support:support-vector-drawable:26.0.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-vector-drawable/26.0.2/support-vector-drawable-26.0.2.aar
and here is my gradle
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.arizeh.arizehplus"
minSdkVersion 17
targetSdkVersion 22
multiDexEnabled true
versionCode 29
versionName "3.0.5"
useLibrary 'org.apache.http.legacy'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:26+'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
}
and here is my level build.gradle file
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.24.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'http://jhoobin.abroid.com/repo/' }
maven { url "https://jitpack.io" }
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Hi as per my understanding please try bellow tow thing one
One is replacing your app compact version dependancy with specific version else of plus
compile 'com.android.support:appcompat-v7:26+'
Replace with (Please set as per your build tool)
compile 'com.android.support:appcompat-v7:26.1.0'
And Another thing try updating your build tool version.
so after half day searching and rebuild finally it fixed by upgrading my compileSdkVersion and all other library to 27 ... I hope this help any one who has this problem
defaultConfig {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
Change to
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
I updated my Android Studio to version 3.0.1, and then Gradle to 4.2 and Android plugin tools to 3.0.1. After that whenever I create a new project it gives me the Gradle build problem.
This is my module build.gradle:
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.nasser.studio.test"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:27.0.3'
}
Also I unchecked the work offline for gradle.
I also checked AS settings which displays some errors:
Update 1:
When I change the compile SDK to version 25 like this, the Gradle build is completed correctly.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.nasser.studio.test"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:25.3.1'
}
But changing to latest versions (26 or 27), it gives me the same error. I also should mention that during Gradle build process for these versions, it's downloading files from Maven repositories which doesn't happen in version 25 ( I'm using a proxy connection).
Moreover, the search box of AS for support library gives me this version which is not the latest version (27.0.2).
You should use stable v7:27.0.2 instead off v7:27.0.3.
implementation "com.android.support:appcompat-v7:27.0.2"
FYI
If you are using Android Studio 3.0 or above make sure, your build.gradle (PROJECT level) file looks like this:
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
google()
}
}
Then Clean-Rebuild-Run.
Add this to your project level build.gradle file:
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
}
}
Change this on your Project level build.gradle
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
first, check with your gradle-wrapper.properties which should be having this
distributionUrl=\
https\://services.gradle.org/distributions/gradle-4.1-all.zip
and in project-level build.gradle
build script {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
also you need to change according this
https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#new_configurations
and see the topic Migrate dependency configurations for local modules
you will get better idea what things need to change in dependencies.
After upgrading to Android Studio 3.0 I had some issues with gradle that I was able to fix checking on the developers website
However, I was not able to find how to fix the issue with the apply plugin: 'android-apt' I have tried several things such as removing it from the project gradle and add it to the app gradle as annotationProcessor 'com.neenbedankt.gradle.plugins:android-apt:1.8' . also removed the apt, etc, etc.
Anyway, Studio is complaining about it. Any help is greatly appreciated. Thanks!
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
ext {
supportLibVersion = '27.0.0'
firebaseLibVersion = '11.4.2'
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
APP GRADLE
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.0"
defaultConfig {
applicationId "xxxxxxxxxxxxxxxxxxxx"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
apply plugin: 'android-apt'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:appcompat-v7:${supportLibVersion}"
.....
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
Do not use apt plugin, add the dependency like this:
compile "com.jakewharton:butterknife:8.8.1"
annotationProcessor "com.jakewharton:butterknife-compiler:8.8.1"
Reference
If you are in hurry you can disable that thing.
As per Document
If you are experiencing issues migrating to the new dependency
resolution strategy, you can restore behavior to that of Android
plugin 2.3.0 by setting includeCompileClasspath true. However,
restoring behavior to version 2.3.0 is not recommended.
android {
...
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
}
And one more thing you have to define flavorDimensions "default" property in buildTypes tag in gradle file.
You can check more about this here.
I am trying to build gradle with the following dependencies. but its not compiling. I have tried a lot by changing the versions by seeing forums. I search for the dependencies in project structure dialog and found the following two.
de.hdodenhof:circleimageview:2.0.0
com.mcxiaoke.volley:library-aar:1.0.1
Actually I am using two pc. This was build in another pc with following
de.hdodenhof:circleimageview:1.2.1
com.mcxiaoke.volley:library-aar:1.0.19
Still no luck and the gradle build taking 20-25 minutes each time
Main build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.map"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.4#aar') {
transitive = true
}
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:recyclerview-v7:23.0'
}
This sounds like gradle is unable to reach the remote repository. Does your firewall block it, is your internet connection working,...?
So I am trying to implement the infinite scroll in the tabs like this: ViewPager as a circular queue / wrapping. This is github: https://github.com/antonyt/InfiniteViewPager
I am trying to add the dependencies to my build.gradle but I get an error: "Failed to resolve: com.antonyt. infiniteviewpager:library:1.0.0. Do you know how I can solve this? I tried clean project and invalidate cache/restart.
This is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.example.mariogp18.tanga"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.antonyt.infiniteviewpager:library:1.0.0'
}
This is my other build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my code: https://www.dropbox.com/s/ipe4zz1u3r0lnqt/App.zip?dl=0
This library is not on jcenter - there is also an open ticket for this:
https://github.com/antonyt/InfiniteViewPager/issues/35
you can look here: https://jcenter.bintray.com/com/ - no antonyt there
you might want to use jitpack.io then