android - 无法让 Appcelerator Titanium 项目在 Android 上读取用于 Facebook 模块集成的 strings.xml 文件

标签 android appcelerator titanium-mobile

我目前正在移植一个应用程序以在 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/

相关文章:

java - Android 中的选项卡布局和按钮

android - 如何让右侧子元素在水平布局的左侧子元素旁边流动

java - TimePicker显示不同时间

ios - Ti.Media.queryMusicLibrary 在新更新后崩溃应用程序?

android - 窗口打开时出错

android - 无法在 Android 中垂直拖动 View

titanium - 在 Titanium Appcelerator 的移动浏览器中打开 webview 内的 URL 链接

android - 无法在 Android 中发送辅助功能事件

android - 如何获得触摸点(顶部和左侧)而不考虑 Titanium 中的 View 和窗口

android - 钛 : android options all button events trigger at once