Building apk successful but crashes on devices and emulator

别说谁变了你拦得住时间么 提交于 2019-12-13 03:34:53

问题


I am moving a new question from this one implementation 'com.android.support:appcompat-v7:28.0.0' because I solved my problem thanks to the answers but now my app is continuously crashing.

This is what happens: I build my apk, I send it to the emulator and to my device (galaxy a6+) and I get a "The program has been shut down" (don't know if terms are technically correct, I am translating from Italian) message after installing successfully. On a galaxy s5 the message is "error during data analysis" and never get to install it.

This is my build.gradle after the changes made thanks to the answers on this site : https://www.dropbox.com/sh/1vjmrh196bdy5gn/AADW-DG1YB10s-Csw_UrZtuYa?dl=0

Thank you for any clue.


回答1:


I was having the same problem as you and am following you from the previous question.

I have found a solution: First initialize the instance of firebase before using it by adding the line:

FirebaseApp.initializeApp(this); 

before getting an instance of Firebase.

Then in build.gradle change the dependency
classpath 'com.google.gms:google-services:4.1.0' to classpath 'com.google.gms:google-services:4.0.0'

It seems that google-services:4.1.0 has an issue



来源:https://stackoverflow.com/questions/53132099/building-apk-successful-but-crashes-on-devices-and-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!