Install repository and sync project makes android studio freeze - android

I tried to get the latest version of the google play services for the maps api, using compile 'com.google.android.gms:play-services-maps:11.2.0' in the gradle file and also put the google maven url in the project gradle.
My problem is that when i try to sync my gradle files, i get an error and android studio proposes to install repository and sync project, but when i click on it nothing happens and android studio freezes for a few seconds.
The same happens if i add the whole google play services with compile 'com.google.android.gms:play-services:11.2.0'
I tried the invalidate cache/restart technique, i uninstalled/installed the google play service in the sdk manager and i don't know what to do to resolve this problem.
The build.gradle is like this (it works with the 11.0.4 version) :
apply plugin: 'com.android.application'
def dbflow_version = "4.0.5"
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "not telling"
minSdkVersion 21
targetSdkVersion 25
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'
})
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.google.android.gms:play-services-identity:11.0.4'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
Do you have a way to fix this ?

Related

Errors with the gradle file and the Imports on my Project

I am developing a project to parse data as JsonObject from the StarWars API (https://swapi.dev/api/). I am using a recyclerView to present the data in the View and some interfaces to have the relevant methods for the loading of data and handling of errors (with a client and server connection service). The project was working correctly, without errors until today where out of the blue I am getting several imports highlighted with red.
My gradle file is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "26.0.3"
defaultConfig {
applicationId "com.juangm.bottomnavigationmvp"
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 {
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.3.1'
compile 'com.android.support:cardview-v7:27.3.1'
compile 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.android.support:design:27.3.1'
compile 'com.android.support:support-v4:27.3.1'
testCompile 'junit:junit:4.12'
compile 'com.jakewharton:butterknife:10.0.0'
implementation 'com.jakewharton:butterknife-compiler:10.0.0'
compile 'com.squareup.retrofit2:retrofit:2.5.0'
compile 'com.squareup.retrofit2:converter-gson:2.5.0'
compile 'com.squareup.okhttp3:okhttp:3.12.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.3'
compile 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
}
Errors as they appear in the BottomNavigationActivity class:
Bottom Navigation Activity
Any help is much appreciated. I tried to change some dependencies on my Gradle file, invalidate caches etch. but with no success. Maybe it is somehow related to the Android studio?
Change buildToolsVersion to "27.0.3"
Clean build project
Invalidate cache / Restart Studio
If none of these above not work comment, please.

Android studio generating a 3 different APK [duplicate]

This question already has an answer here:
Android studio used to generate 1 release apk, now it's 3. What does each of them do?
(1 answer)
Closed 5 years ago.
I wanted to generate a singed APK for my application via Build > Generate Signed APK after this i got 3 different APK one is app-armeabi-v7a-release.apk another one is app-universal-release.apk and the last one is app-x86-release.apk.
What's the difference between each one! What version i should upload to the Google Play Store!
I'm using Ubuntu 16.04 and Android Studio 3.0.1.
Here my Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "my.app.package.name"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a'
universalApk true
}
}
}
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:25.4.0' //25.3.1
compile 'com.android.support:design:25.4.0' //25.3.1
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.android.support:support-v4:25.4.0' //25.3.1
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
compile 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'id.zelory:compressor:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.google.firebase:firebase-messaging:11.8.0' //10.2.0
compile 'com.github.hani-momanii:SuperNova-Emoji:1.1'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
compile 'com.github.adrielcafe:AndroidAudioRecorder:0.3.0'
compile 'com.github.adrielcafe:AndroidAudioConverter:0.0.8'
compile 'com.github.halysongoncalves:pugnotification:1.8.1'
}
apply plugin: 'com.google.gms.google-services'
At first you must read that Generate signed apk android studio
It always for market
release {....

Android dependency error compile 'com.android.support:appcompat-v7:26.+'

This was working before I added firebaseui dependency. Now I'm getting this: log
Its red lining compile 'com.android.support:appcompat-v7:26.+' and when I hover over it, it says "all libraries must be exact same specification version". That version was what was there when the project was created.
app/build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.android.adarak"
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 {
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:support-v4:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
//compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.firebaseui:firebase-ui:2.3.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
The firebaseui internally has a dependency on a specific version of Android support library. The firebase ui configuration contains 26.0.1 as the required support library version.
However your gradle file has a dependency on 26.+ which tells gradle to use the latest in the 26.x.x series and this could be different from 26.0.1. You can solve the issue by using the specific version required by firebase-ui (26.0.1)
Change the gradle file as shown below,
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'

Android App build fail because of firebase-storage:11.0.2 dependency

I am trying to get some files url's from my firebase storage and to do so you must add the dependency:
compile 'com.google.firebase:firebase-storage:11.0.2'
to your app in the app level gradle file. I did this, but now I receive the error:
Error: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 10.0.1.
I've looked the problem up online and the only solution I have found is that I need to add:
apply plugin: 'com.google.gms.google-services'
to the bottom of my app level gradle file, which I already did awhile ago. I cannot seem to figure out what is causing this error.
app level gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.lonelygamer.dmc"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
}
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:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:11.0.2'
compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
The versions of all Firebase and Google Play Services dependencies must be identical. Also recommend using the latest version of the Support Library: 25.4.0.
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:25.4.0' // RECOMMENDED CHANGE
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:11.0.2' // CHANGED
compile 'com.google.firebase:firebase-database:11.0.2' // CHANGED
compile 'com.google.firebase:firebase-storage:11.0.2'
compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
testCompile 'junit:junit:4.12'
}
update your SDK then update the build gradle file with new APIs and google services at.... then sync the gradle

Android Studio Error:Execution failed for task ':app:compileDebugJavaWithJavac'

I updated Android Studio and SDK tools to the latest version and now I got this error. I have updated Google Services and firebase dependencies accordingly. I tried to clean and rebuild the project but the result is same.
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NullPointerException: element == null
Here is my gradle build:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.crisser.beitnaonline"
minSdkVersion 16
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'
}
}
}
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'
})
//noinspection GradleCompatible
compile('com.android.support:cardview-v7:23.2.0') {
force = true
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:11.0.0'
compile 'com.google.firebase:firebase-auth:11.0.0'
compile 'com.google.firebase:firebase-core:11.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile
'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.appolica:interactive-info-window:v1.0.6'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
}
apply plugin: 'com.google.gms.google-services'
Anyone knows why it does that? It worked just fine with 25.0.3.
You didn't compile corresponding dependency with annotation
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
Add this to your gradle file
compile 'com.github.bumptech.glide:glide:4.0.0'
I have gone through same issue. I just removed the dependency I added and my app began to work fine.
you should remove library one by one and build the application..

Categories

Resources