PDA

Ver la Versión Completa : [ SOLUCIONADO ] App no se instala en Android 5.0


Usepe
31/08/15, 17:50:45
Saludos.

He desarrollado una aplicación que funciona perfectamente en 4.4 pero la voy a instalar en una tablet con 5.0 y me da error "Aplicación no instalada".

Si la intento debugear me pone el mensaje "INSTALL_FAILED_DEXOPT".

No he cambiado nada de la aplicación, únicamente el dispositivo fisico. ¿Como puedo resolverlo?

He intentado actualizar a la version 5.1 pero me dice que tengo instalada la ultima version disponible para este dispositivo.

pozako
01/09/15, 09:53:51
Puede que dentro de tu app estés usando fragmentos de código que quedaron obsoletos e incompatibles con versiones superiores a la 4.4...

Usepe
01/09/15, 10:04:00
¿Y por qué en el 5.1 funciona?
Os pongo un extracto del log por si me pudierais orientar

09-01 10:01:57.280: A/dex2oat(4295): art/compiler/dex/quick/ralloc_util.cc:406] No free temp registers
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] Runtime aborting...
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] Aborting thread:
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] "Compiler driver thread pool worker thread 1" prio=5 tid=2 Native (still starting up)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] | group="" sCount=0 dsCount=0 obj=0x0 self=0xb2f06400
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] | sysTid=4301 nice=0 cgrp=apps/bg_non_interactive sched=0/0 handle=0xb6366580
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] | state=R schedstat=( 2581567840 336951891 863 ) utm=248 stm=10 core=3 HZ=100
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] | stack=0xb3200000-0xb3202000 stackSize=1024KB
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] | held mutexes= "abort lock" "mutator lock"(shared held)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #00 pc 00004640 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #01 pc 00002e8d /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #02 pc 00248379 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #03 pc 0022cd03 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+146)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #04 pc 0021d05f /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostre am<char, std::__1::char_traits<char> >&, art::Thread*)+22)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #05 pc 0021d2c5 /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+364)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #06 pc 0021d491 /system/lib/libart.so (art::Runtime::Abort()+72)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #07 pc 000a834b /system/lib/libart.so (art::LogMessage::~LogMessage()+1322)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #08 pc 001026df /system/lib/libart-compiler.so (art::Mir2Lir::AllocTempBody(art::GrowableArray<art::Mir2Lir::RegisterInfo*>&, int*, bool)+370)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #09 pc 00102751 /system/lib/libart-compiler.so (art::Mir2Lir::AllocTemp(bool)+12)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #10 pc 000a8bd7 /system/lib/libart-compiler.so (art::ArmMir2Lir::LoadStoreUsingInsnWithOffsetImm8 Shl2(art::ArmOpcode, art::RegStorage, int, art::RegStorage, art::RegStorage)+54)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #11 pc 000aa907 /system/lib/libart-compiler.so (art::ArmMir2Lir::StoreBaseDispBody(art::RegStorag e, int, art::RegStorage, art::OpSize)+814)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #12 pc 000ab29d /system/lib/libart-compiler.so (art::ArmMir2Lir::StoreBaseDisp(art::RegStorage, int, art::RegStorage, art::OpSize, art::VolatileKind)+44)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #13 pc 000deeb1 /system/lib/libart-compiler.so (art::Mir2Lir::StoreValueWide(art::RegLocation, art::RegLocation)+280)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #14 pc 000ddfd3 /system/lib/libart-compiler.so (art::Mir2Lir::GenInvokeNoInline(art::CallInfo*)+5 86)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #15 pc 000fc87f /system/lib/libart-compiler.so (art::Mir2Lir::CompileDalvikInstruction(art::MIR*, art::BasicBlock*, art::LIR*)+2638)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #16 pc 000fdda7 /system/lib/libart-compiler.so (art::Mir2Lir::MethodBlockCodeGen(art::BasicBlock* )+330)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #17 pc 000fdf25 /system/lib/libart-compiler.so (art::Mir2Lir::MethodMIR2LIR()+140)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #18 pc 000cebf3 /system/lib/libart-compiler.so (art::Mir2Lir::Materialize()+118)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #19 pc 00145bd7 /system/lib/libart-compiler.so (???)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #20 pc 00146217 /system/lib/libart-compiler.so (ArtQuickCompileMethod+38)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #21 pc 0015cd21 /system/lib/libart-compiler.so (art::CompilerDriver::CompileMethod(art::DexFile:: CodeItem const*, unsigned int, art::InvokeType, unsigned short, unsigned int, _jobject*, art::DexFile const&, art::DexToDexCompilationLevel)+932)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #22 pc 0015d3c5 /system/lib/libart-compiler.so (art::CompilerDriver::CompileClass(art::ParallelCo mpilationManager const*, unsigned int)+1204)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #23 pc 00153d4d /system/lib/libart-compiler.so (???)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #24 pc 00236aab /system/lib/libart.so (art::ThreadPoolWorker::Run()+34)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #25 pc 002372f9 /system/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+52)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #26 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] native: #27 pc 0001189b /system/lib/libc.so (__start_thread+6)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] (no managed stack frames)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] Dumping all threads without appropriate locks held: thread list lock mutator lock
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] All threads:
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] DALVIK THREADS (4):
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] "main" prio=5 tid=1 Native (still starting up)
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] | group="" sCount=0 dsCount=0 obj=0x0 self=0xb6307400
09-01 10:01:57.340: A/dex2oat(4295): art/runtime/runtime.cc:286] | sysTid=4295 nice=0 cgrp=apps/bg_non_interactive sched=0/0 handle=0xb6f03ec8

LEAJIM_454
02/09/15, 00:52:43
¿Con que API de android lo compilaste?, si fue con una version anterior a Lollipop puede que ese sea el problema

rafaxplayer
02/09/15, 07:50:28
Si yo opino lo mismo actualiza tu app a api 21, y haber si se soluciona.

Usepe
02/09/15, 10:01:49
He probado con la api 21 y me sigue dando el mismo problema tanto en el emulador como en el dispositivo.
No entiendo los errores que el log me esta dando y el problema que tengo es que en las maquinas que pruebo no existe actualizacion a 5.1 que se que funciona perfectamente.

kriogeN
02/09/15, 10:25:03
Tiene pinta de que tu APP (por el motivo que sea, incluso las primeras versiones de WhatsApp después de aparecer no eran compatibles) no es compatible con ART.

¿El móvil 5.1 donde lo estás probando por casualidad es un Samsung? Samsung en (su mayoría) de dispositivos con 5.0 NO disponen de la opción de usar ART, teniendo que usar Dalvik si o si, y en los que traen 5.1 Dalvik es por defecto y ART es opcional (Teóricamente ART debería ser la opción por defecto desde 5.0, pero en Samsung no es así, al menos con ROMs oficiales, precisamente porque su TouchWiz no es compatible con ART)

Así que yo apostaría a que estás probando la app en un 5.0 en un móvil NO Samsung (O sin ROM oficial) y la 5.1 en un Samsung con ROM oficial.

Usepe
02/09/15, 11:17:15
Efectivamente estoy probando en un Samsung S5 con 5.0 y tambien en una Lenovo TAB 2 A7-10F con 5.0. Probando en el samsung S6 con 5.1.1 me funciona correctamente y en otra tablet de samsung con 4.4 tambien me funciona.

Estoy desarrollando con ADT de eclipse y para compatibilizar mi aplicacion para casos especiales que tengan 5.0 ¿Que deberia hacer para trabajar usando Dalvik?

Gracias y saludos

kriogeN
02/09/15, 13:27:45
Efectivamente estoy probando en un Samsung S5 con 5.0 y tambien en una Lenovo TAB 2 A7-10F con 5.0. Probando en el samsung S6 con 5.1.1 me funciona correctamente y en otra tablet de samsung con 4.4 tambien me funciona.

Estoy desarrollando con ADT de eclipse y para compatibilizar mi aplicacion para casos especiales que tengan 5.0 ¿Que deberia hacer para trabajar usando Dalvik?

Gracias y saludos

En el S5 con 5.0 debería funcionarte, salvo que tengas alguna ROM de las que admiten activar ART (Yo tengo un S5 con 5.0 y de las últimas BTU y no lo lleva). Si no es así el problema es otro, pero por lo que indica el LogCat todo apunta a problemas al compilar el ART, así que no se.

Usepe
02/09/15, 13:32:47
ART es el nuevo runtime que incorpora la version 5.0. ¿Como puedo hacer mi app compatible con este nuevo runtime? ¿Hay alguna opcion usando eclipse? ¿Se puede hacer usando Android Studio?

mocelet
02/09/15, 13:56:07
¿La app usa alguna biblioteca nativa por JNI? ¿Está "ofuscada" con ProGuard o similar?

Según la web de desarrolladores de Google son los puntos más importantes a revisar https://developer.android.com/guide/practices/verifying-apps-art.html

En el primer caso tendrás que ver si el problema es de una biblioteca y ver si hay versiones nuevas. En el de ProGuard jugar con la configuración por si se ha cargado alguna clase que no debiera por el camino.

kriogeN
02/09/15, 16:06:50
¿La app usa alguna biblioteca nativa por JNI? ¿Está "ofuscada" con ProGuard o similar?

Según la web de desarrolladores de Google son los puntos más importantes a revisar https://developer.android.com/guide/practices/verifying-apps-art.html

En el primer caso tendrás que ver si el problema es de una biblioteca y ver si hay versiones nuevas. En el de ProGuard jugar con la configuración por si se ha cargado alguna clase que no debiera por el camino.

Es interesante lo que apunta mocelet, ¿la aplicación te funciona en 5.0 en modo depuración? Si te funciona en depuración pero no te funciona creando una release el culpable es ProGuard sin dudas. Si tampoco te funciona en depuración ProGuard no tiene nada que ver, pero lo del JNI también es muy posible.

Usepe
02/09/15, 17:21:58
En depuracion tampoco funciona.

Usepe
02/09/15, 17:25:14
En esta parte del log que tiene los problemas del runtime:

08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #00 pc 00004640 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #01 pc 00002e8d /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #02 pc 00248379 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #03 pc 0022cd03 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+146)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #04 pc 0021d05f /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostre am<char, std::__1::char_traits<char> >&, art::Thread*)+22)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #05 pc 0021d2c5 /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+364)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #06 pc 0021d491 /system/lib/libart.so (art::Runtime::Abort()+72)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #07 pc 000a834b /system/lib/libart.so (art::LogMessage::~LogMessage()+1322)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #08 pc 001026df /system/lib/libart-compiler.so (art::Mir2Lir::AllocTempBody(art::GrowableArray<art::Mir2Lir::RegisterInfo*>&, int*, bool)+370)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #09 pc 00102751 /system/lib/libart-compiler.so (art::Mir2Lir::AllocTemp(bool)+12)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #10 pc 000a8bd7 /system/lib/libart-compiler.so (art::ArmMir2Lir::LoadStoreUsingInsnWithOffsetImm8 Shl2(art::ArmOpcode, art::RegStorage, int, art::RegStorage, art::RegStorage)+54)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #11 pc 000aa907 /system/lib/libart-compiler.so (art::ArmMir2Lir::StoreBaseDispBody(art::RegStorag e, int, art::RegStorage, art::OpSize)+814)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #12 pc 000ab29d /system/lib/libart-compiler.so (art::ArmMir2Lir::StoreBaseDisp(art::RegStorage, int, art::RegStorage, art::OpSize, art::VolatileKind)+44)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #13 pc 000deeb1 /system/lib/libart-compiler.so (art::Mir2Lir::StoreValueWide(art::RegLocation, art::RegLocation)+280)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #14 pc 000ddfd3 /system/lib/libart-compiler.so (art::Mir2Lir::GenInvokeNoInline(art::CallInfo*)+5 86)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #15 pc 000fc87f /system/lib/libart-compiler.so (art::Mir2Lir::CompileDalvikInstruction(art::MIR*, art::BasicBlock*, art::LIR*)+2638)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #16 pc 000fdda7 /system/lib/libart-compiler.so (art::Mir2Lir::MethodBlockCodeGen(art::BasicBlock* )+330)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #17 pc 000fdf25 /system/lib/libart-compiler.so (art::Mir2Lir::MethodMIR2LIR()+140)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #18 pc 000cebf3 /system/lib/libart-compiler.so (art::Mir2Lir::Materialize()+118)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #19 pc 00145bd7 /system/lib/libart-compiler.so (???)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #20 pc 00146217 /system/lib/libart-compiler.so (ArtQuickCompileMethod+38)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #21 pc 0015cd21 /system/lib/libart-compiler.so (art::CompilerDriver::CompileMethod(art::DexFile:: CodeItem const*, unsigned int, art::InvokeType, unsigned short, unsigned int, _jobject*, art::DexFile const&, art::DexToDexCompilationLevel)+932)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #22 pc 0015d3c5 /system/lib/libart-compiler.so (art::CompilerDriver::CompileClass(art::ParallelCo mpilationManager const*, unsigned int)+1204)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #23 pc 00153d4d /system/lib/libart-compiler.so (???)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #24 pc 00236aab /system/lib/libart.so (art::ThreadPoolWorker::Run()+34)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #25 pc 002372f9 /system/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+52)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #26 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
08-31 17:57:45.017: A/dex2oat(28113): art/runtime/runtime.cc:286] native: #27 pc 0001189b /system/lib/libc.so (__start_thread+6)

como puedo averiguar que libreria es la que falla?

mocelet
02/09/15, 17:56:59
EDIT: Creo la clave es el mensaje "no free temp registers" del mensaje de error que pusiste en la página anterior.

Hay al menos un par de bugs en ART de mediados y finales de 2014 que han sido resueltos y que provocaban esos errores. Eso explicaría que en 5.0 pudiera fallar y en 5.1 no, coincide con las fechas entre versiones.

¿En Android 5.0.1 funcionaba o tampoco? ¿Y en el emulador?

Texto original:
Así a ojo son mensajes de error que podrían ser de cualquier cosa.

Supuesto que sea alguna biblioteca de terceros igual terminas antes mirando cuáles/cuántas usas y viendo si tienes la última versión y si tienen algún problema conocido con ART.

Usepe
03/09/15, 08:56:56
En el 5.0.1 tampoco funciona. En el emulador tampoco.

Me ha funcionado en la 5.1

Como soluciono dichos bug y a cuales te refieres?

Gracias

mocelet
03/09/15, 11:50:07
Si los bugs son del propio Android no podrías arreglarlos. Aunque en 5.0.1 arreglaron bastantes, así que es raro.

¿Y el error es al instalar dices? Ahí ya me quedo sin ideas

defcon1_es
03/09/15, 15:56:13
Hola a tod@s, soy un compañero de Usepe.
en dispositivos/emuladores con Android 5.1.x no hay problema, se instala perfectamente, pero en dispositivos/emuladores con android 5.0.x da siempre el mismo fallo, usando proguard o sin usarlo,
con el apk firmada o sin firmar.

usamos Eclipse + ADT 23.0.2.1259578
Android SDK Tools v24.3.4
Android SDK Platform-tools v23

El proyecto usa las librerías
android-support-v4.jar
commons-net-3.3.jar
google-play-services.jar
itextpdf-5.5.6.jar

Les dejo el log:
09-03 13:57:13.349: E/memtrack(25687): Couldn't load memtrack module (No such file or directory)
09-03 13:57:13.349: E/android.os.Debug(25687): failed to load memtrack module: -2
09-03 13:57:25.584: A/dex2oat(25701): art/compiler/dex/quick/ralloc_util.cc:398] No free temp registers
09-03 13:57:25.587: A/libc(25701): Fatal signal 6 (SIGABRT), code -6 in tid 25701 (main)
09-03 13:57:35.888: E/DEBUG(25706): timed out waiting for tid=25702 to stop
09-03 13:57:36.107: E/DEBUG(25706): timed out waiting for tid=25703 to stop
09-03 13:57:36.316: E/DEBUG(25706): timed out waiting for tid=25704 to stop
09-03 13:57:36.496: E/DEBUG(25706): timed out waiting for tid=25705 to stop
09-03 13:57:36.508: E/SharedPreferencesImpl(531): Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml
09-03 13:57:36.601: E/installd(145): DexInv: --- END '/data/app/terandroid.app-1/base.apk' --- status=0x0006, process failed

defcon1_es
04/09/15, 10:57:27
He migrado de Eclipse+ADT a AndroidStudio 1.2.2 y este es el mensaje que da:

Target device: lenovo-tab2a7_10f-0123456789ABCDEF
Uploading file
local path: C:\Documents and Settings\Administrador\AndroidStudioProjects\TerAn droid\terAndroid\build\outputs\apk\terAndroid-debug.apk
remote path: /data/local/tmp/terandroid.app
Installing terandroid.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/terandroid.app"
pkg: /data/local/tmp/terandroid.app
Failure [ INSTALL_FAILED_DEXOPT ]

En este momento, me aparece la siguiente ventana :

http://www.mysysadmintips.com/images/stories/articles/0574_can-t-deploy-apk_1.png


Y al pulsar "OK" me aparecen los siguientes mensajes:

DEVICE SHELL COMMAND: pm uninstall terandroid.app
DELETE_FAILED_INTERNAL_ERROR


Este es el contenido de build.gradle (Module: terAndroid)

apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.1'
//'21.1.2'
defaultConfig {
applicationId "terandroid.app"
minSdkVersion 15
targetSdkVersion 22
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt', 'proguard-project.txt'
}
}
dexOptions {
incremental true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
encoding = 'ISO-8859-1'
}
productFlavors {
}
}

dependencies {
compile project(':library')
compile 'com.android.support:support-v4:22.2.0'compile files('libs/commons-net-3.3.jar')
compile files('libs/itextpdf-5.5.4.jar')
compile files('libs/pinchzoom.jar')compile 'com.google.android.gms:play-services:7.5.0'
}

kriogeN
04/09/15, 12:56:00
Ese error te lo da porque hay instalado una librería en el sistema que difiere en versión de la que estás tratando de instalar.

Nunca me ha pasado, de hecho en una app he sobreescrito a librerías que están presentes en el sistema y me ha funcionado perfectamente, ya que las lee desde mi app y no desde el sistema.

Si tuviese que apostar diría que es porque estáis usando el soporte MultiDex, y al intentar instalar por separado y no dentro del propio classes.jar a librerías existentes casca.

Prueba quitando el soporte MultiDex, y si sigue fallando, quitad el "commons-net", que creo que debe ser el culpable al intentar machacar las librerías Apache del sistema.

defcon1_es
07/09/15, 09:44:08
Buenos dias.

El error esta provocado por un bug de ART que en Android 5.0 no admite constructores de clase con más de 100 parametros (el numero límite no lo sé con seguridad)
y salta el error art/compiler/dex/quick/ralloc_util.cc:<nnn>] No free temp registers.

Cambiando esto, la aplicación ya se instala perfectamente en Android 5.0

https://code.google.com/p/android/issues/detail?id=82787

kriogeN
07/09/15, 14:23:06
Buenos dias.

El error esta provocado por un bug de ART que en Android 5.0 no admite constructores de clase con más de 100 parametros (el numero límite no lo sé con seguridad)
y salta el error art/compiler/dex/quick/ralloc_util.cc:<nnn>] No free temp registers.

Cambiando esto, la aplicación ya se instala perfectamente en Android 5.0

https://code.google.com/p/android/issues/detail?id=82787

Según la página son 140.

La pregunta es, ¿quién necesita 140 parámetros en un constructor?. Sinceramente creo que el código está muy mal fragmentado si se llegan a esos límites.

Dexafree
07/09/15, 14:45:01
Marcamos como Solucionado, pero como dice kriogeN, madre mia... Si llegas a esos limites es que hay algo que necesita un buen rediseño

defcon1_es
07/09/15, 16:33:02
Según la página son 140.

La pregunta es, ¿quién necesita 140 parámetros en un constructor?. Sinceramente creo que el código está muy mal fragmentado si se llegan a esos límites.

El tema está en que el constructor de articulos llevaba 115 parametos, muchos de ellos de tipo double (8 bytes) que al cambiarlos a float (4 bytes) han solucionado el problema.

Gracias por vuestras respuestas.