【问题标题】:AndroidManifest.xml file errorAndroidManifest.xml 文件错误
【发布时间】:2018-01-12 03:16:45
【问题描述】:

我正在尝试使用 Android Studio 为我的应用程序“ChristmasTree”生成 apk。我遇到了 AndroidManifest 文件的问题。

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.christmastree"
android:versionCode="1"
android:versionName="1.0">

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

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

<application
  android:name=".MainApplication"
  android:allowBackup="true"
  android:label="@string/ChristmasTree"
  android:icon="@drawable/ic_launcher"
  android:theme="@style/AppTheme">
  <activity
    android:name=".MainActivity"
    android:label="@string/ChristmasTree"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    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>

我收到了这个错误:

【问题讨论】:

    标签: android xml android-studio android-manifest


    【解决方案1】:

    在你的 string.xml 文件中的 resource->values-->Strings.xml 文件夹中添加这一行。

        <string name="ChristmasTree">ChristmasTree</string>
    

    并添加资源-->为您的应用添加可绘制文件夹和图标并为其命名

    ic_launcher.

    并添加资源--> 值--> Style.xml 文件

     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
    

    【讨论】:

    • 我进行了更改,但仍然遇到同样的问题
    • 抱歉我的代码在这行 android:icon="@mipmap/ic_launcher" 有错误。那么我应该在哪里做出改变呢?
    • 为您的应用添加一个可绘制文件夹并写入 android:icon="@drawable/your_logo_name"
    • 然后在资源文件夹中添加一个mipmap文件夹并添加你的logo
    • 然后尝试:1. 清理你的项目 2. 重建你的项目,它会工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-01
    • 1970-01-01
    • 2021-05-16
    • 1970-01-01
    • 1970-01-01
    • 2010-11-04
    • 1970-01-01
    相关资源
    最近更新 更多