【问题标题】:Beta by Crashlytics - Package appears to be corruptedCrashlytics 测试版 - 包似乎已损坏
【发布时间】:2018-02-24 14:45:17
【问题描述】:

我最近为客户开发了一个应用程序,现在必须在 Crashlytics 上共享它以进行测试。 我过去曾多次这样做,但使用此应用程序时出现问题。

当我在 Crashlytics Studio 的插件上上传我的应用程序时,没有错误。电子邮件已正确发送给测试人员。

但在安装结束时,它会显示“软件包似乎已损坏”

这是我第一次看到这个,我不知道该怎么办。

我尝试使用所有此类 APK: - 调试(无符号) - 发布(未签名) - 发布(签名)

这些都不起作用。

这是我的 build.gradle :

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

    dependencies {
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.24.1'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'

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

android {

    compileSdkVersion 26
    buildToolsVersion "26.0.1"

    defaultConfig {
        applicationId "com.xxxxxxx"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 3
        versionName "0.1.3"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        renderscriptSupportModeEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled = true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    /**
     * SUPPORT LIBS
     */
    implementation 'com.android.support:appcompat-v7:26.0.2'
    implementation 'com.android.support:recyclerview-v7:26.0.2'
    implementation 'com.android.support:design:26.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-vector-drawable:26.0.2'

    /**
     * KOTLIN
     */
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    /**
     * UNIT TESTS
     */
    testImplementation 'junit:junit:4.12'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    /**
     * HTTP
     */
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation "com.squareup.retrofit2:converter-gson:2.3.0"
    implementation "com.squareup.retrofit2:adapter-rxjava:2.3.0"
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'

    /**
     * INJECTION LIB
     */
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    /**
     * COMPONENT LIBS
     */
    implementation('com.mikepenz:fastadapter:2.6.3@aar') {
        transitive = true
    }
    implementation 'com.mikepenz:fastadapter-commons:2.6.3@aar'
    implementation 'com.mikepenz:fastadapter-extensions:2.6.3@aar'

    /**
     * IMAGE LOADING/CACHING/EDITING LIBS
     */
    implementation 'com.github.bumptech.glide:glide:4.1.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1'
    implementation 'com.makeramen:roundedimageview:2.3.0'

    /**
     * PLAYERS VIDEO/MUSIC
     */
    implementation 'com.google.android.exoplayer:exoplayer:r2.0.0'
    implementation 'com.dailymotion.dailymotion-sdk-android:sdk:0.1.12'

    /**
     * EVENTBUS
     */
    implementation 'org.greenrobot:eventbus:3.0.0'

    /**
     * Overscroll
     */
    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
    implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.3'

    /**
     * FABRIC/CRASHLYTICS
     */
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true
    }
}

我该如何解决?

【问题讨论】:

  • 您是否尝试将 android:extractNativeLibs="false" 添加到您的清单中?
  • 谢谢你的回答,我刚试了下还是一样的错误...
  • 来自 Fabric 的 Mike。您在尝试安装应用程序时看到的 Logcat 输出是什么?
  • 你好迈克,谢谢你的回答。我刚刚在 Studio 2 而不是 Studio 3 (beta 5) 上重建了我的项目,它可以工作。我将 gradle 文件中的所有“实现”替换为“编译”并删除圆角 ic_launcher。我认为问题不在 Crashlytics 上,但我现在不确定

标签: android android-gradle-plugin crashlytics google-fabric crashlytics-beta


【解决方案1】:

从 Android Studio 3.0 开始,如果我尝试通过用户界面上传 apk,我会遇到完全相同的问题。

现在,您必须使用命令行来上传 apk,正如 documentation 所说的那样。

./gradlew assembleDebug crashlyticsUploadDistributionDebug

我希望这会有所帮助!

【讨论】:

  • 我可以确认这是正确的答案。我不确定为什么从 Build 菜单构建 APK 不允许通过 crashlytics 通过 beta 安装应用程序,但通过 gradle 上传是一种享受!
【解决方案2】:

使用 Build APK(s) 选项而不是 Run!我也建议先清理项目。

【讨论】:

    【解决方案3】:

    我回答了类似的问题here

    对我来说,解决方案是将 gradle 从版本 3.0.0(随 Android Studio 3 引入)降级到 2.3.3(以前的版本)。 我通过替换项目 .gradle 文件中的这一行来做到这一点:

        buildscript {
        repositories {
            ...
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.0'
            ...
        }
    }
    

    与:

        buildscript {
        repositories {
            ...
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.0'
            ...
        }
    }
    

    在 clen 和 build 之后,我能够将我的应用上传到 Beta 版并毫无问题地安装它。

    【讨论】:

      猜你喜欢
      • 2020-03-18
      • 2013-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-10
      • 2016-05-27
      • 2013-07-07
      • 1970-01-01
      相关资源
      最近更新 更多