簡體   English   中英

Android應用在發布模式下崩潰,沒有此類方法錯誤

[英]Android app crashing in release mode, no such method error

我在實時模式下收到以下錯誤,該應用在調試模式下工作正常。 當我將應用上傳到Play商店時,此應用在啟動屏幕后立即開始崩潰。

java.lang.NoSuchMethodError: No virtual method a(Ljava/io/InputStream;)V in class Lorg/apache/http/entity/BasicHttpEntity; or its super classes (declaration of 'org.apache.http.entity.BasicHttpEntity' appears in /system/framework/org.apache.http.legacy.boot.jar)
    at com.android.volley.toolbox.HurlStack.a(SourceFile:4)
    at com.android.volley.toolbox.HurlStack.performRequest(SourceFile:18)
    at com.android.volley.toolbox.BasicNetwork.performRequest(SourceFile:5)
    at com.android.volley.NetworkDispatcher.run(SourceFile:8)

我嘗試了其他幾種在線解決方案,但都無濟於事,因為一些解決方案表明它應該可以工作,但沒有作用,因此我嘗試了minable enabled false,但是從Play商店安裝后,該應用始終崩潰。

這是我的應用程序配置:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId ""
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 9
        versionName "1.0"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            debuggable true
//            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    dexOptions {
        javaMaxHeapSize "2048M"
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.1.0-alpha05'
    implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0-alpha01'
    implementation 'androidx.browser:browser:1.0.0'
    implementation 'androidx.exifinterface:exifinterface:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4'
    implementation 'com.intuit.sdp:sdp-android:1.0.5'
    implementation 'com.facebook.android:facebook-android-sdk:4.29.0'
    implementation 'com.github.rtoshiro.fullscreenvideoview:fullscreenvideoview:1.1.2'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
    implementation 'com.squareup.okhttp3:okhttp:3.12.1'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.airbnb.android:lottie:2.8.0'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
  //  implementation 'net.gotev:uploadservice:2.1'
    implementation 'com.razorpay:checkout:1.5.5'
    implementation 'com.shuhart.stepview:stepview:1.4.0'
   /* implementation('com.github.ganfra:material-spinner:2.0.0') {
        exclude group: 'com.android.support', module: 'appcompat-v7'
    }*/
    implementation 'com.klinkerapps:android-chips:1.3.0@aar'
    implementation 'com.github.yalantis:ucrop:2.2.2'
    implementation 'com.yahoo.mobile.client.android.util.rangeseekbar:rangeseekbar-library:0.1.0'
    implementation 'com.beloo.widget:ChipsLayoutManager:0.3.7@aar'
    implementation 'com.google.firebase:firebase-auth:16.2.1'
    implementation 'com.google.firebase:firebase-core:16.0.8'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
    implementation 'com.google.firebase:firebase-messaging:17.6.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-places:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    implementation 'com.hlab.fabrevealmenu:fab-reveal-menu:1.0.3'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
    implementation 'com.inscripts:CometChat:7.33.0'
    implementation project(':CometChatUiSDK')
//    implementation 'com.android.volley:volley:1.1.1'

    implementation 'com.github.lecho:hellocharts-library:1.5.8@aar'

}

repositories {
    mavenCentral()
    maven { url "https://maven.google.com" }
    maven { url "https://jitpack.io" }

}


apply plugin: 'com.google.gms.google-services'

嘗試將以下行添加到您的build.gradle中:

android {

 useLibrary 'org.apache.http.legacy'

或者,在清單中嘗試以下操作:

uses-library android:name="org.apache.http.legacy" android:required="false" />

其原因是由於以下事實:從android 9起,該庫已從bootclasspath中刪除,並且默認情況下不適用於應用程序,因此必須添加該庫。

參見: https : //developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM