7
respostas

Erro ao gerar o APK

No emulador o aplicativo roda perfeitamente. Gero o APK que instala perfeitamente, mas ao primeiro acesso gera um erro. Ao clicar no aplicativo novamente. Retirei o aplicativo do emulador e gerei novamente. Não imagino o que pode estar acontecendo. Posso te enviar o log.

7 respostas

Chegou a fazer deploy do aplicativo no celular conectado ao cabo USB? Normalmente na IDE ele lista os erros que ocorrem no dispositivo ao abrir / navegar por um app.

Opa Vanessa, tudo bem?

O problema pode acontecer por diversos motivos, é justamente por isso que é importante mandar o log quando acontecer algum problema :)

Em outras palavras, sempre que tiver um problema mande o log que é a maneira pela qual conseguimos interpretar o erro e identificar a causa.

Claro, geralmente os logs importantes são as Exceptions, que são a partir delas que vemos o problema que aconteceu. Portanto, mande apenas todo o log da Exception que a gente da uma olhada e te passa um feedback do que pode estar acontecendo

[]s

                                                 [ 08-29 18:24:58.707  1963: 2208 D/         ]
                                                 HostConnection::get() New Host Connection established 0x9999acc0, tid 2208
08-29 18:24:58.710 1227-1227/? E/EGL_emulation: tid 1227: eglCreateSyncKHR(1660): error 0x3004 (EGL_BAD_ATTRIBUTE)
08-29 18:24:58.750 1963-2208/system_process D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
08-29 18:24:58.757 4394-4394/? D/AndroidRuntime: Shutting down VM
08-29 18:24:58.764 4408-4408/? I/art: Not late-enabling -Xcheck:jni (already on)
08-29 18:24:58.769 1963-1974/system_process I/ActivityManager: Start proc 4408:br.com.embrapa.leite/u0a58 for activity br.com.embrapa.leite/.IniciarBaseActivity
08-29 18:24:58.823 1227-2719/? D/gralloc_ranchu: gralloc_alloc: format 1 and usage 0x933 imply creation of host color buffer

                                                 [ 08-29 18:24:58.880  1963: 1982 D/         ]
                                                 HostConnection::get() New Host Connection established 0x9997f840, tid 1982
08-29 18:24:58.901 4421-4421/? W/dex2oat: Unexpected CPU variant for X86 using defaults: x86
08-29 18:24:58.901 4421-4421/? W/dex2oat: Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2) for the command line:
08-29 18:24:58.901 4421-4421/? W/dex2oat: /system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/br.com.embrapa.leite-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@br.com.embrapa.leite-1@split_lib_dependencies_apk.apk@classes.dex
08-29 18:24:58.902 4421-4421/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/x86/data@app@br.com.embrapa.leite-1@split_lib_dependencies_apk.apk@classes.dex: Permission denied
08-29 18:24:58.902 4421-4421/? I/dex2oat: dex2oat took 481.960us (threads: 2) 
08-29 18:24:58.902 4408-4408/br.com.embrapa.leite W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/br.com.embrapa.leite-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@br.com.embrapa.leite-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
08-29 18:24:58.922 2970-3104/com.android.launcher3 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa08d6000
08-29 18:24:59.253 4337-4350/com.android.packageinstaller E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae4b1150
08-29 18:24:59.321 4337-4350/com.android.packageinstaller E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae4b1070
08-29 18:24:59.343 1227-1307/? D/hwcomposer: hw_composer sent 339 syncs in 60s
08-29 18:24:59.657 4447-4447/? W/dex2oat: Unexpected CPU variant for X86 using defaults: x86
08-29 18:24:59.657 4447-4447/? W/dex2oat: Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2) for the command line:
08-29 18:24:59.657 4447-4447/? W/dex2oat: /system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/br.com.embrapa.leite-1/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@br.com.embrapa.leite-1@split_lib_slice_0_apk.apk@classes.dex
08-29 18:24:59.658 4447-4447/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/x86/data@app@br.com.embrapa.leite-1@split_lib_slice_0_apk.apk@classes.dex: Permission denied
08-29 18:24:59.659 4447-4447/? I/dex2oat: dex2oat took 1.758ms (threads: 2)
08-29 18:30:22.473 1963-1976/system_process E/DeviceIdleController: Bad device idle settings
                                                                    java.lang.IllegalArgumentException: 'null' in 'null' is not a valid key-value pair
                                                                        at android.util.KeyValueListParser.setString(KeyValueListParser.java:57)
                                                                        at com.android.server.DeviceIdleController$Constants.updateConstants(DeviceIdleController.java:494)
                                                                        at com.android.server.DeviceIdleController$Constants.onChange(DeviceIdleController.java:488)
                                                                        at android.database.ContentObserver.onChange(ContentObserver.java:145)
                                                                        at android.database.ContentObserver$NotificationRunnable.run(ContentObserver.java:216)
                                                                        at android.os.Handler.handleCallback(Handler.java:739)
                                                                        at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                        at android.os.Looper.loop(Looper.java:148)
                                                                        at android.os.HandlerThread.run(HandlerThread.java:61)
08-29 18:30:22.482 2777-3356/com.google.android.gms.persistent W/Conscrypt: Could not set socket write timeout: null
08-29 18:30:22.487 2777-3194/com.google.android.gms.persistent I/GCoreUlr: WorldUpdater:com.google.android.gms.phenotype.UPD
08-29 18:30:22.806 2777-3356/com.google.android.gms.persistent W/GLSUser: [AppCertManager] IOException while requesting key: 
                                                                          java.io.IOException: Invalid device key response.
                                                                              at evk.a(:com.google.android.gms:274)
                                                                              at evk.a(:com.google.android.gms:4238)
                                                                              at evj.a(:com.google.android.gms:45)
                                                                              at evd.a(:com.google.android.gms:50)
                                                                              at evc.a(:com.google.android.gms:104)
                                                                              at com.google.android.gms.auth.account.be.legacy.AuthCronChimeraService.b(:com.google.android.gms:4049)
                                                                              at ecm.call(:com.google.android.gms:2041)
                                                                              at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                              at llt.run(:com.google.android.gms:450)
                                                                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                              at lqc.run(:com.google.android.gms:17)
                                                                              at java.lang.Thread.run(Thread.java:818)
08-29 18:30:22.879 2777-9260/com.google.android.gms.persistent W/art: Long monitor contention event with owner method=void amcx.run() from :com.google.android.gms:1092 waiters=2 for 640ms
08-29 18:30:22.888 2806-3045/com.google.android.gms I/Icing: Query from com.google.android.gms package restrict com.google.android.gms start 0 num 100
08-29 18:30:22.919 2777-9274/com.google.android.gms.persistent E/GCoreUlr: Bad errorId configuring silent feedback

Oi Vanessa, tudo bem?

Não ocorreu esse problema ainda no projeto do curso, portanto, não sei te dizer exatamente o que aconteceu... No caso, esse erro foi ao baixar o projeto fornecido pelo curso? Também, se possível, me manda o script do build.gradle tanto do projeto como também do módulo app para eu verificar as configurações que foram feitas, pois existe uma possibilidade de problema entre as versões de dependências do projeto.

[]s

Ocorre um erro comigo depois que gero o APK.

The apK failed to install. Install_parse_failed_inconsistent_certificates

Talvez possa ser o mesmo erro. Tem algo relacionado com a geração da Key, mas não sei ainda o que é.