【发布时间】:2022-02-16 17:24:14
【问题描述】:
新的应用发布格式 Android App Bundle 是一种改进的应用打包方式。 Android App Bundle 让您可以更轻松地以更小的应用程序提供出色的体验,从而支持当今可用的各种 Android 设备。您无需重构代码即可开始从较小的应用程序中受益。
我在尝试构建我的应用 Android Bundle 时遇到此错误:
文件 'root/AndroidManifest.xml' 使用保留的文件或目录名称 'AndroidManifest.xml'。
APK 生成工作正常。
这是我的项目文件结构:
这是我的 AndroidManifest.xml,位于 {ProjectName}/app/src/main 下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.XXXX.XXXX"
android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!-- These permissions are strongly recommended and will result in higher performance -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name="com.app.webview.Application"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true">
<activity
android:name="com.app.webview.MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Universal APP Link -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="@string/app_host" />
</intent-filter>
</activity>
<!-- Push -->
<!-- Services that handles incoming message -->
<service
android:name="com.app.webview.Providers.FCM.FcmListenerService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- Called if InstanceID token is updated -->
<!-- This may occur if the security of the previous token had been compromised -->
<service
android:name="com.app.webview.Providers.FCM.FcmInstanceIDListenerService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<!-- Facebook Config -->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/id_facebook" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
tools:replace="android:theme" />
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="@string/facebook_provider"
android:exported="true"
tools:replace="android:authorities" />
<!-- Fabric -->
<meta-data
android:name="io.fabric.ApiKey"
android:value="XXXX" />
</application>
</manifest>
【问题讨论】:
-
如果那是您的实际清单,为什么它在子目录下?
-
它位于 modulefolder/src/main/AndroidManifest.xml 下
-
你是如何添加这个模块的?您只是将文件夹复制到当前源中吗?
-
不,我正在等待 Google 方面的修复并使用 APK
-
这里有同样的问题。 APK 正在构建,但不是 Bundle。