Execution failed for task ':app:processDebugGoogleServices' - java

I have my build.gradle(app) as:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.dpka.myproject"
minSdkVersion 16
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'
}
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.firebase:firebase-core:12.0.1'
compile 'com.google.android.gms:play-services:12.0.1'
compile 'com.android.support:design:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.firebaseui:firebase-ui-database:3.3.0'
}
apply plugin: 'com.google.gms.google-services'
and build.gradle(project) as:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and I am getting the error:
Error:FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 12.0.1.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
I have changed the version of com.google.android.gms to 12.0.1(as shown in the code above), but still it's showing me this error, what should I do?

Change the following:
implementation 'com.google.firebase:firebase-auth:12.0.0'
to this:
implementation 'com.google.firebase:firebase-auth:12.0.1'
all firebase dependencies need to be the same version.

Related

Failed to resolve: com.android.support:appcompat-v7:jar

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'

How to fix "Cause: invalid type code: 8F"

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.

Unable to resolve dependency error while integrating any liabrary in android studio 3.1.3

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.

Could not find android-maven-gradle-plugin.jar in Android Studio 3.1?

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

Android Studio 3 can't build my project

I am using Android Studio 3 preview to code and build a android kotlin project but it does not seem to compile due to this error:
: java.lang.Exception: Unable to get response from daemon in 10000 ms
Could not perform incremental compilation: Could not connect to Kotlin
compile daemon Could not connect to kotlin daemon. Using fallback
strategy.
Error:Failed to complete Gradle execution.
Cause:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
Here is my gradle build file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.3-2'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "com.jr.app"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "DEMO_SERVER_URL", "https://demoserver.restlet.net/v1/"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:design:26.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.android.support:support-v4:26.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.0'
}
Thanks
Maybe you have the same error I had.
I solved here
Try to close android studio, delete .gradle and then open it. I had the same problem and it's fixed now.

Categories

Resources