首页 > 解决方案 > Android Studio 4.0.1、Gradle 和 React Native:AndroidManifest.XML 存在时未找到

问题描述

介绍

大家好!

根据文档,我的 Android Studio 4.0.1 项目拒绝构建,因为无法在 /main/ 中找到应该在的位置的 AndroidManifest.xml 文件。用“实现”大规模替换“api”的出现或反之亦然没有帮助。

因此,您还需要哪些其他信息来澄清,以及应该进行哪些更改以确保其有效?

谢谢!

清单文件

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.hornet">

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

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

激活调试模式时出现运行错误

因为这篇文章太长了,所以移到了这个谷歌文档!

https://docs.google.com/document/d/19OO-OIzFy6IXPEOAdvGZLgXNsW_1sfiZsLDs6H0Jjzs/edit?usp=sharing

标签: androidreact-nativeandroid-studiogradle

解决方案


尝试重建项目或修改项目结构。当出现问题时会发生


推荐阅读