android - Android INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION while starting the app
问题描述
I'm new to android development and this is my first try out. when try to run the template project created by android studio I'm seeing below error.
Failed to finalize session : INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed parse during installPackageLI: Failed to read manifest from /data/app/vmdl2093545946.tmp/split_lib_slice_9_apk.apk: null
below is the AndroidManifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.customtab">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
and here is the activity_main.xml file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello Android !"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
wondering what I'm missing here.
解决方案
当我尝试在 Android API 30 模拟器上运行针对 API30 的应用程序时,我也遇到了这个错误。Clean and rebuid 没有帮助,将目标 API 降级回 29 对我来说不是一个选项,因为我需要测试应用程序的目标 API 30。原来原因是 Android Studio 中启用了 Instant Run 功能。
在这里找到了解决方案。
推荐阅读
- ios - Objective C - 使用 AES256 GCM 加密
- angular - 错误 TS2322:类型“未定义”不可分配给类型“字符串”
- openssl - 使用 pyOpenSSL 创建 asn1parse 、 crl 和获取 pem
- django - 如何在 django 中插入多个外键值?
- reactjs - 为什么这个解构属性不起作用
- mysql - 我可以用什么方式替换 MySQL 中的 INTERSECT?
- java - 如何在 JAXB 集合解组中使用 setter
- c# - Visual Studio 自定义工具箱项集合值
- ruby-on-rails - 从 twilio ruby 中的调用中获取转录
- c# - 我在这里有一个多按钮事件处理程序但是如果单击它,我只需要定位一个按钮我该怎么做?