Android dagger 2 not generating in android studio 4.1 - android

Bold: this is my Gradle configuration when I am trying to build my project using android emulator than catching that error which is very annoying for me I have to do some r&d for this issue like some people say that use falt instead of annotation processor I also do this but the problem is still not resolved. I am using android studio 4.1 trying to find out the annotation processor option but not take some luck so please help to figure out this problem thanks a lot of open source community.
click here for image
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "org.rtspplr.app"
minSdkVersion 21
targetSdkVersion 28
versionCode 106
// Previous version svn+ssh://svn#52.0.53.255/RTSP/projects/android/MediaPlayer
// last version which published on PlayMarket 4.4.3
versionName "4.4.49"
setProperty("archivesBaseName", "VXG_RTSPPlayer_$versionName-vc$versionCode")
ndk {
abiFilters 'x86', 'x86_64' , 'armeabi-v7a', 'arm64-v8a'
}
}
signingConfigs {
debug {
storeFile file("../../signing_key/Debug/debug.keystore.jks") // need for develop google map
keyAlias 'alias_name'
keyPassword 'remember.me.again'
storePassword 'remember.me'
}
release {
storeFile project.file("../../signing_key/RTSPPlayer/sign/rtspplayer-release-key.keystore")
storePassword 'remember.me'
keyAlias 'alias_name'
keyPassword 'remember.me.again'
v1SigningEnabled true
v2SigningEnabled true
}
}
buildTypes {
debug {
buildConfigField "boolean", "IS_DEBUG", "true" // Had issues with BuildConfig.DEBUG, created IS_DEBUG to ensure functionality behaved as expected.
minifyEnabled false
multiDexEnabled true
debuggable true
}
release {
buildConfigField "boolean", "IS_DEBUG", "false"
minifyEnabled false
multiDexEnabled true
debuggable false
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
/*
splits {
abi {
enable true
reset()
include 'armeabi-v7a'
universalApk false
}
}
*/
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha03'
implementation 'com.google.android.material:material:1.1.0-alpha04'
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'androidx.annotation:annotation:1.1.0-alpha02'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
androidTestImplementation 'androidx.test:runner:1.1.2-alpha02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-alpha02'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha03'
implementation project(':data')
implementation project(':logic')
implementation project(':add_cloud_camera')
implementation project(':textinputs')
implementation 'com.google.dagger:dagger:2.28'
annotationProcessor 'com.google.dagger:dagger-compiler:2.28'
implementation 'com.vxg.cloudsdk:cloudsdk:2.0.202'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.squareup.picasso:picasso:2.71828'
//implementation project(':CloudSDK')
//implementation 'io.vxg.media:components:2.0.112-alpha01'
//implementation 'androidx.cardview:cardview:1.0.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation "io.reactivex.rxjava2:rxjava:2.1.9"
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.maps.android:android-maps-utils:0.4.4'
//implementation 'commons-validator:commons-validator:1.6'
implementation 'com.google.firebase:firebase-core:17.4.2'
implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}

File -> Project Structure -> SDK Location -> JDK Location -> Choose your local jdk instead of the jre located into the android studio.

Related

I was just building the app using source code and found these issues

How can I solve this issue? I tried searching in YouTube and Chrome couldn't find the relevant solution for this. There are three issues faced. I tried changing various things in settings and tried different solution but none of those helped
THIS IS BUILD.GRADLE (app):
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion '29.0.1'
defaultConfig {
applicationId "com.pdf.scanner.queenscanner"
minSdkVersion 16
targetSdkVersion 31
versionCode 1
versionName '1.1'
multiDexEnabled true
//Photo editor
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
//Photo editor
dataBinding {
enabled = true
}
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 {
maven { url "http://jitpack.io" }
//tedpicker
maven { url "http://repo.commonsware.com.s3.amazonaws.com" }
maven { url "http://s3.amazonaws.com/repo.commonsware.com" }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
//Add library
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
//hungdh
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation project(':openCVLibrary310')
//Photo editor
// annotationProcessor 'ly.img.android:photo-editor-sdk:2.0.27'
// compile 'ly.img.android:photo-editor-sdk:2.0.27'
//OCR
implementation 'com.rmtheis:tess-two:6.1.1'
implementation 'com.github.mthli:Knife:v1.1'
//Opennote
implementation 'com.google.zxing:core:3.3.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
//compile 'com.github.ctodobom:OpenCV-3.1.0-Android:9e00ee4218ca0c9e60a905c9f09bf499f9dc5115'
implementation 'us.feras.mdv:markdownview:1.1.0'
implementation 'com.github.ctodobom:drag-select-recyclerview:0.3.4.ctodobom.sections'
implementation 'com.github.nostra13:Android-Universal-Image-Loader:v1.9.5'
implementation 'com.github.ctodobom:FabToolbar:3c5f0e0ff1b6d5089e20b7da7157a604075ae943'
//Simple document scanner
implementation 'com.afollestad.material-dialogs:core:0.8.5.9'
implementation 'com.jakewharton.timber:timber:4.1.2'
//ImagetoPDF
implementation project(':tedpicker')
implementation project(':photo-editor-sdk-2.0.27')
implementation 'com.itextpdf:itextg:5.5.9'
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.jakewharton:butterknife:10.2.1'
implementation 'com.google.firebase:firebase-analytics:21.2.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
implementation 'androidx.multidex:multidex:2.0.1'
//Auto mail
implementation 'com.github.yesidlazaro:GmailBackground:1.2.0'
implementation 'com.github.nextcloud:android-library:-SNAPSHOT'
//filter_image
implementation 'it.chengdazhi.styleimageview:styleimageview:1.0.4'
//photoview
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.google.android.gms:play-services-ads:21.3.0'
//sửa là lỗi (lúc có firebase-core)
//implementation files('/libs/photo-editor-sdk-2.0.14.aar')
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.facebook.android:facebook-android-sdk:5.13.0'
implementation 'com.facebook.android:audience-network-sdk:5.8.0'
implementation project(path: ':dynamicgrid')
}
You could download the corresponding JAR file directly from the package's Maven repository site and put it into the libs directory of your project. This earlier Stackoverflow thread might be helpful in the details.

Updating App to Android 30 to 33 - Getting errors in the Setup of Build.gradle

When I press the 'Play' (Run) button, I get this following pop-up:
My (app) build.gradle is the following:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.firebase.crashlytics'
//apply plugin: "kotlin"
android {
signingConfigs {
release {
storeFile file('....')
storePassword '.....'
keyPassword '.....'
keyAlias = '.....'
}
debug {
storeFile file('...')
storePassword '.....'
keyAlias = '.....'
keyPassword '...'
}
}
compileSdkVersion 33
defaultConfig {
applicationId "com......t"
minSdkVersion 26
targetSdkVersion 33
versionCode 51
versionName "3.0.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
signingConfig signingConfigs.release
}
aaptOptions {
cruncherEnabled = false
}
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
// Disable fabric build ID generation for debug builds
ext.enableCrashlytics = false
debuggable true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
namespace 'c.....t'
}
dependencies {
//FIREBASE
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-core:21.1.1'
//Notification messaging
implementation 'com.google.firebase:firebase-messaging:23.0.8'
// ANDROID / Recycler view
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.media:media:1.6.0' // 1.1.0
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.material:material:1.6.1' //1.2.0
implementation 'androidx.appcompat:appcompat:1.5.1' //1.1.0
implementation 'com.google.android.material:material:1.6.1' //1.2.0
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' //1.1.3
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
//implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10' //1.3.72
//Glide for loading pictures
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'androidx.exifinterface:exifinterface:1.3.3' //1.2.0
kapt 'com.github.bumptech.glide:compiler:4.9.0'
// To view PDF files
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
// Crashlytics
//implementation 'com.google.firebase:firebase-crashlytics:17.4.0'
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.7.0')
// Declare the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics-ktx'
// Recommended: Add the Google Analytics SDK.
//implementation 'com.google.firebase:firebase-analytics:18.0.2'
//PDF CREATION
implementation 'com.itextpdf:itextg:5.5.10'
// DATABASE - Lifecycle components // Room components
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
kapt 'androidx.lifecycle:lifecycle-compiler:2.5.1' //2.2.0
kapt 'androidx.room:room-compiler:2.4.3' //2.2.5
implementation 'androidx.room:room-runtime:2.4.3' //2.2.5
// color pallete
implementation 'androidx.palette:palette-ktx:1.0.0'
//Avoids DEX FILE ERROR
implementation 'androidx.multidex:multidex:2.0.1'
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.google.gms.google-services'
I am just updating my app after a long time so I guess a lot of breakagaes are expected which I am trying to sort out one by one. Your help is much appreciated in this. If you need any further details please feel free to ask.

Debug app working but release app not working?

Is there any changes that i want to do in gradle file to work the release app properly. I have recently shifted from normal app to androidx. When i have debug the app and run in my phone it's working properly but when i have installed the release app the it's not working so how to fix it ? When i have move my app to android-x then it has requesting me to change the setShiftingMode(false) to setShifting(false) the problem has been occured due to this or not. How i can fix the above issue ?
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.8, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.demo"
manifestPlaceholders = [onesignal_app_id : "fa5f9ac7-sdfdf-dfdf-exampleid-6f",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
minSdkVersion 19
targetSdkVersion 29
versionCode 5
versionName "5.1.11"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
multiDexEnabled true
}
android {
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
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
debuggable false
shrinkResources true
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.devbrackets.android:exomedia:4.2.1'
implementation 'com.daimajia.numberprogressbar:library:1.4#aar'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.3'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation project(':library')
implementation('com.github.afollestad.material-dialogs:core:0.8.5.1#aar') {
transitive = true
}
implementation 'org.jsoup:jsoup:1.11.1'
implementation 'com.github.faruktoptas:FancyShowCaseView:1.0.1'
implementation 'com.onesignal:OneSignal:[3.15.0, 3.99.99]'
implementation 'com.google.android.gms:play-services-ads:19.3.0'
implementation 'com.google.firebase:firebase-core:17.4.4'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'io.branch.sdk.android:library:2.+'
implementation project(':jiaozivideoplayer')
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

Google Play 64-bit requirement issue

I am uploading android app bundle on Google Play Store but getting 64-bit requirement error on review.My app bundle is completely Java/Kotlin based with native support as some third party has dependency on it.
I have included the support for all architecture armeabi-v7a, arm64-v8a,x86,x86_64 in gradle file also enabled split for the abi.
Gradle config I have added:
apply plugin: "com.android.application"
apply plugin: "io.fabric"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.firebase.firebase-perf'
apply from: '../jacoco.gradle'
def appCenterKey = "\"XXXX\""
android {
signingConfigs {
release {
keyAlias 'XXXX'
keyPassword 'XXXX'
storeFile file('../buildconfig/XXXXX.jks')
storePassword 'XXXXX'
}
}
compileSdkVersion 28
defaultConfig {
applicationId "com.XXXXX.XXXX"
minSdkVersion 23
targetSdkVersion 28
versionCode 504
versionName "2.0.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
ndk {
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
}
}
buildTypes {
all {
buildConfigField "String", XXXXX,appCenterKey
}
debug {
applicationIdSuffix '.dev'
versionNameSuffix '-DEV'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
animationsDisabled true
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
bundle {
language {
enableSplit = true
}
density {
enableSplit = true
}
abi {
enableSplit = true
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation "junit:junit:4.12"
androidTestImplementation 'androidx.test:runner:1.2.0'
// Mockito
def mockitoVersion = "2.17.0"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
androidTestImplementation "org.mockito:mockito-android:$mockitoVersion"
// App Center dependencies
def appCenterVersion = "1.4.0"
implementation "com.microsoft.appcenter:appcenter-analytics:$appCenterVersion"
implementation "com.microsoft.appcenter:appcenter-crashes:$appCenterVersion"
// GSON (https://github.com/google/gson)
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'org.danilopianini:gson-extras:0.2.1'
// Picasso (http://square.github.io/picasso/)
implementation "com.squareup.picasso:picasso:2.71828"
implementation 'androidx.exifinterface:exifinterface:1.0.0'
// Google Play Services
def googlePlayVersion = "17.0.0"
implementation "com.google.android.gms:play-services-maps:$googlePlayVersion"
implementation "com.google.android.gms:play-services-location:$googlePlayVersion"
// AWS (Cognito, API Gateway, etc.)
def awsVersion = "2.14.2"
implementation("com.amazonaws:aws-android-sdk-auth-userpools:$awsVersion#aar") {
transitive = true
}
implementation("com.amazonaws:aws-android-sdk-mobile-client:$awsVersion#aar") {
transitive = true
}
implementation "com.amazonaws:aws-android-sdk-apigateway-core:$awsVersion"
implementation "com.amazonaws:aws-android-sdk-kinesis:$awsVersion"
// For amazon web hosted UI authorization
implementation("com.amazonaws:aws-android-sdk-cognitoauth:$awsVersion#aar") {
transitive = true
}
// Adapter Delegates (https://github.com/sockeqwe/AdapterDelegates)
implementation 'com.hannesdorfmann:adapterdelegates3:3.0.1'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
//Dagger 2
implementation 'com.google.dagger:dagger:2.16'
kapt "com.google.dagger:dagger-compiler:2.16"
//Permissions
def permissionsVersion = "3.3.1"
implementation("com.github.hotchemi:permissionsdispatcher:$permissionsVersion") {
exclude module: "support-v13"
}
kapt "com.github.hotchemi:permissionsdispatcher-processor:3.3.1"
// Braintree - (Suppressing Lint warning as the Braintree docs ask for dynamic version)
//noinspection GradleDynamicVersion
implementation 'com.braintreepayments.api:drop-in:3.7.0'
//Circular ImageView
implementation 'de.hdodenhof:circleimageview:2.2.0'
//Calligraphy
implementation 'io.github.inflationx:calligraphy3:3.0.0'
implementation 'io.github.inflationx:viewpump:1.0.0'
// Animated Gif
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.16'
//Image Compressor
implementation 'id.zelory:compressor:2.1.0'
// Firebase
implementation "com.google.firebase:firebase-core:17.0.1"
implementation "com.google.firebase:firebase-perf:18.0.1"
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0-RC2'
implementation 'com.airbnb.android:lottie:2.7.0'
// Google vision API for Face Detection
implementation 'com.google.android.gms:play-services-vision:18.0.0'
// Google wallet for Google Pay
implementation 'com.google.android.gms:play-services-wallet:17.0.0'
// TODO Enable below line for this error for compile time error : Dagger2 cannot access nullable. javax.annotation.Nullable not found
// implementation 'com.google.code.findbugs:jsr305:3.0.2'
// QR and Barcode
implementation 'com.google.zxing:core:3.3.3'
//Multidex
implementation 'com.android.support:multidex:1.0.3'
}
repositories {
mavenCentral()
}
While creating a signed app bundle, in the analyzer it shows all the native support library in it(.so file under armeabi-v7a, arm64-v8a,x86,x86_64 in lib folder).
But when I upload this bundle to playstore it uploads successfully but shows support for only 2 platforms(32-bit) which is armeabi-v7a, x86. Instead it should have shown support for all platform both 64 and 32 bit.
On click of review it shows me error message
The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code.
Even though I have added dependency for both 32/64 bit native code.
you can verify add this code
defaultConfig {
....
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64', "armeabi"
}

Mixing versions can lead to runtime crashes. Help to find a reason

All my dependencies start from a verson 27, but the build task is still finishing with an Exception:
Error: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 25.4.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:cardview-v7:25.4.0 [GradleCompatible]
I know that I can add
lintOptions {
abortOnError false
}
and it will fix my issue, but I want to establish the reason.
Here is my build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "my.company.app"
minSdkVersion 19
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "0.10.8"
vectorDrawables.useSupportLibrary = true
}
testOptions {
unitTests.returnDefaultValues = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField("String", "ENV_URL_PREFIX", "\"https://\"")
buildConfigField("String", "ENVIRONMENT", "\"release\"")
}
staging {
initWith debug
buildConfigField("String", "ENV_URL_PREFIX", "\"https://staging.\"")
buildConfigField("String", "ENVIRONMENT", "\"staging\"")
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField("String", "ENV_URL_PREFIX", "\"https://dev.\"")
buildConfigField("String", "ENVIRONMENT", "\"dev\"")
}
}
flavorDimensions "app"
productFlavors {
_Live {
dimension "app"
buildConfigField("String", "TYPE", "\"live\"")
}
_Test {
dimension "app"
buildConfigField("String", "TYPE", "\"test\"")
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'lib/x86_64/darwin/libscrypt.dylib'
exclude 'lib/x86_64/freebsd/libscrypt.so'
exclude 'lib/x86_64/linux/libscrypt.so'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.jakewharton.threetenabp:threetenabp:1.1.0'
implementation 'me.dm7.barcodescanner:zxing:1.8.4'
implementation 'com.crowdfire.cfalertdialog:cfalertdialog:1.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.zxing:zxing-parent:3.3.3'
implementation 'com.google.zxing:core:3.3.2'
implementation 'com.google.guava:guava:22.0'
implementation project(':mobile_api') // a module compiled with java plugin
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
}
My idea that some of the dependencies transit a com.android.support libraries with version 25.4.0.
I would be grateful for any suggestions.
Thanks in advance!
You are using this library 'com.crowdfire.cfalertdialog:cfalertdialog:1.1.0',
and it in turn uses dependency 'com.android.support:cardview-v7:25.4.0'
Perhaps this is the cause of the conflict.
Add this to the very end of your root level build.gradle:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') { details.useVersion '27.x.x' }
}
}
To fix it I added a dependency
implementation 'com.android.support:cardview-v7:27.1.1'
in my build.gradle which overrides 25.4.0. Therefore, you do not need to look for a dependency that includes a breaking library.

Categories

Resources