I'm trying to move my Android app to API 28 (Android 9/P)
I'm getting 5 errors that I can't fix.I'm still relatively new to Android development and I think, I might not have the best updating approach.
I've already tried to clean and rebuild but the problem is still happening.
Here is my project gradle:
buildscript {
ext.kotlin_version = '1.2.61'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.1.0'
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.realm:realm-gradle-plugin:5.4.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And here's my application gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'
android {
lintOptions {
checkReleaseBuilds false
}
compileSdkVersion 28
defaultConfig {
applicationId "org.siku.siku"
minSdkVersion 21
targetSdkVersion 28
versionCode 118
versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true //important
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude module: 'support-annotations'
})
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.material:material:1.0.0-rc01'
implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0-rc01'
implementation 'androidx.core:core-ktx:1.0.0-rc01'
implementation 'androidx.exifinterface:exifinterface:1.0.0-rc01'
implementation 'androidx.vectordrawable:vectordrawable:1.0.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0-rc01'
implementation 'androidx.browser:browser:1.0.0-rc01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.amitshekhar.android:android-networking:1.0.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'joda-time:joda-time:2.9.9'
implementation 'info.hoang8f:android-segmented:1.0.6'
implementation 'io.nlopez.smartlocation:library:3.3.3'
implementation 'com.facebook.android:facebook-android-sdk:4.35.0'
implementation files('libs/CircleImageView-master/gradle/wrapper/gradle-wrapper.jar')
implementation 'org.greenrobot:eventbus:3.1.1'
testImplementation 'org.mockito:mockito-core:2.8.9'
testImplementation 'junit:junit:4.12'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
google()
}
I am getting 5 errors:
1- Program type already present: android.support.customtabs.ICustomTabsCallback
2- Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
3- Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
4- Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
5- Caused by: com.android.tools.r8.utils.AbortException
I've been trying to find documentation on the matter.
Any suggestions or links to documentation would be appreciated.
Maybe have you forgotten this: implementation 'com.android.support:multidex:1.0.3' in your dependencies
Related
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'
I am facing a problem, when i sync my project this gradle error occurs :(
ERROR: Could not find method android() for arguments [build_4igxve2xutpcfkae0ab7hnkia$_run_closure1#353dd2ed] on project ':app' of type org.gradle.api.Project.
Open File
This is my Build.gradle(project: name)
// 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.0-beta6'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:4.3.2'
// 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
}
This is my build.gradle(Module:App)
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.instagram"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
//androidTestImplementation 'com.android.support.test:runner28.0.0'
}
apply plugin: 'com.google.gms.google-services'
You appear to be missing this line from the top of your module's build.gradle file:
apply plugin: 'com.android.application'
i try to use a new placesApi, i follow this documentation https://developers.google.com/places/android-sdk/client-migration#place-picker-deprecation, when i run my app, android studio return this
"Error: Type com.google.android.libraries.places.internal.lm is referenced as an interface from com.google.android.libraries.places.internal.fm"
and this:
"Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\14155709.gradle\caches\transforms-1\files-1.1\places-1.0.0.aar\2f69114c5b5de9392ef400dc02f6f031\jars\classes.jar"
this problem starts when i put this: implementation 'com.google.android.libraries.places:places-compat:1.0.0'
and this:implementation 'com.google.android.libraries.places:places:1.0.0'
i need bout implements, i try to search on google but i didn't found noting, pls help me.
this is my gradle project:
// 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.3.2'
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
this is my gradle app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.motoja.motojapassageiro"
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.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
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'
//firebase
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
//maps places
implementation 'com.google.android.libraries.places:places-compat:1.0.0'
//implementation 'com.android.support:cardview-v7:28.0.0'
//implementation 'com.google.android.gms:play-services-places:16.0.+'
implementation 'com.google.android.libraries.places:places:1.0.0'
//google-play
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
// Required only if Facebook login support is required
implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
}
apply plugin: 'com.google.gms.google-services'
These two dependencies might be conflicting each other:
// implementation "com.google.android.libraries.places:places-compat:1.1.0"
implementation "com.google.android.libraries.places:places:1.1.0"
The places-compat wrapper is ordinary not required - better refactor your code to the new library.
I was modifying and adding some dependencies in my project and then i got this error:
Metadata of https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom 90ms
and some more errors similar to this one
And for the Event Log:
org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'.
My gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.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://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And Module Dependencies:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.hasee.seetravel"
multiDexEnabled true
minSdkVersion 24
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'
}
}
sourceSets {
main {
// jniLibs.srcDirs = ['libs']
res.srcDirs = [
'src/main/res/layout/home',
'src/main/res/layout/explore',
'src/main/res/layout/camera',
'src/main/res/layout/schedule',
'src/main/res/layout/me',
'src/main/res/layout/video',
'src/main/res/layout/drop_menu',
'src/main/res/layout',
'src/main/res'
]
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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.github.bumptech.glide:glide:4.5.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.github.danylovolokh:video-player-manager:0.2.0'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.shuyu:GSYVideoPlayer:4.0.0-beat1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'cn.jzvd:jiaozivideoplayer:6.2.7'
implementation 'com.white.countdownbutton:countdownbtn:1.0.4'
implementation 'com.github.dongjunkun:DropDownMenu:1.0.4'
implementation 'cn.yipianfengye.android:ad-library:1.0'
implementation 'cn.yc:YCDialogLib:3.5'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.sackcentury:shinebutton:0.2.0'
implementation 'me.shaohui:bottomdialog:1.1.9'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation files('libs/Android_Map3D_SDK_V6.0.0_20180211.jar')
}
Besides I am a Chinese user but failures also occurred when i turned on my VPN.
Other Settings:
HTTP Proxy:
enter image description here
Installed SDK Platform: Android API 28 & Android 8.1(Oreo)
Gradle Settings:
enter image description here
Please Help
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.