Realm-java: What's the "INSTALL_FAILED_DEXOPT" means when upgrade to 1.1.0?

Created on 5 Jul 2016  ·  22Comments  ·  Source: realm/realm-java

Hi, guys:
I got an issue when upgrade realm from 1.0.1 to 1.1.0 and choose run button in Android Studio 2.1.2(app running perfect with 1.0.1):

Installation failed since the device possibly has stale dexed jars that don't match the current version(dexopt error).
In order to proceed, you have to uninstall the existing application.

errors in AS run history:

Failure [INSTALL_FAILED_DEXOPT]

After uninstall the existing app, AS ask to uninstall existing app again(the app has already uninstalled), and got another error _DELETE_FAILED_INTERNAL_ERROR_

This uninstall dialog appears every time when running app and got the same error _INSTALL_FAILED_DEXOPT_

When I back to realm 1.0.1 and sync the project, the app running perfect.

I have tried to _clean the project_, or _delete all build directory_, or _invalidate caches/restart AS_, but can not fix it.
is there any other advice?
Thanks!

Version of Realm and tooling

Realm version(s): 1.1.0
Android Studio version: 2.1.2
Which Android version and device: Samsung Note3, Android 5.0

T-Bug-Crash

Most helpful comment

Ah yeah you can actually change the amount of space available for the poor Emulator device in the Emulator settings. It starts out with 800 MB I think which is maxed out by absolutely nothing.

All 22 comments

20160705120105

Hi @HsiangLeekwok,

I think this might not be a Realm specific issue. In case you are facing an issue with upgrading, here are few tips I can suggest.

  1. Restart your test device and develop machine.
  2. Clean your project from Android Studio (henceforth AS) (and remove build directories if possible. There are multiple ones according to the modules you have).
  3. Uninstall the specific projects and delete all its residue with adb rm -rf /data/data/<package path> command.
  4. In case you have multiple projects installed on your test device, uninstalling all of them.
  5. Disable Insta Run from AS as well.

Then see if this issue persists.

Sorry @stk1m1
I have tried to do all your steps(as i said in my issue), and I also try to enable/disable multidex in build.gradle, but still has not effects.
Thanks a lot!

Hi @HsiangLeekwok

The apk works fine with me. It asks three permissions and then shows a splash screen. It then moves to login page.

internal notes: more information(gradle logs,proxy source code) https://secure.helpscout.net/conversation/223218504/5196/?folderId=366141

Hi @HsiangLeekwok

I've sent you a feedback. Could you please check if it works out? We'll keep looking into this. Thanks!

Hi, @stk1m1
Sorry to reply you too late.
I have tried to follow your steps and add command line "dex.force.jumbo=true", the error still exist.

And:

  1. reduce fields of User.class(left about 44)
  2. install app, has no error and running perfect

Again:

  1. reduce fields and left 60, no error.
  2. left 61, no error.
  3. reduce fields and left 62, error

It's seems the max count is 62, but why this app running good(64 fields) with realm 1.0.1 on Samsung device?

@HsiangLeekwok

We've tested your apk on following devices and they all generated INSTALL_FAILED_DEXOPT.

  • Samsung Note 3, Android 5.0
  • Samsung Galaxy S4, Android 5.0.1
  • Samsung Galaxy S6 edge, Android 5.1.1

On Samsung device with Android 6.0, this issue does not appear. I can only say this is very much a device + version specific issue at this point. We are still looking into it and see what's the root cause of it. Meanwhile, I'd suggest to reduce the field for now. Thanks!

Thanks!

@HsiangLeekwok

Could you please make a small sample project (with code) that produces the same error you've experienced? We are trying to generate same issue with our examples but it has not been successful. I'd really appreciate it.

Hi, @stk1m1
This is the sample project:
https://github.com/HsiangLeekwok/Realm110FailedDexopt

I created a class which has 79 fields(in models/TempClass.class), and it is definitely install failed with error INSTALL_FAILED_DEXOPT on Samsung Galaxy Note3

@HsiangLeekwok

Thanks for the sample. We'll look into it!

I'm moving this to P2 as it requires more investigation.

Internal Note

dex2oat issue testing is summarized here in wiki.

what happened at last? I have same issue, What is the solution?

@AmirMehr
Let your properties count less than 64(or 62) would be ok(Samsung devices).

Closing as this is a device specific issue, that can only be solved by reducing the number of properties in the class.

targetSdkVersion 22//17==========================> set this number less then or equal to the version of Android OS on devices might help

defaultConfig {
        applicationId "software.nhut.personalutilitiesforlife"
        minSdkVersion 16
        targetSdkVersion 22//17==========================> set this number less then or equal to the version of Android OS on devices might help
        versionCode 5
        versionName "1.26"
        // Enabling multidex support.
        multiDexEnabled true
    }

I saw how much space the emulator had and was almost nothing so I deleted some apps and with this, my problem was resolved.!!

Ah yeah you can actually change the amount of space available for the poor Emulator device in the Emulator settings. It starts out with 800 MB I think which is maxed out by absolutely nothing.

dex2oat issue testing is summarized here in wiki.

Hi @stk1m1 we're having the same issue with Android 5.0 devices and Kotlin coroutines update.

Could you please share dex2oat investigation? The link is not working anymore...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AAChartModel picture AAChartModel  ·  3Comments

bryanspano picture bryanspano  ·  3Comments

cmelchior picture cmelchior  ·  3Comments

yuwu picture yuwu  ·  3Comments

CNyezi picture CNyezi  ·  3Comments