android - 标记 <manifest> 属性包具有无效字符 ' ' Android Manifest

标签 android android-manifest

我收到错误消息“标记属性包具有无效字符‘’。”在 Android Manifest 中,虽然没有明显的无效字符。这是代码:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.exampl e.harounsmida.test2"
        android:versionCode="1"
        android:versionName="1.0" >

        <uses-sdk
            android:minSdkVersion="15"
            android:targetSdkVersion="22" />

        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

        <application
            android:name="com.example.harounsmida.test2.app.AppController"
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name="com.example.harounsmida.test2.LoginActivity"
                android:label="@string/app_name"
                android:launchMode="singleTop"
                android:windowSoftInputMode="adjustPan" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name="com.example.harounsmida.test2.RegisterActivity"
                android:label="@string/app_name"
                android:launchMode="singleTop"
                android:windowSoftInputMode="adjustPan" />
            <activity
                android:name="com.example.harounsmida.test2.MainActivity"
                android:label="@string/app_name"
                android:launchMode="singleTop" />
            <activity
                android:name="com.example.harounsmida.test2.UploadToServerActivity"
                android:label="@string/app_name"
                android:launchMode="singleTop" />
        </application>

    </manifest>

我不明白问题出在哪里,Android Studio 说“构建文件夹下的文件已生成,不应编辑。”虽然我没有编辑它。

最佳答案

从包名中删除空格:

package="com.exampl e.harounsmida.test2"

删除空格后:

package="com.example.harounsmida.test2"

关于android - 标记 <manifest> 属性包具有无效字符 ' ' Android Manifest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31850561/

相关文章:

android - token 在 Firebase 中始终为空

android - findViewById() 使用模拟器抛出异常,但不适用于设备

android - 如何添加应用程序小部件提供程序类

android - java中的广告xmlns属性

android - Android 应用程序中可变数量配置文件的动态首选项

Java android - ImageView滚动导致崩溃?

android - GetFile Cordova 3.4.0 err.code 1000

android - 如何从服务器缓存音频、视频和图像并保存在内存中?

来自联系人/电话簿的 Android Sip 应用程序调用

Android intent-filter pathPattern 数字匹配