在android studio中写好的apk真机测试时,在自己的手机上无异常,到别人手机上点击软件直接闪退,使用抓日志的工具确定异常如下
尝试了大半天发现了暂时可行的解决办法
在AndroidManifest文件的application标签中加入
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
如下
<application
android:allowBackup="true"
android:icon="@drawable/app_image"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:name=".MyApplication"
android:theme="@style/AppTheme"
>
**<uses-library android:name="org.apache.http.legacy" android:required="false"/>**
</application>
重新打包运行不在闪退。