构建 apk 成功但在设备和模拟器上崩溃 [英] Building apk successful but crashes on devices and emulator

查看:58
本文介绍了构建 apk 成功但在设备和模拟器上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从这个 implementation 'com.android.支持:appcompat-v7:28.0.0'因为我通过答案解决了我的问题,但现在我的应用程序不断崩溃.

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.

这就是发生的事情:我构建了我的 apk,我将它发送到模拟器和我的设备(galaxy a6+),然后我得到一个程序已被关闭"(不知道术语在技术上是否正确,安装成功后,我正在翻译意大利语)消息.在 Galaxy s5 上,消息是数据分析过程中出错",永远无法安装.

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.

这是我的 build.gradle 在更改后感谢本网站的答案:https://www.dropbox.com/sh/1vjmrh196bdy5gn/AADW-DG1YB10s-Csw_UrZtuYa?dl=0

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

谢谢你的任何线索.

推荐答案

我遇到了和你一样的问题,正在关注你之前的问题.

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

我找到了解决办法:在使用之前先初始化 firebase 的实例,添加以下行:

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

FirebaseApp.initializeApp(this); 

在获取 Firebase 实例之前.

before getting an instance of Firebase.

然后在 build.gradle 中更改依赖项
类路径 'com.google.gms:google-services:4.1.0'到类路径 'com.google.gms:google-services:4.0.0'

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'

似乎 google-services:4.1.0 有问题

It seems that google-services:4.1.0 has an issue

这篇关于构建 apk 成功但在设备和模拟器上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆