相关疑难解决方法(0)

任务“:app:mapDebugSourceSetPaths”执行失败。> 评估任务的属性“extraGeneeratedResDir”时出错

我检查过这个答案: https ://stackoverflow.com/a/34834772/13519865

它告诉我们删除这一行

apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

按照要求删除该行即可完成构建,但我无法使用 Firebase (ofc!),它导致了一个新错误,它告诉我添加该行: https ://stackoverflow.com/a/40085096/13519865

所以,我在这里陷入了循环。此处添加了相关代码示例https://github.com/Cyber ​​avater/A.Reader

android firebase google-play-services android-gradle-plugin google-cloud-platform

169
推荐指数
8
解决办法
13万
查看次数

Crashlytics发现了一个无效的API密钥:null.更新后的com.google.gms:google-services:4.1.0

我有这个漏洞,从更新后com.google.gms:google-services:4.0.1到com.google.gms:google-services:4.1.0

Crashlytics found an invalid API key: null. 
Check the Crashlytics plugin to make sure that the application has been added successfully! 
Contact support@fabric.io for assistance.
Run Code Online (Sandbox Code Playgroud)

对于Java项目,他们没有这个问题.我试图使缓存无效并重新启动但无法解决.

我正在使用:Android Studio 3.3 Canary 8

dependencies {
      classpath 'com.android.tools.build:gradle:3.3.0-alpha08'

      classpath 'com.google.gms:google-services:4.1.0'
      classpath 'io.fabric.tools:gradle:1.25.4'

      classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61"
      classpath "org.jetbrains.kotlin:kotlin-android-extensions:1.2.61"
}
Run Code Online (Sandbox Code Playgroud)

FirebaseCrashlytics版本:

implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
Run Code Online (Sandbox Code Playgroud)

谢谢!

android firebase-crash-reporting android-studio-3.3

17
推荐指数
1
解决办法
3529
查看次数

如何处理FirebaseInstanceId.getInstance().getToken()= null

我刚迁移到FCM.我已经添加了从FirebaseInstanceIdService扩展的类,以便在适当的时候接收refreshedToken.

我的问题是针对用户第一次安装我的应用程序并且由于某种原因无法从onTokenRefresh接收注册ID的情况.我们该如何应对呢?我可以设置从我FirebaseInstanceIdService类的广播接收器在接收到注册ID将通知主要活动?

android firebase firebase-cloud-messaging

15
推荐指数
3
解决办法
4万
查看次数

尽管在使用FirebaseStorage时初始化FirebaseApp,但仍未在此过程中初始化"默认FirebaseApp"

我正在尝试使用Firebase存储下载图像.我写了以下代码

MainActivity.java

public class MainActivity extends AppCompatActivity {
ArrayList<Car> carListSuper;
RecyclerView rvCarList;
ProgressBar progressbar;
private CarListAdapter carListAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    carListSuper = new ArrayList<>();
    Firebase myFirebaseRef = new Firebase("https://carbar-7dae7.firebaseio.com/");

    rvCarList = (RecyclerView) findViewById(R.id.rvCarList);
    rvCarList.setItemAnimator(new FeedItemAnimator());
    progressbar = (ProgressBar) findViewById(R.id.progressCarLoad);
    carListAdapter = new CarListAdapter(carListSuper,MainActivity.this);

    RecyclerView.LayoutManager linearLayoutManager = new LinearLayoutManager(this);
    rvCarList.setLayoutManager(linearLayoutManager);
    rvCarList.setAdapter(carListAdapter);

    myFirebaseRef.child("carList").addValueEventListener(new ValueEventListener() {

    @Override
    public void onDataChange(DataSnapshot snapshot) {

        Log.i("saz",snapshot.getValue().toString());
        progressbar.setVisibility(View.GONE);
        carListSuper.clear();
        //String jsonString = snapshot.getValue().toString();
        try {

            for (int i=0; i<snapshot.getChildrenCount();i++) {
                //Car carList …
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-storage

5
推荐指数
1
解决办法
1万
查看次数

是否需要调用 FirebaseApp.initializeApp() 来初始化 firebase?

我将 firebase 添加到我的 android 项目中以使用 firebase 云消息传递。我遵循了文档,但没有找到任何调用FirebaseApp.initializeApp().

我的应用程序运行良好,除了一次因以下错误而崩溃。

Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.my.app. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
at com.my.app.core.ApplicationEx.onCreate(ApplicationEx.java:79)
Run Code Online (Sandbox Code Playgroud)

当我搜索错误时,给出的解决方案是FirebaseApp.initializeApp()在启动时调用。

我想知道这是否真的有必要,因为文档没有提到它,而且我的应用程序(大部分)没有它就可以正常工作。

有谁知道是否FirebaseApp.initializeApp()真的需要调用,还有什么可能导致我上面提到的错误?

以下是我的 build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.my.app"
        minSdkVersion 17
        targetSdkVersion 26
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    flavorDimensions "appType"
    productFlavors {
        passenger {
            dimension "appType"
            applicationId "com.my.app.passenger"
            versionCode …
Run Code Online (Sandbox Code Playgroud)

android firebase

5
推荐指数
1
解决办法
3712
查看次数