I am newbie in Android Studio Platform. I am getting this error
" Failed to resolve: com.android.support:appcompat-v7:jar "
Currently my version Android Studio is 3.5.0.
I Have added google() on build.gradle repositories
This is my build.gradle (Project)
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my build.gradle (Module app)
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.kartik.barcode"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:jar:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
//implementation 'com.android.support:design:jar:28.0.0-alpha1'
implementation 'com.journeyapps:zxing-android-embedded:3.0.2#aar'
implementation 'com.google.zxing:core:3.2.0'
// implementation 'com.android.support:design:jar:28.0.0-alpha1'//for The edittext animation
implementation 'com.google.firebase:firebase-database:9.0.0'//for firebase
implementation 'com.google.firebase:firebase-auth:9.0.0'
implementation 'com.google.firebase:firebase-storage:9.0.0'
implementation 'com.google.android.gms:play-services-auth:9.0.0'
implementation 'com.google.firebase:firebase-appindexing:19.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
}
I am still getting this error:
ERROR: Failed to resolve: com.android.support:appcompat-v7:jar
Show in Project Structure dialog
Affected Modules: app
You should use PROPER version. There is no jar in this dependency.
Use stable
implementation 'com.android.support:appcompat-v7:28.0.0' //28.0.0-alpha1
FYI
Please fix the version conflict either by updating the version of the
google-services plugin or or updating the version of
com.google.android.gms to 11.4.2
You should upgrade below version
implementation 'com.google.android.gms:play-services-auth:17.0.0'
It will be good approach if you use upgraded classpath
classpath 'com.google.gms:google-services:4.2.0'
Related
It Shows:
Failed to resolve: com.android.support:support-v4:30.0.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app
build.gradle(:app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion '30.0.2'
defaultConfig {
applicationId "com.example.android.miwok"
minSdkVersion 15
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:30.0.0'
implementation 'com.android.support:support-v4:30.0.0'
implementation 'com.android.support:design:30.0.0'
}
Use the androidx library mostly you need to use this now:
To use this you need to add Androidx support to your project if it is not migrated to Androidx.
You can find here how to migrate project to Androidx.
implementation 'androidx.appcompat:appcompat:1.2.0'
or use the last support library:
implementation 'com.android.support:appcompat-v7:28.0.0'
It is because the support libraries you trying to use don't exist.
For Add Google Maven repository and google() do this inside build.gradle which outside of app directory.
allprojects {
repositories {
google()
maven {
url 'https://maven.google.com'
}
jcenter()
}
}
The support libraries v30 don't exist.
Remove them.
Use the androidx libraries:
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.2.1'
To use them you have to add the google() repo in your top-level build.gradle file:
allprojects {
repositories {
google()
jcenter()
}
}
Cause: invalid type code: 8F this error raise when try to take apk build.
Already I tried.. -- clean and rebuild -- Invalidate and restart -- jdk path setting -- experimental option
Android studio version 3.3.1
gradle version -- classpath 'com.android.tools.build:gradle:3.2.1'
project level gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.app"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:28.0.0'
implementation 'nl.psdcompany:duo-navigation-drawer:2.0.6'
apply plugin: 'com.google.gms.google-services'
}
I attached my app and project level gradle file.
Recently i have updated android studio to 3.1.3 everytime i am getting the "Unable to resolve Ddependency" error. Stuck with this problem already i have wasted lotts of days solving this error but nothing works. Please help me to resolve this error.I have uploaded my gradle file here and also the error log.
Below is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.administrator.myapplication1"
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'
}
}
`}`
`repositories {`
`maven {`
url "https://jitpack.io"
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:design:27.1.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation('com.github.ozodrukh:CircularReveal:2.0.1#aar') {
transitive = true;
}
implementation project(':library')
api 'com.github.ozodrukh:CircularReveal:1.1.1'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.google.gms.google-services'
`
Error log:
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Unable to resolve dependency for ':app#debug/compileClasspath': Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.11.0): Skipped due to earlier error
Open File
Show Details
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.11.0): Skipped due to earlier error
Open File
Show Details
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.11.0): Skipped due to earlier error
Open File
Show Details
Unable to resolve dependency for ':app#release/compileClasspath': Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.11.0): Skipped due to earlier error
Open File
Show Details
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.11.0): Skipped due to earlier error
Open File
Show Details
`
Project(build.gradle):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
allprojects {
repositories {
maven {
url "http://dl.bintray.com/florent37/maven"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
maven {
url "https://jitpack.io"
}
Please add this line in your project level gradle file under repositories. because the library circularReveal is using repo from jitpack. Also remove circular Reveal and rebuild the project, it should be able to build properly.
Project Level Gradle
buildscript {
repositories {
google()
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App Level Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.yourcomp.stackoverflow"
minSdkVersion 16
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 {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:design:27.1.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
}
You Just need to update your SDK tools according to the library, and it will work.
The error which I am receiving is this:
Error:Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge
dex
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "app.monmos"
minSdkVersion 21
targetSdkVersion 27
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'
}
}
buildToolsVersion '27.0.3'
productFlavors {
}
}
android {
defaultConfig {
multiDexEnabled true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.github.jd-alexander:android-flat-button:v1.1'
//Libraries
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-messaging:12.0.0'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:12.0.0'
implementation 'com.google.firebase:firebase-database:12.0.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support:support-annotations:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.firebaseui:firebase-ui-database:3.1.1'
}
apply plugin: 'com.google.gms.google-services'
This is my project build.gradle project:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have updated the firebase version from 10.2.0 to 12.0.0 and the app is bringing up an error saying telling me to merge dex. I think 2 libraries are clashing.
This is because the following Firebase-UI:
implementation 'com.firebaseui:firebase-ui-database:3.1.1'
Has a strict dependencies of:
Firebase/Play services version 11.6.2
Support Library version 27.0.1
So, you need change the dependencies according to it.
You can view the documentation in case you need to use the recent supported Firebase/Play service at Firebase-UI for Android.
My Android is work fine in Android Studio 3.0.1 , but it show the follow build error after I update to the Android Studio 3.1.
Could not find android-maven-gradle-plugin.jar (com.github.dcendents:android-maven-gradle-plugin:2.0).
Searched in the following locations:
https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/2.0/android-maven-gradle-plugin-2.0.jar
The build.gradle is like the following:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And in app/build.gradle :
apply plugin: 'com.android.application'
apply plugin: 'android-maven'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.aitrix.wen.seaglider"
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
compile project(':AHRSView')
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Did I missing something ? Thanks in advance.
After I update the following , the project work fine.
Update
classpath 'com.android.tools.build:gradle:3.0.1'
to
classpath 'com.android.tools.build:gradle:3.1.0'
And Update
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
to
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
also update the gradle-wrapper.properties to
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip