首页 > 解决方案 > 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

解决方案


当我尝试在 Android API 30 模拟器上运行针对 API30 的应用程序时,我也遇到了这个错误。Clean and rebuid 没有帮助,将目标 API 降级回 29 对我来说不是一个选项,因为我需要测试应用程序的目标 API 30。原来原因是 Android Studio 中启用了 Instant Run 功能。

在这里找到了解决方案。


推荐阅读