2

I'm developing an Android app on Android Studio, and when I run it on the emulator, everything goes fine. But when I try to run it on my phone, this message appears: Failure [INSTALL_FAILED_DEXOPT] And then, it shows this window:

enter image description here

If I click OK, it gives me this message: Unknown failure

Also, in logcat, this exception appears:

11-19 11:18:35.080 26295-26300/? W/dex2oat: Before Android 4.1, method int android.support.v7.internal.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
11-19 11:18:50.260 713-755/? W/PackageManager: Package couldn't be installed in /data/app/com.example.portol.agendalocal2-1
11-19 11:18:50.260 713-755/? W/PackageManager: com.android.server.pm.PackageManagerException: scanPackageLI
11-19 11:18:50.260 713-755/? W/PackageManager:     at com.android.server.pm.PackageManagerService.scanPackageDirtyLI(PackageManagerService.java:6313)
11-19 11:18:50.260 713-755/? W/PackageManager:     at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:5605)
11-19 11:18:50.260 713-755/? W/PackageManager:     at com.android.server.pm.PackageManagerService.installNewPackageLI(PackageManagerService.java:10550)
11-19 11:18:50.260 713-755/? W/PackageManager:     at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:11128)
11-19 11:18:50.260 713-755/? W/PackageManager:     at com.android.server.pm.PackageManagerService.access$2800(PackageManagerService.java:241)
11-19 11:18:50.260 713-755/? W/PackageManager:     at com.android.server.pm.PackageManagerService$6.run(PackageManagerService.java:8993)
11-19 11:18:50.260 713-755/? W/PackageManager:     at android.os.Handler.handleCallback(Handler.java:815)
11-19 11:18:50.260 713-755/? W/PackageManager:     at android.os.Handler.dispatchMessage(Handler.java:104)
11-19 11:18:50.260 713-755/? W/PackageManager:     at android.os.Looper.loop(Looper.java:194)
11-19 11:18:50.260 713-755/? W/PackageManager:     at android.os.HandlerThread.run(HandlerThread.java:61)
11-19 11:18:50.260 713-755/? W/PackageManager:     at com.android.server.ServiceThread.run(ServiceThread.java:46)

I've already searched almost everyplace on internet, but I just can't find a solution to this problem. I've already tried changing the SKD version of the project, cleaning the project, but nothing works. I've tested it on other people's phones and got no problems, it's just in my phone. I don't know what to do anymore, so please, if someone knows how to fix this, help me.

Gerald Schneider
  • 17,416
  • 9
  • 60
  • 78
  • Could you give some more informations like API Version of your Phone, remaining Storage, was the app installed before, size of your Project(MaxMethod count, Dex size)? INSTALL_FAILED_DEXOPT can have multiple reasons. INSTALL_FAILED_DEXOPT can sometimes be a little misterios. – daemmie Nov 19 '15 at 14:02
  • do you have installed any version of the app on your device and did you try to uninstall it? – Rich Nov 19 '15 at 14:25
  • I never installed the app on my device, since the beginning I was getting this error. The API version of my phone is 22, and I'm currently using 21 to compile and as target version on the build.gradle, I was using 22 as target and compile version before, but nothing changed. I have about 20gb of remaining storage, the apk has 3.6mb. I don't know how to see the size of my project, can you help me on that? – Leonardo Porto Nov 19 '15 at 14:36
  • You're getting the same thing I'm getting in my question. http://stackoverflow.com/questions/33781210/my-newly-released-app-cant-be-installed-error-code-504 Let's debug this together :) – Aphex Nov 19 '15 at 15:43
  • Oh, seems like we're getting the same problem then. Except by the fact that even if I change the minSdkVersion to 21, it still refuses to install – Leonardo Porto Nov 19 '15 at 15:53

1 Answers1

1

You seem to be getting the same error I was getting here.

I solved it by downgrading to buildToolsVersion "23.0.1".

Build tools version 23.0.2 seems to be broken for multi-dexed apps!

Community
  • 1
  • 1
Aphex
  • 7,390
  • 5
  • 33
  • 54
  • Yeah, but I was always using buildToolsVersion "23.0.1". But my problem was solved yesterday when my phone asked to update, and after I updated it, I was able to install the app, and now it even runs directly from Android Studio. – Leonardo Porto Nov 20 '15 at 13:33