简体   繁体   English

在 Android Studio 上同步新项目时发生 Firebase 错误(ASCII 错误)

[英]Firebase error while syncing a new project on Android Studio (ASCII Error)

The problem is that everytime I sync a project on Android Studio (after I followed all the steps on the Firebase guide), the "ASCII" error occured (Note that my google-services.json file is already in the app folder).问题是,每次我在 Android Studio 上同步一个项目时(在我按照 Firebase 指南中的所有步骤进行操作之后),都​​会出现“ASCII”错误(请注意,我的google-services.json文件已经在app文件夹中)。

这是 gradle 项目构建文件 这是 gradle 应用程序构建文件] 最后,这是错误

After updating the following dependencies.更新以下依赖项后。 I was able to get rid of this problem我能够摆脱这个问题

Project-level build.gradle:项目级 build.gradle:

    classpath 'com.google.gms:google-services:4.1.0'

App-level build.gradle:应用级 build.gradle:

implementation "com.google.firebase:firebase-analytics:16.0.4"

Json file for every Android studio is different unless you override over existing project.除非您覆盖现有项目,否则每个 Android Studio 的 Json 文件都是不同的。 Make sure that the json file is for that particular project but re adding the project to firebase.确保 json 文件适用于该特定项目,但将该项目重新添加到 firebase。 Try to use the latest version of Gradle build, and even for the firebase dependencies.尝试使用最新版本的 Gradle 构建,甚至对于 firebase 依赖项。 Then sync your project an check again because there shouldn't be any error unless it's an exception error.然后再次同步您的项目检查,因为除非是异常错误,否则不应该有任何错误。 I am sure you will not have any such error.我相信你不会有任何这样的错误。 I also see that build Gradle is highlight because you are using the older version make sure you use the latest version.我还看到 build Gradle 是亮点,因为您使用的是旧版本,请确保使用最新版本。 Also migrate to androidx version of dependencies.还迁移到 androidx 版本的依赖项。

将您的项目级 build.gradle: 更改为此 'com.google.gms:google-services:4.2.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM