我目前正在移植一个应用程序以在 Android 上运行(大约完成 70%),我需要集成 Facebook 登录。我有所有的应用程序 ID 和代理设置。唯一剩下的就是 /platform/android/res/values/strings.xml 下 Android 需要的 strings.xml 文件 但是,我尝试将此目录放在项目的根目录以及“资源”下,但它仍然会引发错误:
.../build/android/AndroidManifest.xml:19: 错误:错误:找不到与给定名称匹配的资源(在“值”处,值为“@string/1498915623760005”)
在 strings.xml 文件中,我有以下内容:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Updateme</string>
<string name="facebook_app_id">1498915623760005</string>
</resources>
在 tiapp.xml 中是:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application>
<activity android:label="@string/app_name"
android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/1498915623760005"/>
</application>
</manifest>
</android>
我的问题是,相对于项目的 Resources 目录,这个文件应该放在哪里?还是我完全错过了什么?
最佳答案
在您的 tiapp.xml
中将 android:value="@string/1498915623760005"/>
替换为 android:value="@string/facebook_app_id"/>
关于android - 无法让 Appcelerator Titanium 项目在 Android 上读取用于 Facebook 模块集成的 strings.xml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34688126/