首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android应用在发布模式下崩溃,无此方法错误

Android应用在发布模式下崩溃,无此方法错误
EN

Stack Overflow用户
提问于 2019-08-18 02:37:04
回答 1查看 432关注 0票数 0

我在实时模式下收到以下错误,应用程序在调试模式下工作正常。当我将应用程序上传到play商店后,应用程序在闪屏后立即开始崩溃。

代码语言:javascript
复制
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)

我已经尝试了其他几个在线解决方案,但都没有帮助,我已经尝试了最小化启用假,因为一些解决方案建议它应该工作,但没有工作,应用程序不断崩溃后,从play商店安装。

下面是我的应用配置:

代码语言:javascript
复制
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'
EN

回答 1

Stack Overflow用户

发布于 2019-08-18 02:51:39

尝试将以下行添加到您的build.gradle:

代码语言:javascript
复制
android {

 useLibrary 'org.apache.http.legacy'

或者,在您的清单中尝试以下内容:

代码语言:javascript
复制
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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57538968

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档