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

查看:96
本文介绍了成功构建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,将其发送到仿真器和设备(银河a6 +),然后收到程序已关闭"(不知道术语在技术上是否正确,安装成功后,我正在翻译意大利语)消息.在银河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中更改依赖项
classpath'com.google.gms:google-services:4.1.0' 到 classpath'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天全站免登陆