Today I updated to the latest version of crashlytics which was not updated from a very long time.
I am getting the below error while building the file.
Error:No such property: betaDistributionApkFilePath for class:
java.lang.String
I am not setting any betaDistributionApkFilePath property in my gradle file.
This happened after I updated it to the latest version by following the instructions given on the fabric's website. I tried down grading it to a bit older version, but no help. I also, tried to found out more about the error, but it seems that I am the first to face this.
my project level build.gradle
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.google.android.gms', module: 'play-services'
}
buildscript {
ext {
// root project
androidGradleVersion = "3.0.1"
googleServices = "3.2.0"
crashlytics = "1.25.1"
}
repositories {
jcenter()
mavenCentral()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "com.android.tools.build:gradle:$androidGradleVersion"
classpath "com.google.gms:google-services:$googleServices"
classpath "io.fabric.tools:gradle:$crashlytics"
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And this is my App level build.gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
ext {
// android
playService = "11.4.2"
supportLibrary = "27.0.2"
constrainLayout = "1.0.2"
// libraries
retofit = "1.9.0"
okHttp = "2.0.0"
eventBus = "1.3.8"
picasso = "2.5.2"
calligraphy = "2.3.0"
socketIo = "0.3.0"
facebook = "4.30.0"
circularReveal = "1.3.1"
imageCropper = "1.2.2"
expandableRecyclerView = "2.1.1"
crashlytics = "2.9.0"
selectableBackgroudImageView = "1.0.1"
multidex = "1.0.1"
}
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "myappid"
minSdkVersion 16
targetSdkVersion 21
versionCode 01
versionName "01"
multiDexEnabled true
}
buildTypes {
debug {
resValue "string", "app_name", "MyApp Dev"
applicationIdSuffix ".debug"
}
release {
resValue "string", "app_name", "MyApp"
zipAlignEnabled true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "6g"
}
sourceSets {
main {
res.srcDirs = ['src/main/res', 'src/main/res/anim-v21']
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
lintOptions {
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
}
}
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation "com.google.firebase:firebase-database:$playService"
implementation "com.google.firebase:firebase-auth:$playService"
implementation "com.google.firebase:firebase-core:$playService"
implementation "com.google.firebase:firebase-messaging:$playService"
implementation "com.google.android.gms:play-services-cast:$playService"
implementation "com.google.android.gms:play-services-gcm:$playService"
implementation "com.google.android.gms:play-services-analytics:$playService"
implementation "com.google.android.gms:play-services-maps:$playService"
implementation "com.google.android.gms:play-services-location:$playService"
implementation "com.google.android.gms:play-services-auth:$playService"
implementation "com.squareup.retrofit:retrofit:$retofit"
implementation "com.squareup.okhttp:okhttp-urlconnection:$okHttp"
implementation "com.squareup.okhttp:okhttp:$okHttp"
implementation "com.squareup:otto:$eventBus"
implementation "com.squareup.picasso:picasso:$picasso"
implementation "com.android.support:support-v4:$supportLibrary"
implementation "com.android.support:recyclerview-v7:$supportLibrary"
implementation "com.android.support:design:$supportLibrary"
implementation "com.android.support:appcompat-v7:$supportLibrary"
implementation "com.android.support:cardview-v7:$supportLibrary"
implementation "com.android.support:mediarouter-v7:$supportLibrary"
implementation "com.android.support.constraint:constraint-layout:$constrainLayout"
implementation "uk.co.chrisjenx:calligraphy:$calligraphy"
implementation "com.github.nkzawa:socket.io-client:$socketIo"
implementation "com.facebook.android:facebook-android-sdk:$facebook"
implementation "com.facebook.android:facebook-login:$facebook"
implementation "com.github.ozodrukh:CircularReveal:$circularReveal"
implementation "com.theartofdev.edmodo:android-image-cropper:$imageCropper"
implementation "com.bignerdranch.android:expandablerecyclerview:$expandableRecyclerView"
implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics#aar") {
transitive = true
}
implementation "com.joooonho:selectableroundedimageview:$selectableBackgroudImageView"
implementation "com.android.support:multidex:$multidex"
}
apply plugin: 'com.google.gms.google-services'
Below lines in your app level build.gradle is causing the issue.
ext {
// android
playService = "11.4.2"
supportLibrary = "27.0.2"
constrainLayout = "1.0.2"
// libraries
retofit = "1.9.0"
okHttp = "2.0.0"
eventBus = "1.3.8"
picasso = "2.5.2"
calligraphy = "2.3.0"
socketIo = "0.3.0"
facebook = "4.30.0"
circularReveal = "1.3.1"
imageCropper = "1.2.2"
expandableRecyclerView = "2.1.1"
crashlytics = "2.9.0"
selectableBackgroudImageView = "1.0.1"
multidex = "1.0.1"
}
Declare it inside buildScript{} in project level build.gradle
buildscript {
ext {
crashlytics = '2.9.0'
}
}
And for accessing these variables inside app level build.gradle, use like this
compile("com.crashlytics.sdk.android:crashlytics:$rootProject.ext.crashlytics#aar") {
transitive = true
}
Hope this helps...
Related
I'm trying to update my project to the last gradle, v6.2.2, but I'm facing the next error:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> Cannot query the value of this provider because it has no value available.
> KotlinJvmAndroidCompilation with name 'debug' not found.
My project build.gradle is the next:
buildscript {
ext.gradleToolsVersion = '3.6.1'
ext.kotlinVersion = "1.3.70"
ext.googleServicesVersion = "4.3.3"
ext.butterknifeGradlePluginVersion = "10.2.0"
ext.fabricToolsGradleVersion = "1.31.2"
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'https://maven.fabric.io/public'
}
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:3.6.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.google.gms:google-services:$googleServicesVersion" // Google Services plugin
classpath "com.jakewharton:butterknife-gradle-plugin:$butterknifeGradlePluginVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "io.fabric.tools:gradle:$fabricToolsGradleVersion" // Crashlytics plugin
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url 'https://jitpack.io' }
maven {
url "http://dl.bintray.com/electronicid/maven/"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And my app build is:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'io.fabric'
// Touch Library Versions Here
ext {
kotlinVersion = "1.3.70"
androidxAppcompatVersion = '1.1.0'
corektxAppcompatVersion = '1.2.0'
fragmentktxAppcompatVersion = '1.2.2'
androidxVersion = '1.1.0'
multidexVersion = '2.0.1'
preferenceVersion = '1.1.0'
constraintLayoutVersion = '1.1.3'
retrofitVersion = '2.7.1'
butterknifeVersion = '10.2.1'
okHttpVersion = '4.4.0'
gsonVersion = '2.8.6'
stethoVersion = '1.5.1'
rxJavaVersion = '2.2.15'
rxAndroidVersion = '2.1.1'
lifecycleVersion = '2.2.0'
kotlinCoroutineVersion = '1.3.2'
androidSlidingUpPanelVersion = '4.0.0'
glideVersion = '4.11.0'
stickHeaderGridVersion = '0.9.7'
shimmerLayout = '2.1.0'
videoidSdkVersion = '5.2.1'
ottoEventBusVersion = '1.3.8'
cryptoPrefsVersion = '1.3.2.5'
blurryVersion = '3.0.0'
lottieVersion = '3.3.1'
firebaseCoreVersion = '17.2.3'
firebaseAnalyticsVersion = '17.2.3'
firebaseMessagingVersion = '20.1.2'
firebaseCrashVersion = '16.2.1'
crashlyticsVersion = '2.10.1'
circleimageviewVersion = '3.1.0'
fotoapparatVersion = '2.7.0'
dexterVersion = '6.0.2'
ucropVersion = '2.2.4-native'
commonTextVersion = '1.8'
guavaVersion = '28.1-android'
timberVersion = '4.7.1'
discreteScrollViewVersion = '1.4.9'
slideUpVersion = '2.2.8'
biometricVersion = '1.0.1'
playServicesLocationVersion = '17.0.0'
}
def apikeyPropertiesFile = rootProject.file("apikey.properties")
def apikeyProperties = new Properties()
apikeyProperties.load(new FileInputStream(apikeyPropertiesFile))
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultPublishConfig 'release'
publishNonDefault true
defaultConfig {
applicationId "com.planunnum"
minSdkVersion 21
targetSdkVersion 29
versionCode 7084
versionName '7.4.0'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
// SECRET KEY TO ENCRYPT/DECRYPT SHARED PREFERENCES
buildConfigField("String", "SHA_512_SECURE_KEY", apikeyProperties['SHA_512_SECURE_KEY'])
}
signingConfigs {
release {
storeFile file(keystoreProperties['RELEASE_STORE_FILE'])
keyAlias = keystoreProperties['RELEASE_KEY_ALIAS']
storePassword keystoreProperties['RELEASE_STORE_PASSWORD']
keyPassword keystoreProperties['RELEASE_KEY_PASSWORD']
}
}
buildTypes {
debug {
debuggable true
minifyEnabled false
buildConfigField "boolean", "USE_CRASHLYTICS", "true"
ext.enableCrashlytics = true
buildConfigField "boolean", "USE_MOCKS", "false"
}
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile(
'proguard-android.txt'),
// List additional ProGuard rules for the given build type here. By default,
// Android Studio creates and includes an empty rules file for you (located
// at the root directory of each module).
'proguard-rules.pro'
signingConfig signingConfigs.release
// enable crashlytics
buildConfigField "boolean", "USE_CRASHLYTICS", "true"
ext.enableCrashlytics = true
// Disable mocks
buildConfigField "boolean", "USE_MOCKS", "false"
}
mocks {
debuggable true
minifyEnabled false
buildConfigField "boolean", "USE_CRASHLYTICS", "true"
ext.enableCrashlytics = true // Must be false, but testers are human too :(
buildConfigField "boolean", "USE_MOCKS", "true"
}
}
// Configure only for each module that uses Java 8
// language features (either in its source code or
// through dependencies).
// Butterknife requires Java 8.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// For Kotlin projects
kotlinOptions {
jvmTarget = "1.8"
}
packagingOptions {
// exclude ARMEABI native so file, ARMEABI has been removed in NDK r17.
exclude "lib/armeabi/**"
}
// Change behaivour to rename apk deployed
applicationVariants.all { variant ->
variant.outputs.all { output ->
def project = "plannum"
def SEP = "_"
def buildType = variant.variantData.variantConfiguration.buildType.name
def versionCode = variant.versionName
def buildCode = variant.versionCode
def date = new Date()
def formattedDate = date.format('ddMMyy_HHmm')
def newApkName = project + SEP + buildType + SEP + versionCode + SEP + buildCode + SEP + formattedDate + ".apk"
outputFileName = new File(newApkName)
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}"
implementation "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}"
// BASE
implementation "androidx.appcompat:appcompat:${androidxAppcompatVersion}"
implementation "androidx.core:core:${corektxAppcompatVersion}"
implementation "androidx.core:core-ktx:${corektxAppcompatVersion}"
implementation "androidx.fragment:fragment-ktx:${fragmentktxAppcompatVersion}"
implementation "androidx.constraintlayout:constraintlayout:${constraintLayoutVersion}"
implementation "androidx.preference:preference-ktx:${preferenceVersion}"
implementation "androidx.biometric:biometric:${biometricVersion}"
implementation "androidx.multidex:multidex:${multidexVersion}"
// TEST
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// BUTTERKNIFE
implementation "com.jakewharton:butterknife:${butterknifeVersion}"
kapt "com.jakewharton:butterknife-compiler:${butterknifeVersion}"
// NETWORK
implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
implementation "com.squareup.retrofit2:converter-scalars:${retrofitVersion}"
implementation "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
implementation "com.squareup.okhttp3:okhttp:${okHttpVersion}"
implementation "com.squareup.okhttp3:logging-interceptor:${okHttpVersion}"
implementation "com.google.code.gson:gson:${gsonVersion}"
implementation "com.facebook.stetho:stetho:${stethoVersion}"
implementation "com.facebook.stetho:stetho-okhttp3:${stethoVersion}"
// KOTLIN COROUTINES
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutineVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutineVersion"
// LIFECYCLE VIEWMODEL AND LIVEDATA
implementation "androidx.lifecycle:lifecycle-extensions:${lifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-common-java8:${lifecycleVersion}"
// SLIDING PANELS
implementation "com.github.mancj:SlideUp-Android:${slideUpVersion}"
implementation "com.yarolegovich:discrete-scrollview:${discreteScrollViewVersion}"
implementation "com.github.hannesa2:AndroidSlidingUpPanel:${androidSlidingUpPanelVersion}"
implementation "com.daimajia.swipelayout:library:1.2.0#aar"
// IMAGE LOADER
implementation "com.github.bumptech.glide:glide:${glideVersion}"
kapt "com.github.bumptech.glide:compiler:${glideVersion}"
// STICY HEADERS
implementation "com.codewaves.stickyheadergrid:stickyheadergrid:${stickHeaderGridVersion}"
// SHIMMER LAYOUTS
implementation "io.supercharge:shimmerlayout:${shimmerLayout}"
// VIDEOID
implementation "eu.electronicid.android:video-sdk:${videoidSdkVersion}"
implementation "eu.electronicid.android:videoid-sdk:${videoidSdkVersion}"
// OTTO EVENT BUS
implementation "com.squareup:otto:${ottoEventBusVersion}"
// CRYPTOPREFS TO SAVE/LOAD DATA ON SHAREDPREFERENCES
implementation "com.github.AndreaCioccarelli:CryptoPrefs:${cryptoPrefsVersion}"
// BLURRY LAYOUTS
implementation "jp.wasabeef:blurry:${blurryVersion}"
// LOTTIE FOR LOGO SPLASHSCREEN
implementation "com.airbnb.android:lottie:${lottieVersion}"
// FCM
implementation "com.google.firebase:firebase-core:${firebaseCoreVersion}"
implementation "com.google.firebase:firebase-analytics:${firebaseAnalyticsVersion}"
implementation "com.google.firebase:firebase-messaging:${firebaseMessagingVersion}"
implementation "com.google.firebase:firebase-crash:${firebaseCrashVersion}"
implementation "com.crashlytics.sdk.android:crashlytics:${crashlyticsVersion}"
// CIRCLE IMAGE VIEWS
implementation "de.hdodenhof:circleimageview:${circleimageviewVersion}"
// CAPTURE PHOTOS
implementation "io.fotoapparat:fotoapparat:${fotoapparatVersion}"
// REACTIVE PROGRAMMING RXJAVA & RXANDROID
implementation "io.reactivex.rxjava2:rxjava:${rxJavaVersion}"
implementation "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}"
// REQUEST PERMISSIONS
implementation "com.karumi:dexter:${dexterVersion}"
// CROPPING IMAGES
implementation "com.github.yalantis:ucrop:${ucropVersion}"
// COMMONS TEXT UTILS
implementation "org.apache.commons:commons-text:${commonTextVersion}"
// GUAVA
implementation "com.google.guava:guava:${guavaVersion}"
// BETTER LOG MESSAGES
implementation "com.jakewharton.timber:timber:${timberVersion}"
// LOCATION
implementation "com.google.android.gms:play-services-location:${playServicesLocationVersion}"
implementation project(path: ':everid-release_2.0')
}
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
Any advice please? Thank you
Remove apply plugin: 'io.fabric' help me, but how return crashlytics...
I've faced the same issue and it turned out that the cause of the issue is the fabric gradle plugin (crashlytics) rather than gradle itself.
Basically, the issue occurs when setting ext.enableCrashlytics = true in your build.gradle file using io.fabric.tools:gradle:1.31.2 fabric plugin.
Workaround
You have to avoid explicitly setting ext.enableCrashlytics to true (false is okay).
For example, you can replace the following code
def enableCrashlytics = // comes from somewhere
ext.enableCrashlytics = enableCrashlytics
by
def enableCrashlytics = // comes from somewhere
if (!enableCrashlytics) {
ext.enableCrashlytics = false
}
The behavior remains the same since crashlytics is enabled by default.
As an alternative, you can revert to using 1.31.0 which works fine, but I'd not recommend doing it since the latest version contains a couple of critical bug fixes.
Also, you can consider migrating to Firebase Crashlytics (currently in beta) since Google is dropping support for Fabric soon and this issue might not get fixed.
Fabric is deprecated use Firebase instead. Refer to this page on how to migrate
https://firebase.google.com/docs/crashlytics/get-started?platform=android
When I am try to compile my application ,the error shows
Program type already present: com.google.thirdparty.publicsuffix.TrieParser
Message{kind=ERROR, text=Program type already present: com.google.thirdparty.publicsuffix.TrieParser, sources=[Unknown source file], tool name=Optional.of(D8)}
Is there any issue in my gradle files?
My project level bulid.gradle is
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
/* classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'*/
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
ext.googlePlayServicesVersion = '11.4.0'
ext.supportLibraryVersion = '27.0.1'
allprojects {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
subprojects {
tasks.withType(Javadoc).all { enabled = false }
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app level build.gradle is
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven {
url 'https://maven.fabric.io/public'
}
/*maven {
url 'http://sdk.uxcam.com/android/' //commented can be used later
}*/
}
/*
apply plugin: 'com.neenbedankt.android-apt'
*/
android {
lintOptions {
disable "ResourceType"
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
applicationId 'com.wedviser.matrimony'
minSdkVersion 19
targetSdkVersion 27
versionCode 31
versionName "2.0.1"
vectorDrawables.useSupportLibrary = true
//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
manifestPlaceholders = [HOCKEYAPP_APP_ID: "cbb545807562491aaafac6118c9116a6"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ECLIPSE_.SF'
exclude 'META-INF/ECLIPSE_.RSA'
}
flavorDimensions 'default'
productFlavors {
development {
dimension 'default'
minSdkVersion 19
applicationId 'com.wedviser.matrimony.dev'
targetSdkVersion 27
versionCode 56
versionName '1'
}
production {
dimension 'default'
minSdkVersion 19
applicationId 'com.wedviser.matrimony'
targetSdkVersion 27
versionCode 57
versionName '2.1.8'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':mobicomkitui')
implementation('com.crashlytics.sdk.android:crashlytics:2.6.7#aar') {
transitive = true;
}
// for development only .need to remove for releasing //
// implementation 'net.hockeyapp.android:HockeySDK:4.1.4'
implementation files('libs/GoogleConversionTrackingSdk-2.2.4.jar')
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
// Account Kit
//implementation 'com.uxcam:uxcam:2.5.9#aar' // commented can be used later
implementation 'com.google.android.gms:play-services-analytics:15.0.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4'
implementation 'com.github.bumptech.glide:glide:4.5.0'
implementation 'com.opalox.rangebarvertical:rangebarvertical:1.1'
implementation 'me.itangqi.waveloadingview:library:0.3.2'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.jakewharton:butterknife:8.6.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.facebook.android:facebook-android-sdk:4.27.0'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.github.Raizlabs.DBFlow:dbflow-core:4.0.0-beta5'
implementation 'com.github.Raizlabs.DBFlow:dbflow:4.0.0-beta5'
implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
implementation 'com.mcxiaoke.viewpagerindicator:library:2.4.1#aar'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.google.android.gms:play-services-vision:15.0.2'
implementation 'com.crystal:crystalrangeseekbar:1.1.3'
implementation 'net.danlew:android.joda:2.9.9'
implementation 'com.github.aryarohit07:picasso-facedetection-transformation:0.3.0'
implementation 'com.tuyenmonkey:mkloader:1.2.0'
implementation 'org.parceler:parceler-api:1.1.9'
/* implementation 'com.google.android.gms:play-services-gcm:15.0.1'*/
implementation 'com.github.toanvc:floatingactionmenu:0.8.9'
implementation 'com.github.drawers:SpinnerDatePicker:1.0.4'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
api 'com.github.Raizlabs.DBFlow:dbflow-processor:4.0.0-beta5'
api 'org.parceler:parceler:1.1.9'
implementation files('libs/GoogleConversionTrackingSdk-2.2.4.jar')
}
apply plugin: 'com.google.gms.google-services'
Also I have used applozic chat platform.
And the mobicomkitui build.gradle is
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "5.8.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
api 'com.google.code.gson:gson:2.8.0'
api 'com.google.firebase:firebase-messaging:15.0.2'
api 'com.google.android.gms:play-services-maps:15.0.1'
api 'com.google.android.gms:play-services-location:15.0.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
api 'com.android.support:design:27.1.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.github.bumptech.glide:glide:4.5.0'
implementation 'com.android.support:cardview-v7:27.1.1'
api project(':mobicomkit')//Note: use this for customization
implementation 'com.jakewharton:butterknife:8.6.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
//api 'com.applozic.communication.message:mobicomkit:5.8.5' //Note: use this in case customization is not required
}
/* ext {
// Where you will see your artifact in Bintray's web interface
// The "bintrayName" should match the name of the Bintray repro.
bintrayRepo = 'maven'
bintrayName = 'applozic-communication-uiwidget'
// Maven metadata
publishedGroupId = 'com.applozic.communication.uiwidget'
libraryName = 'mobicomkitui'
// Save yourself a head ache, and set this equal to the name of the Android Studio library
// module. The artifact name needs to match the name of the library.
artifact = 'mobicomkitui'
libraryDescription = 'Applozic Communication UI Widget'
libraryVersion = '5.8.5'
developerId = 'devashish'
developerName = 'Applozic'
developerEmail = 'devashish.mamgain#gmail.com'
}
apply from: 'https://raw.githubusercontent.com/attwellBrian/JCenter/master/installv1.gradle'
apply plugin: 'com.jfrog.bintray'
version = libraryVersion
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
failOnError false // add this line
source = android.sourceSets.main.java.srcDirs
//source = android.sourceSets.main.allJava
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
// Optional. The passphrase for GPG signing'
// gpg {
// sign = true //Determines whether to GPG sign the files. The default is false
// passphrase = properties.getProperty("bintray.gpg.password")
//}
}
}
}*/
Maybe late, but i found an Answer so there it is :
com.google.thirdparty.publicsuffix.TrieParser is part of Guava, and so it may be included in multiple libraries.
In this case, there is at least org.parceler which include guava.
To fix this compilation problem, you have to change the way you import org.parceler, and include it like this :
implementation "org.parceler:parceler-api:1.1.12"
compileOnly "org.parceler:parceler:1.1.12"
annotationProcessor "org.parceler:parceler:1.1.12"
Source : https://github.com/johncarl81/parceler/issues/182
After the update of supportVersion to 27.0.0 ONLY on Android 5.0.2 the app crash with this stacktrace:
W/WindowManager: Failed looking up window
java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W#f004691 does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8426)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8417)
at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2558)
at com.android.server.wm.Session.remove(Session.java:186)
at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:2920)
at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5390)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3223)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
Both on the device and on the emulator.
If I put 26.0.2 as supportVersion, the app still works normally as usual.
UPDATE
The problem persist with supportVersion 27.0.1
UPDATE 2
Project gradle
buildscript {
ext.kotlin_version = '1.1.51'
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.fabric.tools:gradle:1.24.2'
}
}
plugins {
id "com.diffplug.gradle.spotless" version "3.6.0"
}
allprojects {
repositories {
google()
jcenter()
jcenter { url = 'http://dl.bintray.com/swrve-inc/android' }
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://maven.localytics.com/public' }
maven { url 'http://dl.bintray.com/teads/TeadsSDK-android' }
maven { url 'http://maven.apptimize.com/artifactory/repo' }
maven { url 'https://comscore.bintray.com/Analytics' }
}
}
ext {
//APPLICATION
compileSdkVersion = 27
buildToolsVersion = '27.0.1'
minSdkVersion = 19
targetSdkVersion = 27
//LIBRARIES
timberVersion = '4.6.0'
guavaVersion = '20.0'
multidexVersion = '1.0.2'
supportVersion = '27.0.1'
constraintVersion = '1.0.2'
playServiceVersion = '11.4.0'
commonLangVersion = '3.5'
jacksonVersion = '2.4.2'
appsFlyerVersion = '4.7.1'
facebookAudienceVersion = '4.26.1'
facebookSkdVersion = '4.26.0'
facebookAdapterVersion = '4.26.1.0'
flurryVersion = '6.9.2'
googleTrackingVersion = '2.2.4'
crashliticsVersion = '2.6.8'
swrveVersion = '4.10.1'
swrveLocationVersion = '1.3'
pubnativeVersion = '2.0.5'
localyticsVersion = '4.3.1'
teadsVersion = '2.4.13'
oguryPresageVersion = '2.1.21'
evernoteAndroidJobVersion = '1.1.11'
apptimizeVersion = '2.13.5'
comScoreVersion = '5.5.1'
bottomBarVersion = '2.3.1'
rxJavaVersion = '2.1.6'
rxAndroidVersion = '2.0.1'
//TEST LIBRARIES
testsVersion = '1.0.1'
espressoVersion = '3.0.1'
junitVersion = '4.12'
mockitoVersion = '1.10.19'
powermockVersion = '1.6.6'
robolectricVersion = '3.5'
assertjVersion = '1.2.0'
//PUBNATIVE ADAPTERS
pnFlurryVersion = '6.9.2'
pnAdmobVersion = '9.6.1'
}
App gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
apply plugin: 'com.diffplug.gradle.spotless'
spotless {
kotlin {
target "**/*.kt"
ktlint()
}
}
def versionMajor = 8
def versionMinor = 8
def versionPatch = 8
def versionBuild = 8
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
flavorDimensions "std"
defaultConfig {
dimension "std"
applicationId "xxx.yyy.zzz"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode versionMajor * 1000 + versionMinor * 100 + versionPatch * 10 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
//APP VERSION NAME
buildConfigField "String", "VERSION_NAME_PREFIX", "\"zzzz\""
//MARKET CONFIG
buildConfigField "String", "MARKET_NAME", "\"GooglePlay\""
buildConfigField "String", "MARKET_ENDPOINT", "\"market://details?id=\""
buildConfigField "String", "MARKET_BACKOFF_ENDPOINT", "\"https://play.google.com/store/apps/details?id=\""
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
....
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
buildTypes {
debug {
// Disable fabric build ID generation for debug builds
ext.enableCrashlytics = false
}
release {
minifyEnabled true
proguardFiles 'acb.txt'
zipAlignEnabled true
}
}
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds true
// 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
fatal 'StopShip'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
//CORE LIB
implementation "com.jakewharton.timber:timber:${rootProject.ext.timberVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
implementation "com.google.guava:guava:${rootProject.ext.guavaVersion}"
implementation "com.android.support:multidex:${rootProject.ext.multidexVersion}"
implementation "com.android.support:multidex-instrumentation:${rootProject.ext.multidexVersion}"
implementation "com.android.support:design:${rootProject.ext.supportVersion}"
implementation "com.android.support:cardview-v7:${rootProject.ext.supportVersion}"
implementation "com.android.support.constraint:constraint-layout:${rootProject.ext.constraintVersion}"
implementation "com.google.android.gms:play-services-identity:${rootProject.ext.playServiceVersion}"
implementation "com.google.android.gms:play-services-base:${rootProject.ext.playServiceVersion}"
implementation "com.google.android.gms:play-services-analytics:${rootProject.ext.playServiceVersion}"
implementation "com.google.android.gms:play-services-gcm:${rootProject.ext.playServiceVersion}"
implementation "com.google.android.gms:play-services-location:${rootProject.ext.playServiceVersion}"
implementation "com.google.android.gms:play-services-maps:${rootProject.ext.playServiceVersion}"
implementation "com.google.android.gms:play-services-ads:${rootProject.ext.playServiceVersion}"
implementation "org.apache.commons:commons-lang3:${rootProject.ext.commonLangVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${rootProject.ext.jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-core:${rootProject.ext.jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${rootProject.ext.jacksonVersion}"
implementation "io.reactivex.rxjava2:rxjava:${rootProject.ext.rxJavaVersion}"
implementation "io.reactivex.rxjava2:rxandroid:${rootProject.ext.rxAndroidVersion}"
//SDK
implementation "com.appsflyer:af-android-sdk:${rootProject.ext.appsFlyerVersion}#aar"
implementation "com.facebook.android:facebook-android-sdk:${rootProject.ext.facebookSkdVersion}"
implementation "com.facebook.android:audience-network-sdk:${rootProject.ext.facebookAudienceVersion}"
implementation "com.flurry.android:analytics:${rootProject.ext.flurryVersion}"
implementation "com.flurry.android:ads:${rootProject.ext.flurryVersion}"
implementation files("libs/GoogleConversionTrackingSdk-${rootProject.ext.googleTrackingVersion}.jar")
implementation("com.crashlytics.sdk.android:crashlytics:${rootProject.ext.crashliticsVersion}#aar") {
transitive = true
}
//TEADS VIDEO
implementation("tv.teads.sdk:androidsdk:${rootProject.ext.teadsVersion}:fullRelease#aar") {
transitive = true
}
//OGURY - PRESAGE
implementation files("libs/presage-lib-${rootProject.ext.oguryPresageVersion}-obfuscated.jar")
//PUBNATIVE
implementation "net.pubnative:sdk:${rootProject.ext.pubnativeVersion}"
//PUBNATIVE - ADAPTERS
implementation "net.pubnative:sdk.adapter.admob:${rootProject.ext.pnAdmobVersion}"
implementation "net.pubnative:sdk.adapter.flurry:${rootProject.ext.pnFlurryVersion}"
//ADMOB - ADAPTERS
implementation "com.google.ads.mediation:facebook:${rootProject.ext.facebookAdapterVersion}"
//SWRVE PLOT
implementation "com.swrve.sdk.android:swrve-google:${rootProject.ext.swrveVersion}"
implementation(name: "swrve-location-${rootProject.ext.swrveLocationVersion}", ext: "aar")
//LOCALYTICS
implementation "com.localytics.android:library:${rootProject.ext.localyticsVersion}"
//JOB
implementation "com.evernote:android-job:${rootProject.ext.evernoteAndroidJobVersion}"
//APPTIMIZE
implementation "com.apptimize:apptimize-android:${rootProject.ext.apptimizeVersion}"
//COMSCORE
implementation "com.comscore:android-analytics:${rootProject.ext.comScoreVersion}"
//BOTTOM BAR
implementation "com.roughike:bottom-bar:${rootProject.ext.bottomBarVersion}"
//TEST
androidTestImplementation "com.android.support:support-annotations:${rootProject.ext.supportVersion}"
androidTestImplementation "com.android.support.test:runner:${rootProject.ext.testsVersion}"
androidTestImplementation "com.android.support.test:rules:${rootProject.ext.testsVersion}"
androidTestImplementation "com.android.support.test.espresso:espresso-core:${rootProject.ext.espressoVersion}"
androidTestImplementation "com.android.support.test.espresso:espresso-intents:${rootProject.ext.espressoVersion}"
androidTestImplementation("com.android.support.test.espresso:espresso-contrib:${rootProject.ext.espressoVersion}") {
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
exclude module: 'recyclerview-v7'
}
testImplementation "junit:junit:${rootProject.ext.junitVersion}"
testImplementation "org.mockito:mockito-core:${rootProject.ext.mockitoVersion}"
testImplementation "org.powermock:powermock-api-mockito:${rootProject.ext.powermockVersion}"
testImplementation "org.powermock:powermock-module-junit4:${rootProject.ext.powermockVersion}"
testImplementation "org.powermock:powermock-module-junit4-rule:${rootProject.ext.powermockVersion}"
testImplementation "org.powermock:powermock-classloading-xstream:${rootProject.ext.powermockVersion}"
testImplementation "org.robolectric:robolectric:${rootProject.ext.robolectricVersion}"
testImplementation "org.robolectric:shadows-multidex:${rootProject.ext.robolectricVersion}"
testImplementation "org.robolectric:shadows-httpclient:${rootProject.ext.robolectricVersion}"
testImplementation "com.android.support:support-annotations:${rootProject.ext.supportVersion}"
testImplementation "com.squareup.assertj:assertj-android:${rootProject.ext.assertjVersion}"
}
apply plugin: 'com.google.gms.google-services'
In my case it was due to the AppCompatActivity extend for the start activity, When it changed to Activity it is working fine!
You can try adding: maven { url "https://maven.google.com" }
Also set your support version to 27+
This has helped me in previous instance. Not tried it with 27.0.0 or 27.0.1
I know this is not the preferred approach but it can be used as a temporary fix. Wether you want to use it or ignore it, I leave it to you. But let me know if it works.
I've googled and searched in here the solution for this but haven't found it. I just updated my Android Studio to 3.0 and I'm trying to port my app to use feature modules in order to be able to make an Instant App, but when I try to run the app from Android Studio, I get the following error:
Error:Execution failed for task
':app:transformClassesWithStackFramesFixerForDebug'.
> com.android.build.api.transform.TransformException:
java.lang.RuntimeException: java.lang.RuntimeException:
java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException:
com.android.builder.utils.FileCache$FileCreatorException:
java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF
I tried to exclude such file using packagingOptions, but apparently is not working. Here are my build.gradle files:
Project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
compileSdkVersion = 26
supportLib = '26.1.0'
}
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
App module 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' }
maven { url "https://jitpack.io" }
maven { url "https://s3.amazonaws.com/avocarrot-android-builds/dist" }
maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
maven { url "https://maven.google.com" }
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.myapp.mobile"
minSdkVersion 16
targetSdkVersion 26
versionCode 23004003
versionName "4.0.0.3"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/MANIFEST.MF'
}
}
dependencies {
def mopub = '4.16.0#aar'
def avocarrot = '4.6.0'
def exoplayer = 'r2.2.0'
def mobfox = '3.2.3'
def pubnative = '2.0.4'
def facebook = '4.+'
def pubnativeFacebookAdapter = '2.0.2-4.22.1'
def taboola = '1.3.1'
def okhttp = '3.8.1'
def okio = '1.13.0'
def picasso = '2.5.2'
def firebase = '11.4.0'
def playServices = '11.4.0'
def supportLib = '26.1.0'
def gson = '2.8.1'
def circleimageview = '2.1.0'
def floatingactionbutton = '1.3.0'
def mpAndroidChart = 'v3.0.2'
def gridViewHeaderFooter = '1.0.12'
def multidex = '1.0.1'
def floatingsearchview = '2.0.3'
def cropper = '1.0.1#aar'
def adapterdelegates = '3.0.1'
def rxjava = '2.x.y'
def rxandroid = '2.0.1'
def rxjavaAdapter = '2.3.0'
def retrofit = '2.3.0'
def rxbinding = '2.0.0'
def diagonallayout = '1.0.6'
def fabSpeedDial = '1.0.6'
def butterknife = '8.7.0'
def sqlbrite = '2.0.0'
def leakcanary = '1.5.1'
def debugDB = '1.0.1'
def crashlytics = '2.6.8#aar'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/admarvel-android-sdk-core-adcolony.jar')
implementation files('libs/libAdapterSDKMoPub.jar')
implementation files('libs/AdMobMediationAdapter.jar')
implementation files('libs/lsmsdkadmobmediationadapter.jar')
implementation files('libs/MobFox-Android-AdMob-Adapter.jar')
implementation files('libs/gcm.jar')
implementation files('libs/achartengine-1.1.0.jar')
implementation files('libs/comscore.jar')
implementation files('libs/hmediaLib-1.3.0.jar')
implementation(name:'adux-1.0.0', ext:'aar')
implementation "com.avocarrot.sdk:mediation-sdk-nativead:$avocarrot"
implementation "com.google.android.exoplayer:exoplayer:$exoplayer"
implementation "com.facebook.android:audience-network-sdk:$facebook"
implementation "com.facebook.android:facebook-android-sdk:$facebook"
implementation "com.google.ads.mediation:facebook:$facebook"
implementation "com.github.mobfox:MobFox-Android-SDK-Core:$mobfox"
implementation "net.pubnative:sdk:$pubnative"
implementation "net.pubnative:sdk.adapter.facebook:$pubnativeFacebookAdapter"
implementation "com.squareup.okhttp3:okhttp:$okhttp"
implementation "com.squareup.okio:okio:$okio"
implementation "com.squareup.picasso:picasso:$picasso"
implementation "com.android.support:cardview-v7:$rootProject.supportLib"
implementation "com.android.support:support-v4:$rootProject.supportLib"
implementation "com.android.support:recyclerview-v7:$rootProject.supportLib"
implementation "com.android.support:design:$rootProject.supportLib"
implementation "com.android.support:customtabs:$rootProject.supportLib"
implementation "com.google.android.gms:play-services-analytics:$playServices"
implementation "com.google.android.gms:play-services-ads:$playServices"
implementation "com.google.android.gms:play-services-wearable:$playServices"
implementation "com.google.code.gson:gson:$gson"
implementation "de.hdodenhof:circleimageview:$circleimageview"
implementation "com.melnykov:floatingactionbutton:$floatingactionbutton"
implementation "com.github.PhilJay:MPAndroidChart:$mpAndroidChart"
implementation "in.srain.cube:grid-view-with-header-footer:$gridViewHeaderFooter"
implementation "com.android.support:multidex:$multidex"
implementation "com.github.arimorty:floatingsearchview:$floatingsearchview"
implementation "com.soundcloud.android:android-crop:$cropper"
implementation "com.hannesdorfmann:adapterdelegates3:$adapterdelegates"
implementation "io.reactivex.rxjava2:rxjava:$rxjava"
implementation "io.reactivex.rxjava2:rxandroid:$rxandroid"
implementation "com.squareup.retrofit2:adapter-rxjava2:$rxjavaAdapter"
implementation "com.squareup.retrofit2:retrofit:$retrofit"
implementation "com.squareup.retrofit2:converter-gson:$retrofit"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp"
implementation "com.jakewharton.rxbinding2:rxbinding:$rxbinding"
implementation "com.jakewharton.rxbinding2:rxbinding-support-v4:$rxbinding"
implementation "com.github.florent37:diagonallayout:$diagonallayout"
implementation "io.github.yavski:fab-speed-dial:$fabSpeedDial"
implementation "com.google.firebase:firebase-messaging:$firebase"
implementation "com.jakewharton:butterknife:$butterknife"
implementation "com.squareup.sqlbrite2:sqlbrite:$sqlbrite"
annotationProcessor "com.jakewharton:butterknife-compiler:$butterknife"
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary"
testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary"
debugImplementation "com.amitshekhar.android:debug-db:$debugDB"
implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics")
{
transitive = true
}
implementation(name: 'DebugSettings', ext: 'aar')
wearApp project(':wear')
implementation project(':myapp-base')
}
apply plugin: 'com.google.gms.google-services'
Base module build.gradle
apply plugin: 'com.android.feature'
repositories {
maven { url "https://maven.google.com" }
}
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion '26.0.2'
baseFeature true
defaultConfig {
minSdkVersion 16
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 {
api "com.android.support:appcompat-v7:$rootProject.supportLib"
implementation fileTree(dir: 'libs', include: ['*.jar'])
// 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'
application project(':app')
}
You're including the libs directory twice in your app's build.gradle
// Once
implementation fileTree(include: ['*.jar'], dir: 'libs')
// And once more, but more verbose
implementation files('libs/admarvel-android-sdk-core-adcolony.jar')
implementation files('libs/libAdapterSDKMoPub.jar')
implementation files('libs/AdMobMediationAdapter.jar')
implementation files('libs/lsmsdkadmobmediationadapter.jar')
implementation files('libs/MobFox-Android-AdMob-Adapter.jar')
implementation files('libs/gcm.jar')
implementation files('libs/achartengine-1.1.0.jar')
implementation files('libs/comscore.jar')
implementation files('libs/hmediaLib-1.3.0.jar')
This could be where your issue originates. Decide on one way to include these and let me know whether that works.
Today downloaded the studio 3.0 beta 2.0 version, after that tried to open an existing project in it and faced some difficulties, most of them I could solve with the help of Google and Stack Overflow, but this one I can not.
Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: org.gradle.tooling.BuildException: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Also posting my app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.intersoft.snappy"
minSdkVersion 19
targetSdkVersion 22
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypeMatching 'dev', 'debug'
buildTypeMatching 'qa', 'debug'
buildTypeMatching 'rc', 'release'
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/']
} }
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://jitpack.io" }
maven { url 'https://dl.bintray.com/ashokslsk/CheckableView' }
maven { url "https://maven.google.com" }
}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.github.mrengineer13:snackbar:1.2.0'
implementation 'com.android.support:recyclerview-v7:26.0.1'
implementation 'com.android.support:cardview-v7:26.0.1'
implementation 'com.android.support:design:26.0.1'
implementation 'com.android.support:percent:26.0.1'
implementation 'dev.dworks.libs:volleyplus:+'
implementation 'com.google.guava:guava:21.0'
implementation 'com.facebook.fresco:fresco:1.0.1'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.wdullaer:materialdatetimepicker:3.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.stfalcon:frescoimageviewer:0.4.0'
implementation 'com.github.piotrek1543:CustomSpinner:0.1'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.github.satyan:sugar:1.4'
implementation 'com.hedgehog.ratingbar:app:1.1.2'
implementation project(':sandriosCamera')
implementation('org.apache.httpcomponents:httpmime:4.2.6') {
exclude module: 'httpclient'
}
implementation 'com.googlecode.json-simple:json-simple:1.1'
}
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = ['--multi-dex']
} else {
dx.additionalParameters += '--multi-dex'
}
}
}
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
} else if
("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
}
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
}
apply plugin: 'com.jakewharton.hugo'
also my another module gradle
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
buildscript {
repositories {
jcenter()
jcenter()
maven { url "https://maven.google.com" }
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}
group = 'com.sandrios.android'
version = '1.0.8'
ext {
PUBLISH_GROUP_ID = 'com.sandrios.android'
PUBLISH_ARTIFACT_ID = 'sandriosCamera'
PUBLISH_VERSION = '1.0.8'
PUBLISH_CODE = 9
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
minSdkVersion 19
targetSdkVersion 25
versionCode PUBLISH_CODE
versionName PUBLISH_VERSION
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
task generateSourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier 'sources'
}
task generateJavadocs(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath()
.join(File.pathSeparator))
}
task generateJavadocsJar(type: Jar) {
from generateJavadocs.destinationDir
classifier 'javadoc'
}
generateJavadocsJar.dependsOn generateJavadocs
artifacts {
archives generateSourcesJar
archives generateJavadocsJar
}
install {
repositories.mavenInstaller {
pom.project {
name PUBLISH_GROUP_ID
description 'Simple integration of universal camera in android for easy image and video capture.'
url 'https://github.com/sandrios/sandriosCamera'
inceptionYear '2016'
packaging 'aar'
version PUBLISH_VERSION
scm {
connection 'https://github.com/sandrios/sandriosCamera.git'
url 'https://github.com/sandrios/sandriosCamera'
}
developers {
developer {
name 'arpitgandhi9'
}
}
}
}
}
bintray {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
user = properties.getProperty('bintray.user')
key = properties.getProperty('bintray.apikey')
configurations = ['archives']
pkg {
repo = 'android'
name = 'sandriosCamera'
userOrg = 'sandriosstudios'
desc = 'Android solution to simplify work with different camera apis.'
licenses = ['MIT']
labels = ['android', 'camera', 'photo', 'video']
websiteUrl = 'https://github.com/sandrios/sandriosCamera'
issueTrackerUrl = 'https://github.com/sandrios/sandriosCamera/issues'
vcsUrl = 'https://github.com/sandrios/sandriosCamera.git'
version {
name = PUBLISH_VERSION
vcsTag = PUBLISH_VERSION
desc = 'Minor fixes.'
released = new Date()
}
}
}
repositories {
jcenter()
}
dependencies {
implementation 'com.android.support:support-v4:26.0.0'
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:recyclerview-v7:26.0.0'
implementation 'com.github.bumptech.glide:glide:3.6.1'
implementation 'com.yalantis:ucrop:2.2.0'
implementation 'gun0912.ted:tedpermission:1.0.2'
}
and also project level gradle
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
please help me to get rid of this error
It is important part:
You need to add this in that module's build.gradle where it's not added like app module.
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Also you forgot to add repo for plugin:
buildscript {
repositories {
jcenter()
google()
}
}
I had the same errors(SimException) that you encountered. I had 3 modules in android clean architecture project:
data(android library)
domain(plain java module)
presentation(app - all android stuff)
solution
navigate to File/Project Structure...
make sure your modules has the same Source and Target Compatibility (1.8 in this case)
I added a library with the compileOptions Java 1.8, and In my main project dont.
Fixed adding:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Found my answer, for me personally it was using
implementation "com.google.guava:guava:23.0"
Instead of
implementation "com.google.guava:guava:23.0-android"
I was having the same issue. I had recently deleted my .gradle cache folder, and reinstalled Android Studio and the SDK. Eventually when trying to git bisect the problem, it went away. I can only speculate as to why this happened, but I suspect that downloading older versions of the build tools and SDK, and building (and presumably caching) versions of our code with those older tools caused it to be built in a way that didn't cause issues.
This points to some sort of bug in the way that the newer (API 26?) build tools are building the source code, and so my recommendation if you're seeing this problem and the other solutions don't work, is to lower your target SDK version to 25 or lower, install the necessary build tools, and try compiling your code with those, before reverting to build tools 26 or higher.