2

我已经阅读了很多类似的问题,但都没有帮助我。

我将 Fabric/Crashlytics 作为模块集成到Godot 引擎(因此我不能使用智能插件或 Fabric 应用程序来执行集成过程)

有我的 gradle.build:

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

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1'
                classpath "io.fabric.tools:gradle:1.+"

    }
}

apply plugin: 'com.android.application'

allprojects {
    repositories {
        jcenter()
    mavenCentral()
        maven {
    url 'https://maven.fabric.io/public'
    }

    }
}

dependencies {
    compile 'com.android.support:support-v4:24.+'  // can be removed if minSdkVersion 16 and modify DownloadNotification.java & V14CustomNotification.java
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile fileTree(dir: '../../../modules/appodeal/android/libs', include: '*.jar')
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { transitive = true; }
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.facebook.android:facebook-android-sdk:+'

}

android {

    lintOptions {
        abortOnError false
        disable 'MissingTranslation'
    }
    dexOptions {
        preDexLibraries true
        javaMaxHeapSize "3g"
        incremental true
        dexInProcess = true
    }
    compileSdkVersion 24
    buildToolsVersion "25.0.3"
    useLibrary 'org.apache.http.legacy'

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
    defaultConfig {
        multiDexEnabled true
        minSdkVersion 14
        targetSdkVersion 23

        minSdkVersion 15
    }
    // Both signing and zip-aligning will be done at export time
    buildTypes.all { buildType ->
        buildType.zipAlignEnabled false
        buildType.signingConfig null
    }
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src'
                ,'/Users/vasya/projects/godotframework/godot/modules/analytics/android','/Users/vasya/projects/godotframework/godot/modules/appodeal/android/src','/Users/vasya/projects/godotframework/godot/modules/fabric/android/src/','/Users/vasya/projects/godotframework/godot/modules/GodotFacebook/android/src/'
            ]
            res.srcDirs = [
                'res'

            ]
            aidl.srcDirs = [
                'aidl'

            ]
            assets.srcDirs = [
                'assets'

            ]
        }
        debug.jniLibs.srcDirs = [
            'libs/debug'

        ]
        release.jniLibs.srcDirs = [
            'libs/release'

        ]
    }
    applicationVariants.all { variant ->
        // ApplicationVariant is undocumented, but this method is widely used; may break with another version of the Android Gradle plugin
        variant.outputs.get(0).setOutputFile(new File("${projectDir}/../../../bin", "android_${variant.name}.apk"))
    }
}

apply plugin: "io.fabric"

它似乎安装正确,至少我可以使应用程序崩溃并在 logcat 中查看 crashlytics 操作:

06-23 16:59:58.020: I/CrashlyticsCore(14173): Initializing Crashlytics 2.3.17.dev
06-23 16:59:58.027: D/CrashlyticsCore(14173): Installer package name is: app_process /system/bin com.android.commands.pm.Pm install -r /data/local/tmp/space-cute.apk
06-23 16:59:58.062: D/CrashlyticsCore(14173): Exception handling initialization successful
06-23 16:59:58.072: D/CrashlyticsCore(14173): Opening a new session with ID 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:00.558: D/CrashlyticsCore(14173): Initialization marker file created.
06-23 17:00:00.559: D/CrashlyticsCore(14173): Finalizing previously open sessions.
06-23 17:00:00.565: D/CrashlyticsCore(14173): Closing open sessions.
06-23 17:00:00.565: D/CrashlyticsCore(14173): Closing session: 594D1CE5005A-0001-359C-A05B7D726EF3
06-23 17:00:00.565: D/CrashlyticsCore(14173): Collecting session parts for ID 594D1CE5005A-0001-359C-A05B7D726EF3
06-23 17:00:00.566: D/CrashlyticsCore(14173): Session 594D1CE5005A-0001-359C-A05B7D726EF3 has fatal exception: false
06-23 17:00:00.567: D/CrashlyticsCore(14173): Session 594D1CE5005A-0001-359C-A05B7D726EF3 has non-fatal exceptions: false
06-23 17:00:00.567: D/CrashlyticsCore(14173): No events present for session ID 594D1CE5005A-0001-359C-A05B7D726EF3
06-23 17:00:00.567: D/CrashlyticsCore(14173): Removing session part files for ID 594D1CE5005A-0001-359C-A05B7D726EF3
06-23 17:00:00.569: D/CrashlyticsCore(14173): Closed all previously open sessions
06-23 17:00:00.574: D/CrashlyticsCore(14173): Initialization marker file removed: true
06-23 17:00:00.574: D/CrashlyticsCore(14173): Starting report processing in 1.0 second(s)...
06-23 17:00:01.575: D/CrashlyticsCore(14173): Checking for crash reports...
06-23 17:00:01.577: D/CrashlyticsCore(14173): No reports found.
06-23 17:00:04.720: D/CrashlyticsCore(14173): Crashlytics is handling uncaught exception "java.lang.RuntimeException: This is a crash" from thread GLThread 1057
06-23 17:00:04.747: D/CrashlyticsCore(14173): No log data to include with this event.
06-23 17:00:04.816: D/CrashlyticsCore(14173): Closing open sessions.
06-23 17:00:04.816: D/CrashlyticsCore(14173): Closing session: 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:04.816: D/CrashlyticsCore(14173): Collecting session parts for ID 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:04.817: D/CrashlyticsCore(14173): Session 594D1EDE003E-0001-375D-A05B7D726EF3 has fatal exception: true
06-23 17:00:04.817: D/CrashlyticsCore(14173): Session 594D1EDE003E-0001-375D-A05B7D726EF3 has non-fatal exceptions: false
06-23 17:00:04.818: D/CrashlyticsCore(14173): Collecting SessionStart data for session ID 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:04.819: D/CrashlyticsCore(14173): Collecting SessionUser data for session ID 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:04.820: D/CrashlyticsCore(14173): Collecting SessionApp data for session ID 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:04.821: D/CrashlyticsCore(14173): Collecting SessionOS data for session ID 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:04.822: D/CrashlyticsCore(14173): Collecting SessionDevice data for session ID 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:04.823: D/CrashlyticsCore(14173): Removing session part files for ID 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:04.825: D/CrashlyticsCore(14173): Opening a new session with ID 594D1EE40339-0002-375D-A05B7D726EF3
06-23 17:00:04.835: D/CrashlyticsCore(14173): Crashlytics completed exception processing. Invoking default exception handler.
06-23 17:00:04.836: D/CrashlyticsCore(14173): Attempting to send crash report at time of crash...
06-23 17:00:31.588: I/CrashlyticsCore(14287): Initializing Crashlytics 2.3.17.dev
06-23 17:00:31.593: D/CrashlyticsCore(14287): Installer package name is: app_process /system/bin com.android.commands.pm.Pm install -r /data/local/tmp/space-cute.apk
06-23 17:00:31.642: D/CrashlyticsCore(14287): Found previous crash marker.
06-23 17:00:31.644: D/CrashlyticsCore(14287): Exception handling initialization successful
06-23 17:00:31.656: D/CrashlyticsCore(14287): Opening a new session with ID 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:32.705: D/CrashlyticsCore(14287): Initialization marker file created.
06-23 17:00:32.707: D/CrashlyticsCore(14287): Finalizing previously open sessions.
06-23 17:00:32.711: D/CrashlyticsCore(14287): Closing open sessions.
06-23 17:00:32.711: D/CrashlyticsCore(14287): Closing session: 594D1EE40339-0002-375D-A05B7D726EF3
06-23 17:00:32.711: D/CrashlyticsCore(14287): Collecting session parts for ID 594D1EE40339-0002-375D-A05B7D726EF3
06-23 17:00:32.711: D/CrashlyticsCore(14287): Session 594D1EE40339-0002-375D-A05B7D726EF3 has fatal exception: false
06-23 17:00:32.712: D/CrashlyticsCore(14287): Session 594D1EE40339-0002-375D-A05B7D726EF3 has non-fatal exceptions: false
06-23 17:00:32.712: D/CrashlyticsCore(14287): No events present for session ID 594D1EE40339-0002-375D-A05B7D726EF3
06-23 17:00:32.712: D/CrashlyticsCore(14287): Removing session part files for ID 594D1EE40339-0002-375D-A05B7D726EF3
06-23 17:00:32.713: D/CrashlyticsCore(14287): Closed all previously open sessions
06-23 17:00:32.716: D/CrashlyticsCore(14287): Starting report processing in 1.0 second(s)...
06-23 17:00:32.717: D/CrashlyticsCore(14287): Initialization marker file removed: true
06-23 17:00:33.716: D/CrashlyticsCore(14287): Checking for crash reports...
06-23 17:00:33.718: D/CrashlyticsCore(14287): Found crash report /data/data/org.asmstudio.spacecute/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/594D1EDE003E-0001-375D-A05B7D726EF3.cls
06-23 17:00:33.718: D/CrashlyticsCore(14287): Attempting to send 1 report(s)
06-23 17:00:35.139: D/CrashlyticsCore(14287): Adding single file 594D1EDE003E-0001-375D-A05B7D726EF3.cls to report 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:35.141: D/CrashlyticsCore(14287): Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/org.asmstudio.spacecute/reports
06-23 17:00:35.573: D/CrashlyticsCore(14287): Create report request ID: null
06-23 17:00:35.575: D/CrashlyticsCore(14287): Result was: 202
06-23 17:00:35.575: I/CrashlyticsCore(14287): Crashlytics report upload complete: 594D1EDE003E-0001-375D-A05B7D726EF3
06-23 17:00:35.575: D/CrashlyticsCore(14287): Removing report at /data/data/org.asmstudio.spacecute/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/594D1EDE003E-0001-375D-A05B7D726EF3.cls
06-23 17:00:35.576: D/CrashlyticsCore(14287): Checking for crash reports...
06-23 17:00:35.582: D/CrashlyticsCore(14287): No reports found.
06-23 17:00:37.443: D/CrashlyticsCore(14287): Crashlytics is handling uncaught exception "java.lang.RuntimeException: This is a crash" from thread GLThread 1058
06-23 17:00:37.472: D/CrashlyticsCore(14287): No log data to include with this event.
06-23 17:00:37.628: D/CrashlyticsCore(14287): Closing open sessions.
06-23 17:00:37.628: D/CrashlyticsCore(14287): Closing session: 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.628: D/CrashlyticsCore(14287): Collecting session parts for ID 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.629: D/CrashlyticsCore(14287): Session 594D1EFF0284-0001-37CF-A05B7D726EF3 has fatal exception: true
06-23 17:00:37.630: D/CrashlyticsCore(14287): Session 594D1EFF0284-0001-37CF-A05B7D726EF3 has non-fatal exceptions: false
06-23 17:00:37.631: D/CrashlyticsCore(14287): Collecting SessionStart data for session ID 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.631: D/CrashlyticsCore(14287): Collecting SessionUser data for session ID 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.632: D/CrashlyticsCore(14287): Collecting SessionApp data for session ID 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.633: D/CrashlyticsCore(14287): Collecting SessionOS data for session ID 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.633: D/CrashlyticsCore(14287): Collecting SessionDevice data for session ID 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.634: D/CrashlyticsCore(14287): Removing session part files for ID 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.636: D/CrashlyticsCore(14287): Opening a new session with ID 594D1F05027C-0002-37CF-A05B7D726EF3
06-23 17:00:37.646: D/CrashlyticsCore(14287): Crashlytics completed exception processing. Invoking default exception handler.
06-23 17:00:37.649: D/CrashlyticsCore(14287): Attempting to send crash report at time of crash...
06-23 17:00:37.728: D/CrashlyticsCore(14287): Adding single file 594D1EFF0284-0001-37CF-A05B7D726EF3.cls to report 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:37.737: D/CrashlyticsCore(14287): Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/org.asmstudio.spacecute/reports
06-23 17:00:38.153: D/CrashlyticsCore(14287): Create report request ID: null
06-23 17:00:38.153: D/CrashlyticsCore(14287): Result was: 202
06-23 17:00:38.153: I/CrashlyticsCore(14287): Crashlytics report upload complete: 594D1EFF0284-0001-37CF-A05B7D726EF3
06-23 17:00:38.153: D/CrashlyticsCore(14287): Removing report at /data/data/org.asmstudio.spacecute/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/594D1EFF0284-0001-37CF-A05B7D726EF3.cls

但我在 Fabric 仪表板中找不到应用程序 :-(

4

3 回答 3

0

您没有提及是否已将 Fabric Api 密钥添加到 Android 清单中。

<meta-data android:name="com.crashlytics.ApiKey" android:value="XXXXXX etc"/>
于 2017-06-23T14:29:04.000 回答
0

你能把这个:

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

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

并从您的 build.gradle 中删除以下代码:

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

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1'
                classpath "io.fabric.tools:gradle:1.+"

    }
}

apply plugin: 'com.android.application'

allprojects {
    repositories {
        jcenter()
    mavenCentral()
        maven {
    url 'https://maven.fabric.io/public'
    }

    }
}

apply plugin: "io.fabric"

并给它一些时间在仪表板上注册您的崩溃。因为有一次,我花了 2 个小时才在 dashborad 上注册崩溃。希望能帮助到你。

于 2017-06-23T14:43:32.540 回答
0

我遇到了这个问题,因为我忘记从清单中删除元密钥。一切都已成功上传,但我在仪表板上看不到它。通过删除这个元键,它就像魅力一样。

<meta-data android:name="com.crashlytics.ApiKey" android:value="XXXXXX etc"/>

如果清单中有,请删除上述行

于 2019-10-01T20:53:37.820 回答