1、在虚拟机上我使用的是Android5.0版本,当前manifests的application标签配置如下,正确运行没问题。
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="qsj_weather_task_6"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
2、但是放到真机上(Android 9)就会闪退,于是在application标签里面添加一行代码:android:usesCleartextTraffic=“true”。就可以正确运行了。
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="qsj_weather_task_6"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">