【问题标题】:Android Signed Apk crashed in below 5.0 VersionsAndroid Signed Apk 在 5.0 以下版本中崩溃
【发布时间】:2018-08-17 10:36:18
【问题描述】:

我创建了一个签名的 APK 并上传了它,它在所有低于棉花糖的版本中崩溃。签名的 APK 适用于 5.0 以上版本的 Android,但不适用于

当我通常在 android 5.0 中运行相同的项目时,它可以完美运行,但签名的 apk 无法在 5.0 中运行。

而且它也没有生成崩溃报告。

在我声明的 AndroidManifest.xml 中:

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
    applicationId "com.ahgp"
    minSdkVersion 21
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    // Enabling multidex support.
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}


buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
sourceSets { main { java.srcDirs = ['src/main/java', 'src/main/assets/fonts'] } }

}

allprojects {
    repositories {
        maven {
            url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
        }
    }
}



repositories {
    mavenCentral()
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
}


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.paypal.sdk:paypal-android-sdk:2.15.3') {
        exclude group: 'io.card'
    }
    compile files('libs/twitter4j-core-4.0.3.jar')
    // compile 'com.jakewharton:butterknife-compiler:8.6.0'
    compile 'com.squareup.picasso:picasso:2.3.2'
    compile 'com.jakewharton:butterknife:8.6.0'

compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'org.glassfish.main:javax.annotation:4.0-b33'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:support-v4:26.0.2'
compile 'com.facebook.android:facebook-android-sdk:(4,5)'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.journeyapps:zxing-android-embedded:3.5.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
/* compile 'com.google.android.gms:play-services:10+'
 compile 'com.google.android.gms:play-services-location:10+'
 compile 'com.google.android.gms:play-services-maps:10+'
 compile 'com.google.android.gms:play-services-places:10+'*/
compile 'com.quickblox:quickblox-android-sdk-videochat-webrtc:3.3.1'

compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'

implementation 'com.android.support:multidex:1.0.3'

//noinspection GradleCompatible


 /*  compile 'com.google.firebase:firebase-messaging:9.8.0'
    compile 'com.google.firebase:firebase-core:9.8.0'*/
// glide
compile 'com.github.bumptech.glide:glide:3.7.0'

// acra crash report
compile 'ch.acra:acra:4.6.2'
}
apply plugin: 'com.google.gms.google-services'

【问题讨论】:

  • 任何 logcat 错误?
  • 不,即使它没有生成崩溃报告。
  • 请在您的项目中实现 crashlytics :)
  • 也在此处发布完整的 gradle 文件,实现了 facebook 吗?
  • 我已经实现了 crashlytics,但是当它在启动时崩溃时它没有生成崩溃报告

标签: android android-studio crash apk


【解决方案1】:

在您的构建 gradle 文件中,最低操作系统为 21,因此您的应用将不支持低于 21。

【讨论】:

  • 但是当我直接在同一部手机上运行时,它工作正常
  • 请检查您的设备实际上是哪个操作系统。不可能啊老哥:)
  • @Sameer ji。普通的 apk 可以正常运行,没有任何问题,但是当我在同一部手机上运行签名的 apk 时,它会崩溃。手机安卓版本是棒棒糖5.0
  • 那么你可能会问错问题,因为@SameerJani 你不能在 21 以下的版本上运行它
猜你喜欢
  • 2023-03-18
  • 1970-01-01
  • 2019-07-05
  • 1970-01-01
  • 2015-09-10
  • 1970-01-01
  • 1970-01-01
  • 2016-02-09
相关资源
最近更新 更多