当我将设备插入计算机时,我的应用程序在 Android 4、5 和 6 上运行良好。但是当我从 app/build/outputs/apk 目录获取 .apk 文件并直接安装它时,应用程序在 Android 4 上启动时崩溃。仅适用于 Android 4。为什么?以及如何解决?
这是我的 list 文件:
<manifest package="ru.pussy_penetrator.chgk"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".QuestionGridActivity"/>
<activity
android:name=".QuestionPagerActivity"/>
</application>
最佳答案
禁用即时运行并构建 APK。 Instant Run 使用设备缓存来热交换您在项目中所做的更改。它还优化代码以在您的测试设备拥有的平台上运行。
您还可以生成签名 apk 以分发到所有支持的 Android 版本
关于android - Apk 安装但不会仅在 Android 4 上启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40113667/