Gradle asks for nonexistent support library version - android

Recently I've been getting this problem.
As far as I know, there is no 26.X.X versions of these support libraries, what does Gradle wants from me?

After reviewing a previous question, you may want to be sure that your compileSdkVersion matches across the board, if you want to build in 25 but you are in 23.
This support library should not use a different version Error in build.gradle
You can confirm versions by >> Create new project in Android studio >> Press Ctrl+Shift+Alt+S >> Proceed to 'Project' section >> You can see actual gradle version and android pluging version. Copy that to your project.

The problem lies in your Compile version in build.gradle file.
It seems, your compile version is 26.
Please change your compile version to 25 and sync gradle.
compileSdkVersion 25
buildToolsVersion "25.0.3"

Please set your Compile Version to 25
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.user.xxxxx"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
}

Related

How to fix Gradle error when change SDK version 26 to 28

I'm tried to upgrade the SDK version 26 to 28 , but Gradle shows error . How can i resolve this error
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
}
Above dependency shows error
android {
compileSdkVersion 28
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 10
versionName '1.5'
}
Build Error report
Error clearly mentioned that you are using two version of support library 28.0.0 and 26.1.0. Please make all 28.0.0. Hope this solve your problem.
Also you are using some library that are already migrated to AndroidX. To use this you also have to migrate your project to androidX. Try
Refactor > Migrate to AndroidX
And press DoRefactor

How to only use Android 21 in all app dependencies?

I want to ONLY target Android Lollipop (21) for app development but Android Studio seems to force me download and install all the latest tools up to Android Oreo (28). Some of the information was removed for brevity. Let me know if you need to know anything else.
App Gradle
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
}
dependencies{
implementation 'com.android.support:appcompat-v7:21.0.0'
implementation 'com.android.support:support-v4:21.0.0'
implementation 'com.android.support:design:21.0.0'
}
Project Gradle
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
Errors that I have been getting,
ERROR: Failed to find Build Tools revision 26.0.2
Google Play requires that apps target API level 26 or higher. <= at targetSdkVersion
As of now I am trying to reinstall Android Studio

AndroidStudio Failed to Sync Gradle project, Failed to find target Google Inc

How can I resolve the Gradle Sync problem?
I installed the missing SDK versions but the error shown again.
Take a look to the screenshots please...
Screenshot 1
Screenshot 2
Thank you in advance.
Your compileSdkVersion must be a number, not a String
Example:
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.yourpackage.yourapp"
minSdkVersion 11
targetSdkVersion 24
versionCode 4
versionName "1.3"
}
...
}
You also need to open up "build.gradle" script and change the classpath to latest gradle repository.... mine is 'com.android.tools.build:gradle:3.0.0-alpha3'
Hope this helps everyone

Gradle Sync Fail

I get this error when trying to build my app:
Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha1
Required by:
MyApp:app:unspecified
Gradle version:
classpath 'com.android.tools.build:gradle:2.3.0-alpha2'
Android studio version;
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "MyApp"
minSdkVersion 22
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}
I tried going to SDK TOOLS and enabling the constraint solver, but I did not help. This happened just today, and have not have had this issue earlier. Any ideas?
Check if you have installed ConstraintLayout. Open SDK Manager and than in SDK Tools tab you can check what version of ConstarintLayout is installed.

Android compile project with target="android-19" failed

Masters,
Recently I am trying to build android project with gradle, and since there one API(#JavascriptInterface annotation) I need to use is only up to api level 17, so I changed my targetAPILevel to 19 in project properties. And it works well when I build the project from Eclipse(Right click on project and Run Android Application).
But when I tried to build the project by gradlew in terminal, it seems it never use target level 19 to build the project. Here is part of the build.gradle file as follow:
android {
// target = 'android-19'
compileSdkVersion 19
buildToolsVersion '19.0.1'
}
Can anyone help me what I did wrong in here, please? Thank you very much.
TargetSdkVersion and compileSdkVersion are different parameters.
In eclipse, you set the target in your Manifest, and set the api used to compile with right click -> properties -> Android Manu.
In your build.gradle you should use something like this:
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
}

Categories

Resources