Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在我的android firebase应用程序中安装Fabric Crashlytics后,这个Gradle构建错误是什么?_Android_Firebase_Firebase Authentication_Crashlytics - Fatal编程技术网

在我的android firebase应用程序中安装Fabric Crashlytics后,这个Gradle构建错误是什么?

在我的android firebase应用程序中安装Fabric Crashlytics后,这个Gradle构建错误是什么?,android,firebase,firebase-authentication,crashlytics,Android,Firebase,Firebase Authentication,Crashlytics,我尝试手动添加Fabric Crashlytics,然后尝试使用该插件,但在尝试构建时出现了相同的错误: Error:Execution failed for task ':app:processReleaseManifest'. > Manifest merger failed : Attribute meta-data#io.fabric.ApiKey@value value=( my api key ) from AndroidManifest.xml:39:13-69 is

我尝试手动添加Fabric Crashlytics,然后尝试使用该插件,但在尝试构建时出现了相同的错误:

Error:Execution failed for task ':app:processReleaseManifest'.
> Manifest merger failed : Attribute meta-data#io.fabric.ApiKey@value value=( my api key ) from AndroidManifest.xml:39:13-69
    is also present at [com.firebaseui:firebase-ui-auth:1.2.0] AndroidManifest.xml:20:13-60 value=(@string/twitter_consumer_secret).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:37:9-39:72 to override.
现在我可以构建并运行该应用程序,但当我强制执行这样的崩溃时:

throw new RuntimeException("This is a crash");
我收到了坠机报告,尽管它们出现需要一段时间

我的gradle文件如下所示:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}




// Create a variable called keystorePropertiesFile, and initialize it to your
// keystore.properties file, in the rootProject folder.
def keystorePropertiesFile = rootProject.file("keystore.properties")

// Initialize a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()

// Load your keystore.properties file into the keystoreProperties object.
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))





android {
    signingConfigs {
        config {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }
    compileSdkVersion 25
    buildToolsVersion '25.0.3'
    defaultConfig {
        applicationId "aaa.bbb.ccc"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.config

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
        debug {
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:design:25.1.1'
    compile 'com.android.support:support-v4:25.1.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:recyclerview-v7:25.1.1'
    compile 'com.google.android.gms:play-services-auth:10.2.4'
    compile 'com.firebaseui:firebase-ui:1.2.0'
    compile 'com.firebaseui:firebase-ui-auth:1.2.0'
    compile 'com.google.firebase:firebase-auth:10.2.4'
    compile 'com.google.firebase:firebase-core:10.2.4'
    compile 'com.google.firebase:firebase-database:10.2.4'
    compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    testCompile 'junit:junit:4.12'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
}


apply plugin: 'com.google.gms.google-services'
在我的清单中,我已经获得了互联网许可,现在已经生效了:

<meta-data
        tools:replace="android:value"
        android:name="io.fabric.ApiKey"
        android:value=" my key " />

我的Android Studio是2.3.2版 那么,清单修复是否会在将来引起问题?初始构建错误仍然是一个问题吗?为了避免初始构建错误,我是否遗漏了一些内容? 谢谢

PS完整清单文件为:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="aaa.bbb.ccc"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-sdk tools:overrideLibrary="com.firebase.ui, com.firebase.ui.auth"/>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity
            android:name=".MainNavDrawerActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar"
            android:screenOrientation="portrait"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="stateHidden|adjustResize">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            tools:replace="android:value"
            android:name="io.fabric.ApiKey"
            android:value=" my key " />
    </application>

</manifest>

我也有同样的问题, 从清单文件中删除此项:

tools:replace="android:value"
最好将钥匙放在gradle内,如下所示:

manifestPlaceholders = [fabric_io_id: "key here "]
并将其添加到

       <meta-data
          android:name="io.fabric.ApiKey"
          android:value="${fabric_io_id}"
          tools:replace="android:value"/>


您可以共享清单文件吗?抱歉,我在其中的清单文件片段不可见-现在它在那里,您想查看完整文件吗?您声明结构密钥的部分,如果您使用的是字符串资源,则可能会导致错误。这就是为什么我想确定你在那里使用的是什么。它只是一个字符串文字,不是从属性文件或任何东西中读取的。你在使用firebase UI吗?你删除并重新添加了工具:replace=“android:value”?即使将apiKey放入gradle文件,为什么仍然需要它来避免构建错误?我们需要“tools:replace=”android:value“为了只影响结构密钥而不是整个清单,我已经尝试将替换放在中,但它不起作用。至于Gradle中的密钥是可选的。你尝试过这种方法吗?是的,我已经在使用它了-我的工具:替换已经在我的元数据标签中。你能打开你的合并清单文件并检查屏幕右侧的错误吗?就像上面列出的一样-android studio不允许我从该窗口复制,所以我不能粘贴到这里。无论如何,我认为这不值得再担心了——可能只是firebase ui auth manifest文件中的某些东西,可能需要他们在某个时候进行调整。我以前从未见过这样的错误,只是想知道我是否做错了什么。到目前为止还没有任何问题,所以我现在不太担心。谢谢
       <meta-data
          android:name="io.fabric.ApiKey"
          android:value="${fabric_io_id}"
          tools:replace="android:value"/>