gpt4 book ai didi

java - react-native .58.1 无法构建 Android 版本

转载 作者:行者123 更新时间:2023-11-30 12:04:13 24 4
gpt4 key购买 nike

我想构建 Android 版本,但无论我尝试什么,我总是遇到同样的错误。

这是错误输出

/app/build/generated/assets/react/release/index.android.bundle
bundle: Done writing bundle output
bundle: Copying 9 asset files
bundle: Done copying assets

> Task :app:bundleReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: /Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:19: error: resource mipmap/ic_launcher (aka com.characters:mipmap/ic_launcher) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:19: error: resource string/app_name (aka com.characters:string/app_name) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:19: error: resource mipmap/ic_launcher (aka com.characters:mipmap/ic_launcher) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:19: error: resource style/AppTheme (aka com.characters:style/AppTheme) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:27: error: resource string/app_name (aka com.characters:string/app_name) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:54: error: resource xml/provider_paths (aka com.characters:xml/provider_paths) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:59: error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.characters:style/Theme.AppCompat.Light.NoActionBar) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:67: error: resource integer/google_play_services_version (aka com.characters:integer/google_play_services_version) not found.
error: failed processing manifest.

Command: /Users/abdul-elah/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/5141019c42220d362e7004555d4c86c4/aapt2-3.2.1-4818971-osx/aapt2 link --proto-format\
-I\
/usr/local/share/android-sdk/platforms/android-28/android.jar\
--manifest\
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml\
-o\
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/linked_res_for_bundle/release/bundleReleaseResources/bundled-res.ap_\
--auto-add-overlay\
-0\
apk\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 35s
46 actionable tasks: 3 executed, 43 up-to-date

这是我的 manifest.xml

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

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

<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
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>

我尝试编辑 compilesdkversion 和 react-native-device-info;我尝试了几种解决方案,该应用程序在 Debug模式下运行良好,但当我尝试运行 ./gradlew bundleRelease

时却没有

最佳答案

我不熟悉 Android 问题,但在我的案例中,./gradlew assembleRelease 代替了 ./gradlew bundleRelease

关于java - react-native .58.1 无法构建 Android 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57234624/

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