【发布时间】:2019-10-30 17:08:55
【问题描述】:
在完成github page、facebook getting started page 和quick start for android page 中提供的所有必要配置步骤之后,我已经初始化了一个新的 android 项目并在我的项目上安装了 react-native-fbsdk 我无法运行我的项目,即使不编写任何代码。 (我尝试过修改前两个 build.gradle 步骤和不修改)
这是我收到的错误消息:
> Task :react-native-fbsdk:generateDebugRFile FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-fbsdk:generateDebugRFile'.
> Illegal char <?> at index 7: ..\..\l?brary_man?fest\debug\AndroidManifest.xml
* 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
Deprecated Gradle features were used in this build, making it incompatible with
Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:comm
and_line_warnings
BU?LD FAILED in 3s
10 actionable tasks: 2 executed, 8 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag
for more details.
这是我迄今为止尝试过的:
cd android
gradlew build --warning-mode all
给我一个类似于上一条的错误信息,唯一的区别是有这一行
Changing the value for a property with a final value has been deprecated. This will fail with an error in Gradle 6.0.
我无法找到研究此问题的解决方案。
然后我尝试查看 D:\kitapapp\node_modules\react-native-fbsdk\android\build\intermediates\lıbrary_manıfest\debug 中的 android 清单,但我也无能为力。我突然想到,它可能与名称中包含“ı”而不是“i”的“lıbrary_manıfest”文件夹有关,但在与“lıbrary_manıfest”相同的文件夹中还有其他文件也有“ı”他们的名字。我认为无论如何我都无法修改 react-native-fbsdk,因为我应该使用它们? (但也许我错了?)
我还尝试在我的 package.json 中降级 react-native-fbsdk 并再次删除 node_modules 和 npm 安装,给了我相同的错误消息。
编辑:AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kitapapp">
<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">
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<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>
strings.xml(我在这里放了“id”而不是这篇文章的真实 id。实际上那里有我的实际应用程序 id)
<resources>
<string name="app_name">kitapapp</string>
<string name="facebook_app_id">id</string>
</resources>
【问题讨论】:
-
请上传您的 AndroidManifest.xml 数据
-
@GáüřãvJõşhï 我现在添加了它
-
@GáüřãvJõşhï 是否应该将我的实际应用程序 ID 放在清单中?我的想法是,因为已经有像'android:label'这样的东西有值“@string/app_name”而不是实际的应用程序名称,所以我不应该输入我的实际ID。我链接的安装/配置指南都没有特别提到这样的事情?
-
转到/android/app/src/main/res/values/strings.xml并上传xml中的数据
-
@GáüřãvJõşhï 好的,我已经做到了,但我没有在帖子中输入我的实际 ID。
标签: visual-studio react-native build react-native-fbsdk illegal-characters