Error while implementing material.io - why so? - android

Whenever I add implementation 'com.google.android.material:material:1.0.0' and try to build my project, it fails with:
AGPBI: {"kind":"error","text":"error: resource android:attr/ttcIndex not
found.","sources":[{"file":".gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/d7c317b06402f0d32ee3cf13363bbddb/res/values/values.xml","position":{"startLine":250,"startColumn":4,"startOffset":27058,"endColumn":68,"endOffset":27122}}],"original":"","tool":"AAPT"}
:app:processLocal1DebugResources :app:processLocal1DebugResources
FAILED FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:processLocal1DebugResources'.
Failed to process resources, see aapt output above for details.
This is my gradle script:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
def keystorePropertiesFile = rootProject.file("keystore.properties")
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
compileSdkVersion 27
defaultConfig {
applicationId "***********"
minSdkVersion 19
targetSdkVersion 27
versionCode 26
versionName "3.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation":"$projectDir/schemas".toString()]
includeCompileClasspath false
}
}
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
signingConfigs {
config {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
dataBinding {
enabled = true
}
dexOptions {
jumboMode = true
}
flavorDimensions "version"
productFlavors {
prod {
dimension "version"
signingConfig signingConfigs.config
applicationId '*******'
}
preprod {
dimension "version"
signingConfig signingConfigs.config
applicationId '*******'
}
}
}
dependencies {
def room_version = "1.1.1"
def version = "2.0.0"
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.google.android.material:material:1.0.0'
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.3'
implementation 'com.google.code.gson:gson:2.4'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.android.gms:play-services-vision:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.github.pchmn:MaterialChipsInput:1.0.1'
implementation project(':MPChartLib')
implementation project(':volley')
implementation files('libs/org.apache.http.legacy.jar')
implementation 'devs.mulham.horizontalcalendar:horizontalcalendar:1.2.2'
implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.libaml.android.view.chip:AndroidChipLayout:1.0.6'
implementation 'com.github.ganfra:material-spinner:2.0.0'
implementation 'com.google.android:flexbox:0.3.0-alpha3'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation project(':monthyearpicker')
implementation 'me.drakeet.support:toastcompat:1.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-perf:15.2.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-iid:17.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.android.support:multidex:1.0.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.2#aar') {
transitive = true;
}
implementation project(':chipCloud')
implementation 'com.squareup.picasso:picasso:2.5.0'
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation "com.github.prolificinteractive:material-calendarview:$version"
}
apply plugin: 'com.google.gms.google-services'

Related

Could not get unknown property 'keystoreProperties' for SigningConfig

ERROR
Could not get unknown property 'keystoreProperties' for
SigningConfig$AgpDecorated_Decorated{name=release, storeFile=null,
storePassword=null, keyAlias=null, keyPassword=null, storeType=pkcs12,
v1SigningEnabled=true, v2SigningEnabled=true, enableV1Signing=null,
enableV2Signing=null, enableV3Signing=null, enableV4Signing=null} of
type com.android.build.gradle.internal.dsl.SigningConfig$AgpDecorated.
build.gradle (:app)
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.sonkhiasinghansh.groceryapp"
minSdk 19
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles(
getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
)
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOption {
exclude 'META-INF/atonicfu.kotlin_module'
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10"
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
def room_version = "2.2.1"
def lifecycle_version = "2.0.0"
// Room and Architectural Components
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation "androidx.room:room-ktx:2.4.3"
kapt "androidx.room:room-compiler:$room_version"
// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"
// New Material Design
implementation "com.google.android.material:material:1.6.1"
// ViewModel
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
//noinspection LifecycleAnnotationProcessorWithJava8
kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
}

Error inflating class mapbox MapView - with minifyEnabled

I've implemented mapbox correctly before using android sdk 28 to compile, now mapbox crash only in release mode because I've minifyEnabled true. If I set it to false, doesn't crash.
The Exception is
Binary XML Error inflating com.mapbox.mapboxsdk.maps.MapView.
I use mapbox on fragment, and call
Mapbox.getInstance(getContext(), "TOKEN")
before inflating view in onCreateView method. Even after, same problem.
I think is a gradle problem, that is
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.31.0'
}
}
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'io.fabric'
android {
signingConfigs {
debug {
keyAlias 'ewhfpiqwufgqeifbqeifb'
keyPassword 'dbhedeiqlgdqoiefqwouf'
}
release {
}
}
compileSdkVersion 28
defaultConfig {
applicationId "widjpewoqhfqiwfhuw"
minSdkVersion 19
targetSdkVersion 27
versionCode 65
versionName "1.1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
debuggable false
minifyEnabled true
ext.enableCrashlytics = true
useProguard false
}
debug {
debuggable true
applicationIdSuffix ".debug"
minifyEnabled false
useProguard false
ext.enableCrashlytics = true
}
}
flavorDimensions "release", "debug"
productFlavors {
debugFlavor {
dimension "debug"
}
releaseFlavor {
dimension "release"
applicationIdSuffix ""
versionNameSuffix ""
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation ('androidx.test.espresso:espresso-core:3.1.0') {
exclude group: 'com.android.support', module: 'support-annotations'
}
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.zxing:core:3.3.0'
implementation 'com.google.android.gms:play-services-vision:18.0.0'
implementation 'com.baoyz.swipemenulistview:library:1.3.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.5.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:7.3.0'){
transitive=true
}
implementation 'com.hbb20:ccp:2.2.2'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.volley:volley:1.1.0'
implementation ('com.crashlytics.sdk.android:crashlytics:2.10.1#aar') {
transitive = true
}
}
apply plugin: 'com.google.gms.google-services'
Other info on crash:
Exception in onDidFinishLoadingStyle
java.lang.NullPointerException: throw with null exception
Abort message: 'terminating with uncaught exception of type
jni::PendingJavaException'
/data/app/mypkg-
qtZprFdEiYN4aOjj_lCtiA==/lib/arm64/libmapbox-gl.so
When you set minifyEnabled true, it will Enables code shrinking, obfuscation, and optimization which remove unused classes.
Use proguard to solve this:
https://github.com/mapbox/mapbox-android-demo/blob/master/MapboxAndroidDemo/proguard-rules.pro

Failed to resolve: play-services-base - Android studio

My android studio get me bellow error, what can I do?
Failed to resolve: play-services-base
Here is my gradle:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
//apply plugin: 'com.jakewharton.butterknife'
repositories {
maven { url 'https://maven.google.com' }
}
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString()
def isPlay = !(taskRequests.contains("Foss") || taskRequests.contains("foss"))
apply plugin: 'com.android.application'
if (isPlay) {
apply plugin: 'io.fabric'
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: "com.github.ben-manes.versions"
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
manifestPlaceholders = [onesignal_app_id : "xxxxx",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "111"]
applicationId "chat.almostafa.android"
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 10
versionName "1.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def buildTime = new GregorianCalendar().format("MM-dd-yyyy' 'h:mm:ss a z")
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
signingConfigs {
release {
storeFile project.rootProject.file('PortalAlmostafaChat.jks').getCanonicalFile()
storePassword System.getenv("KEYSTORE_PASSWORD")
keyAlias System.getenv("KEY_ALIAS")
keyPassword System.getenv("KEY_PASSWORD")
}
debug {
storeFile project.rootProject.file('debug.keystore').getCanonicalFile()
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
buildConfigField "String", "REQUIRED_SERVER_VERSION", '"0.62.0"'
buildConfigField "String", "RECOMMENDED_SERVER_VERSION", '"0.64.2"'
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
buildConfigField "String", "REQUIRED_SERVER_VERSION", '"0.62.0"'
buildConfigField "String", "RECOMMENDED_SERVER_VERSION", '"0.64.2"'
signingConfig signingConfigs.debug
applicationIdSuffix ".dev"
}
}
flavorDimensions "type"
productFlavors {
// includes proprietary libs
play {
dimension "type"
}
// only foss
foss {
dimension "type"
}
}
packagingOptions {
exclude 'META-INF/core.kotlin_module'
exclude 'META-INF/main.kotlin_module'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//region MOU
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.netflix.rxjava:rxjava-android:0.20.3'
implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-material:2.2.2'
implementation 'com.joanzapata.iconify:android-iconify-material-community:2.2.2'
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation 'com.onesignal:OneSignal:3.+#aar'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
implementation 'org.jsoup:jsoup:1.10.1'
implementation 'com.mindorks.android:prdownloader:0.4.0'
// //Android-FileBrowser-FilePicker
// implementation 'com.adityak:browsemyfiles:1.7'
//Android-FileBrowser-FilePicker
implementation 'com.github.jaiselrahman:FilePicker:1.1.1'
implementation 'com.jakewharton:butterknife:9.0.0-rc3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'
kapt 'com.jakewharton:butterknife-compiler:9.0.0-rc3'
//Architect Component
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:1.1.1"
// alternatively, just ViewModel
implementation "android.arch.lifecycle:viewmodel:1.1.1"
// alternatively, just LiveData
implementation "android.arch.lifecycle:livedata:1.1.1"
kapt "android.arch.lifecycle:compiler:1.1.1"
// Room (use 1.1.0-alpha2 for latest alpha)
implementation "android.arch.persistence.room:runtime:1.1.1"
kapt "android.arch.persistence.room:compiler:1.1.1"
//DNS
implementation 'org.pcap4j:pcap4j-core:1.7.3'
implementation 'org.pcap4j:pcap4j-packetfactory-static:1.7.3'
implementation 'org.minidns:minidns-client:0.3.0'
//endregion
implementation project(':player')
implementation project(':emoji')
implementation project(':draw')
implementation project(':util')
implementation project(':core')
implementation project(':suggestions')
implementation libraries.kotlin
implementation libraries.coroutines
implementation libraries.coroutinesAndroid
implementation libraries.appCompat
implementation libraries.recyclerview
implementation libraries.constraintlayout
implementation libraries.cardview
implementation libraries.browser
implementation libraries.androidKtx
implementation libraries.fragmentsKtx
implementation libraries.dagger
implementation libraries.daggerSupport
kapt libraries.daggerProcessor
kapt libraries.daggerAndroidApt
implementation libraries.flexbox
implementation libraries.material
implementation libraries.room
kapt libraries.roomProcessor
implementation libraries.lifecycleExtensions
kapt libraries.lifecycleCompiler
implementation libraries.viewmodelKtx
implementation libraries.workmanager
implementation libraries.rxKotlin
implementation libraries.rxAndroid
implementation libraries.moshi
implementation libraries.okhttp
implementation libraries.okhttpLogger
implementation libraries.timber
implementation libraries.threeTenABP
implementation libraries.fresco
api libraries.frescoOkHttp
implementation libraries.frescoAnimatedGif
implementation libraries.frescoWebP
implementation libraries.frescoAnimatedWebP
implementation libraries.glide
kapt libraries.kotshiCompiler
implementation libraries.kotshiApi
implementation libraries.frescoImageViewer
implementation libraries.markwon
implementation libraries.aVLoadingIndicatorView
implementation libraries.livedataKtx
implementation 'com.google.code.findbugs:jsr305:3.0.2'
// Proprietary libraries
playImplementation libraries.fcm
playImplementation libraries.firebaseAnalytics
playImplementation libraries.playServicesAuth
playImplementation('com.crashlytics.sdk.android:crashlytics:2.9.5#aar') { transitive = true }
playImplementation('com.crashlytics.sdk.android:answers:1.4.3#aar') { transitive = true }
testImplementation libraries.junit
testImplementation libraries.truth
androidTestImplementation libraries.espressoCore
androidTestImplementation libraries.espressoIntents
}
kotlin {
experimental {
coroutines "enable"
}
}
androidExtensions {
experimental = true
}
// FIXME - build and install the sdk into the app/libs directory
// We were having some issues with the kapt generated files from the sdk when importing as a module
def sdk_location = project.properties['sdk_location'] ?: ""
task compileSdk(type: Exec) {
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'build-sdk.sh', sdk_location
} else {
commandLine './build-sdk.sh', sdk_location
}
}
preBuild.dependsOn compileSdk
if (isPlay) {
apply plugin: 'com.google.gms.google-services'
}
This the updated gradle libraries for today (09/JAN/19), use them (only libraries you need):
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-firestore:17.1.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-config:16.1.2'
implementation 'com.google.firebase:firebase-invites:16.0.6'
implementation 'com.google.firebase:firebase-ads:17.1.2'
implementation 'com.google.firebase:firebase-appindexing:17.1.0'
implementation 'com.google.firebase:firebase-perf:16.2.3'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.google.firebase:firebase-ml-vision:18.0.2'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.4'
Resolved my problem. I updated to:
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'

Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:

I am not able to build release APK. Every time I get DexMergerException.
Here are my build.gradles:
I am using MVVM structure. I have core(package name for core is same as my app package) has my lib where I only write view models, models and network layers.
Errors I am getting:
Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
Caused by: com.android.tools.r8.utils.AbortException
Program type already present:
app build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
signingConfigs {
debug {
storeFile file(DEBUG_STORE_FILE)
}
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
v2SigningEnabled false
}
}
compileSdkVersion 27
flavorDimensions "default"
defaultConfig {
applicationId "com.puma.one8crew"
minSdkVersion 21
targetSdkVersion 27
vectorDrawables.useSupportLibrary = true
versionCode 1
multiDexEnabled true
versionName "1.0"
resValue 'string', 'facebook_app_id', FACEBOOK_APP_ID_DEV
resValue 'string', 'fb_login_protocol_scheme', FACEBOOK_LOGIN_PROTOCOL_SCHEME
manifestPlaceholders += [
FACEBOOK_APP_ID_BGY: FACEBOOK_APP_ID_DEV,
FB_LOGIN_SCHEME : FACEBOOK_LOGIN_PROTOCOL_SCHEME
]
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dataBinding {
enabled = true
}
buildTypes {
debug {
minifyEnabled false
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
/* productFlavors {
prod {
resValue 'string', 'facebook_app_id', FACEBOOK_APP_ID_DEV
resValue 'string', 'fb_login_protocol_scheme', FACEBOOK_LOGIN_PROTOCOL_SCHEME
}
stage {
resValue 'string', 'facebook_app_id', FACEBOOK_APP_ID_DEV
resValue 'string', 'fb_login_protocol_scheme', FACEBOOK_LOGIN_PROTOCOL_SCHEME
}
}*/
applicationVariants.all { variant ->
variant.outputs.all { output ->
def project = "one8crew"
outputFileName = "${project}_${variant.buildType.name}_${variant.versionName}.apk"
}
}
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
preDexLibraries = true //delete the already predexed libraries
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':core')
implementation 'com.android.support:animated-vector-drawable:27.0.1'
implementation 'com.android.support:customtabs:27.0.1'
implementation 'com.android.support:cardview-v7:27.0.1'
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
implementation 'com.android.support:recyclerview-v7:27.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:design:27.0.1'
implementation 'com.android.support:support-v13:27.0.1'
implementation 'com.alimuzaffar.lib:pinentryedittext:1.3.1'
implementation 'de.hdodenhof:circleimageview:2.2.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'
//Dependencies for LifeCycle Android ViewModel
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation project(':com.wowza.gocoder.sdk')
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
//support design lib dependency fot tab
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true;
}
}
Below is my core build.gradle and I have also updated the same version for all lib.
core build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
repositories {
flatDir {
dirs 'libs'
}
jcenter()
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
compileOnly 'com.wowza.gocoder.sdk.android:com.wowza.gocoder.sdk:1.0b7#aar'
// compile 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.google.dagger:dagger:2.11'
api('com.squareup.retrofit2:retrofit:2.1.0') {
exclude module: 'okhttp'
}
api 'com.google.code.gson:gson:2.8.1'
api 'com.squareup.retrofit2:converter-gson:2.3.0'
api 'swarajsaaj:otpreader:1.1'
api 'com.github.bumptech.glide:glide:4.3.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
//Dependencies for LifeCycle Android ViewModel
implementation 'android.arch.lifecycle:extensions:1.1.1'
// annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
compileOnly project(':com.wowza.gocoder.sdk')
compile project(':libraries:horizontalcalendar')
compile project(':libraries:calendarview')
//Library for setting fonts
api 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.android.support:multidex:1.0.3'
}
I tried so many time and I am not able to understand the reason behind this issue.
Same happened today to me and this is what solved the issue:
Find all the dependencies of com.google.android.gms:play-services.
They all have now different versions. Just place the mouse over them and correct the version numbers (i.e. for me was upgrading maps from 15.0.0 to 15.0.2 and tag-manager to 15.0.1)

Duplicate entry: android/support/design/widget/CoordinatorLayout

I'm trying to create a signed APK, but an error will appear at the end:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/design/widget/CoordinatorLayout$1.class
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
buildscript {
repositories {
maven { url "https://github.com/omadahealth/omada-nexus/raw/master/release" }
maven { url "https://jitpack.io" }
}
dependencies {
}
}
android {
signingConfigs {
config {
}
}
lintOptions {
abortOnError false
}
dataBinding {
enabled = true
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.myandroidapp.android"
minSdkVersion 17
targetSdkVersion 27
versionCode 5
versionName "1.3"
multiDexEnabled true
}
buildTypes {
release {
ext.enableCrashlytics = true
//shrinkResources false
//minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//debuggable false
//jniDebuggable false
signingConfig signingConfigs.config
//zipAlignEnabled true
}
debug {
//debuggable true
ext.enableCrashlytics = true
//minifyEnabled false
//shrinkResources false
//renderscriptDebuggable false
//jniDebuggable false
proguardFiles 'proguard-rules.txt'
//signingConfig signingConfigs.debug
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/**'
exclude 'META-INF/**'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral()
jcenter()
}
android {
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// Navigation Drawer Library
compile('com.mikepenz:materialdrawer:5.3.0#aar') {
transitive = true
}
//Google, Inc (Play services) Libraries
implementation 'com.google.android.gms:play-services-places:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-config:11.8.0'
implementation 'com.google.firebase:firebase-appindexing:11.8.0'
implementation 'com.google.android.gms:play-services-appinvite:11.8.0'
//Google, Inc (Firebase) Libraries
implementation 'com.firebase:firebase-jobdispatcher:0.6.0'
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
implementation 'com.firebase:geofire-android:2.1.2'
// Google, Inc (Support) Libraries
implementation 'com.android.support:support-v13:27.0.2'
//implementation 'com.android.support:customtabs:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.android.support:palette-v7:27.0.2'
implementation 'com.android.support:support-vector-drawable:27.0.2'
//implementation 'com.android.support.constraint:constraint-layout:1.0.2'
// Facebook, Inc SDKs
implementation 'com.facebook.android:facebook-android-sdk:4.29.0'
// Libraries for images
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.lorentzos.swipecards:library:1.0.9'
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
implementation 'com.vanniktech:emoji-twitter:0.5.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
implementation 'com.github.yalantis:ucrop:2.2.1'
implementation 'com.github.jkwiecien:EasyImage:1.3.1'
implementation 'jp.wasabeef:picasso-transformations:2.1.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
// Location Helper Library
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
// Time library
implementation 'joda-time:joda-time:2.9.9'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
// Others
// event bus
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.flipboard:bottomsheet-core:1.5.3'
implementation 'com.flipboard:bottomsheet-commons:1.5.3'
implementation 'com.greysonparrelli.permiso:permiso:0.3.0'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.5.2'
implementation 'com.airbnb.android:lottie:2.2.5'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'
This may be due to different versions of the support library being used.
Add the following in your build.gradle
configurations.all {
resolutionStrategy {
force 'com.android.support:design:27.0.2'
force 'com.android.support:support-v4:27.0.2'
force 'com.android.support:appcompat-v7:27.0.2'
}
}

Categories

Resources