我的Ionic5+电容器构建在android上失败,错误如下。如果我在谷歌上搜索,我会发现与fb_app
设置相关的类似错误。我认为android项目配置错误。是下面配置中的这一行吗:
android:label="@string/activity_name"
我应该寻找什么来调试它?
android/capacitor-cordova-android-plugins/build/intermediates/library_manifest/debug/AndroidManifest.xml:50:9-56:58: AAPT: error: resource string/activity_name (aka APP_NAME:string/activity_name) not found.
以下是命名文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:amazon="http://schemas.amazon.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
package="capacitor.android.plugins"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="29" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application>
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="$ANALYTICS_COLLECTION_ENABLED" />
<meta-data
android:name="google_analytics_automatic_screen_reporting_enabled"
android:value="$AUTOMATIC_SCREEN_REPORTING_ENABLED" />
<receiver
android:name="nl.xservices.plugins.ShareChooserPendingIntent"
android:enabled="true" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
</intent-filter>
</receiver>
<provider
android:name="nl.xservices.plugins.FileProvider"
android:authorities="${applicationId}.sharing.provider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/sharing_paths" />
</provider>
<activity
android:name="com.keyes.youtube.OpenYouTubePlayerActivity"
android:screenOrientation="landscape" />
<activity
android:name="com.bunkerpalace.cordova.YouTubeActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:label="@string/activity_name"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustResize" />
</application>
</manifest>
所有功能都适用于iOS btw.
在android/cacitor cordova android-plugins/src/main/AndroidManifest.xml中,用您的任意名称替换@string/activity_name
假设您使用的是电容器。
转到res/values/strings.xml只需添加以下内容:your_name