gpt4 book ai didi

java - AndroidManifest.xml 无法正确编译

转载 作者:行者123 更新时间:2023-11-30 08:49:03 25 4
gpt4 key购买 nike

我遇到了 Android Manifest 文件的问题。我在网上关注一个例子,和往常一样,代码中有错误。我已经修复了所有与 Java 相关的错误,但 Android Manifest 文件中有几个我不熟悉的错误。

代码如下:

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

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />

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

<uses-feature android:name="android.hardware.usb.accessory" android:required="false" />
<uses-feature android:name="android.hardware.usb.host" android:required="false" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

<uses-library android:name="com.android.future.usb.accessory" />

<meta-data
android:name="com.dji.sdk.API_KEY"
android:value="" />

<activity
android:name=".\DJIAoaActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:screenOrientation="sensorLandscape" >

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
</activity>

<activity
android:name=".FPVActivity"
android:label="@string/app_name" >
</activity>

</application>

</manifest>

这里是错误:

Error:(18, -1) Android Resource Packaging: [FPVDemo] C:\Users\Jesse\Desktop\Android-FPVDemo-Part1-master\FPVDemo\bin\AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(18, -1) Android Resource Packaging: [FPVDemo] C:\Users\Jesse\Desktop\Android-FPVDemo-Part1-master\FPVDemo\bin\AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
Error:(45, -1) Android Resource Packaging: [FPVDemo] C:\Users\Jesse\Desktop\Android-FPVDemo-Part1-master\FPVDemo\bin\AndroidManifest.xml:45: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(18, -1) Android Resource Packaging: [FPVDemo] C:\Users\Jesse\Desktop\Android-FPVDemo-Part1-master\FPVDemo\bin\AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_launcher').

我认为错误出在 GUI 组件未正确命名的部分,但我可能是错的。我想知道你们是怎么想的。也许我错过了一些简单的东西。

最佳答案

检查您是否创建了strings.xml 文件,其中是否包含app_name 的键值对。或者只是尝试在标签中给出值,例如

android:label="我的应用"

关于java - AndroidManifest.xml 无法正确编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31629287/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com