rx java - Android app install with Failure [INSTALL_FAILED_DEXOPT] Android 2.3.x devices -


i have app composed of multiple modules have updated rxjava1 rxjava2. there no way install on android 10 devices or emulators. on compile time, no errors installs fails either android studio or command line. here of settings:

compilesdkversion = 25 buildtoolsversion = "25.0.1" minsdkversion = 10 targetsdkversion = 21 

running ./gradlew app:dependencies

compile - classpath compiling main sources. +--- com.android.support:appcompat-v7:25.3.1 |    +--- com.android.support:support-annotations:25.3.1 |    +--- com.android.support:support-v4:25.3.1 |    |    +--- com.android.support:support-compat:25.3.1 |    |    |    \--- com.android.support:support-annotations:25.3.1 |    |    +--- com.android.support:support-media-compat:25.3.1 |    |    |    +--- com.android.support:support-annotations:25.3.1 |    |    |    \--- com.android.support:support-compat:25.3.1 (*) |    |    +--- com.android.support:support-core-utils:25.3.1 |    |    |    +--- com.android.support:support-annotations:25.3.1 |    |    |    \--- com.android.support:support-compat:25.3.1 (*) |    |    +--- com.android.support:support-core-ui:25.3.1 |    |    |    +--- com.android.support:support-annotations:25.3.1 |    |    |    \--- com.android.support:support-compat:25.3.1 (*) |    |    \--- com.android.support:support-fragment:25.3.1 |    |         +--- com.android.support:support-compat:25.3.1 (*) |    |         +--- com.android.support:support-media-compat:25.3.1 (*) |    |         +--- com.android.support:support-core-ui:25.3.1 (*) |    |         \--- com.android.support:support-core-utils:25.3.1 (*) |    +--- com.android.support:support-vector-drawable:25.3.1 |    |    +--- com.android.support:support-annotations:25.3.1 |    |    \--- com.android.support:support-compat:25.3.1 (*) |    \--- com.android.support:animated-vector-drawable:25.3.1 |         \--- com.android.support:support-vector-drawable:25.3.1 (*) +--- com.android.support:recyclerview-v7:25.3.1 |    +--- com.android.support:support-annotations:25.3.1 |    +--- com.android.support:support-compat:25.3.1 (*) |    \--- com.android.support:support-core-ui:25.3.1 (*) +--- com.android.support:design:25.3.1 |    +--- com.android.support:support-v4:25.3.1 (*) |    +--- com.android.support:appcompat-v7:25.3.1 (*) |    +--- com.android.support:recyclerview-v7:25.3.1 (*) |    \--- com.android.support:transition:25.3.1 |         +--- com.android.support:support-annotations:25.3.1 |         \--- com.android.support:support-v4:25.3.1 (*) +--- com.google.android.gms:play-services-maps:7.5.0 |    \--- com.google.android.gms:play-services-base:7.5.0 |         \--- com.android.support:support-v4:22.0.0 -> 25.3.1 (*) +--- com.google.android.gms:play-services-gcm:7.5.0 |    \--- com.google.android.gms:play-services-base:7.5.0 (*) +--- org.ocpsoft.prettytime:prettytime:3.2.4.final +--- com.google.maps.android:android-maps-utils:0.4 +--- com.fasterxml.jackson.core:jackson-databind:2.4.4 |    +--- com.fasterxml.jackson.core:jackson-annotations:2.4.0 |    \--- com.fasterxml.jackson.core:jackson-core:2.4.4 -> 2.8.7 +--- com.google.code.gson:gson:2.7 +--- com.jakewharton.timber:timber:4.3.1 +--- com.google.dagger:dagger:2.8 |    \--- javax.inject:javax.inject:1 +--- com.jakewharton:butterknife:8.5.1 |    +--- com.jakewharton:butterknife-annotations:8.5.1 |    |    \--- com.android.support:support-annotations:25.1.0 -> 25.3.1 |    +--- com.android.support:support-annotations:25.1.0 -> 25.3.1 |    \--- com.android.support:support-compat:25.1.0 -> 25.3.1 (*) +--- com.getsentry.raven:raven-android:8.0.2 |    \--- com.getsentry.raven:raven:8.0.2 |         +--- org.slf4j:slf4j-api:1.7.24 |         \--- com.fasterxml.jackson.core:jackson-core:2.8.7 +--- com.github.bumptech.glide:glide:3.8.0 +--- com.squareup.sqlbrite2:sqlbrite:2.0.0 |    +--- io.reactivex.rxjava2:rxjava:2.1.0 |    |    \--- org.reactivestreams:reactive-streams:1.0.0 |    \--- com.android.support:support-annotations:25.3.1 +--- io.reactivex.rxjava2:rxandroid:2.0.1 |    \--- io.reactivex.rxjava2:rxjava:2.0.1 -> 2.1.0 (*) +--- io.reactivex.rxjava2:rxjava:2.1.0 (*) +--- project :domain |    +--- com.google.dagger:dagger:2.8 (*) |    +--- io.reactivex.rxjava2:rxandroid:2.0.1 (*) |    \--- io.reactivex.rxjava2:rxjava:2.1.0 (*) +--- project :data |    +--- project :domain (*) |    +--- project :database |    |    +--- com.jakewharton.timber:timber:4.3.1 |    |    +--- com.squareup.sqlbrite2:sqlbrite:2.0.0 (*) |    |    +--- io.reactivex.rxjava2:rxandroid:2.0.1 (*) |    |    \--- io.reactivex.rxjava2:rxjava:2.1.0 (*) |    +--- com.google.dagger:dagger:2.8 (*) |    +--- com.squareup.retrofit2:converter-gson:2.3.0 |    |    +--- com.squareup.retrofit2:retrofit:2.3.0 |    |    |    \--- com.squareup.okhttp3:okhttp:3.8.0 |    |    |         \--- com.squareup.okio:okio:1.13.0 |    |    \--- com.google.code.gson:gson:2.7 |    +--- com.squareup.okhttp3:logging-interceptor:3.6.0 |    |    \--- com.squareup.okhttp3:okhttp:3.6.0 -> 3.8.0 (*) |    +--- com.squareup.retrofit2:adapter-rxjava2:2.3.0 |    |    +--- com.squareup.retrofit2:retrofit:2.3.0 (*) |    |    \--- io.reactivex.rxjava2:rxjava:2.0.0 -> 2.1.0 (*) |    +--- com.jakewharton.timber:timber:4.3.1 |    +--- com.squareup.sqlbrite2:sqlbrite:2.0.0 (*) |    +--- io.reactivex.rxjava2:rxandroid:2.0.1 (*) |    \--- io.reactivex.rxjava2:rxjava:2.1.0 (*) \--- project :database (*) 

i did other similar thread said, clean project, delete build folders, started fresh build on computer no way app installed built there.

if remove rxjava2 , rxandroid2 dependency , comment out code uses them, app installs fine. reenable them error again. on studion error is:

installation failed since device possibly has stale dexed jars  don't match current version (dexopt error). in order proceed, have uninstall existing application.  warning: uninstalling remove application data!  want uninstall existing application? 

of course yes if know app not installed , of course fails.

i have tried method count tool https://github.com/keepsafe/dexcount-gradle-plugin methods still below 64000 added multidex explained here: https://developer.android.com/studio/build/multidex.html still not work! have tried playing target sdk, increase 25 , buildtools 26, using more recent gradle wrapper before (currently on 3.5) nothing, still same issue. have no idea of else try revert rxjava1 reason updated in first place because have many items , oome on android 10 after reading https://github.com/reactivex/rxjava/wiki/what's-different-in-2.0#which-type-to-use decided upgrade. not anywhere rxjava2 not compatible android 10. app installs fine on android 19++ (have not tried inbetween 10 , 19) have tried sample https://github.com/square/sqlbrite , changed work api 10 , installs fine on android 10. ideas of else can try?

update: these logs emulator:

56.584 1186-1207/system_process e/packagemanager: package com.mypackage.myapp has mismatched uid: 10070 on disk, 10040 in settings 08-18 11:47:56.784 1853-1853/? e/dalvikvm: linearalloc exceeded capacity (5242880), last=220 08-18 11:47:56.784 1853-1853/? e/dalvikvm: vm aborting 08-18 11:47:56.804 1132-1132/? e/installd: dexopt failed on '/data/dalvik-cache/data@app@com.mypackage.myapp-1.apk@classes.dex' res = 11 

update 2: have added proguard , still same error when trying install release builds (with proguard)

unfortunately have not found other solution removing

com.fasterxml.jackson.core:jackson-databind 

library. since use gson modified code using library use gson instead.

when found facing error, not lose time attempting adding multidex , configuring separate 2 dex files, never works right.

examine libs example http://www.methodscount.com/ , find big libraries can remove or replace smaller ones.

usefull plugin track methods count in app https://github.com/keepsafe/dexcount-gradle-plugin


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -