首页 > 解决方案 > 如何修复 kotlin 语言中的 PARSE_FAILED_MANIFEST_MALFORMED 错误?

问题描述

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.fikriapp"
    android:versionCode="1"
    android:versionName="1.0">
    
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="FikriApp"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity"/>
        <activity android:name="View.SplashScreen" android:theme="@style/FullScreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

这是我的清单代码,我想将主启动器从 MainActivity 更改为我的 SplashScreen,但是在我更改它之后,由于清单中的错误,我无法调试它。是 Kotlin,不是 java

标签: androidkotlin

解决方案


<activity android:name="View.SplashScreen"

这是个问题。在安装时解码清单的包解析器期望包名是小写的,例如view.SplashScreen. java 类名可以是 UpperCamelCase。

如果您希望包名相对于您的顶级包名com.example.fikriapp,那么还要添加一个.前缀,例如.view.SplashScreen.


推荐阅读