无法打开 Facebook 登录屏幕
Unable to open Facebook login screen
我正在尝试为 Android 中的应用程序创建 Facebook 登录(iPhone 工作正常)。
这是我的 tiapp.xml
(按照此处的说明:http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook):
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<application android:theme="@style/Light">
<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/facebook_app_id"/>
</application>
</manifest>
</android>
我还根据需要添加了 strings.xml
资源。但是当我尝试调用 authorize()
函数时,出现以下错误:
Ucaught Error: Log in attempt failed: FacebookActivity could not be started. Please make sure you added FacebookActivity to the AndroidManifest.
这里缺少什么?
替换
<activity android:label="@string/app_name" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
和
<activity android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="YourAppName" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
重要的是在这里用 com.facebook.FacebookActivity
activity 替换 com.facebook.LoginActivity
,Facebook 在几个版本前更改了它。有关详细信息,请查看 ti.facebook 存储库。
我正在尝试为 Android 中的应用程序创建 Facebook 登录(iPhone 工作正常)。
这是我的 tiapp.xml
(按照此处的说明:http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook):
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<application android:theme="@style/Light">
<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/facebook_app_id"/>
</application>
</manifest>
</android>
我还根据需要添加了 strings.xml
资源。但是当我尝试调用 authorize()
函数时,出现以下错误:
Ucaught Error: Log in attempt failed: FacebookActivity could not be started. Please make sure you added FacebookActivity to the AndroidManifest.
这里缺少什么?
替换
<activity android:label="@string/app_name" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
和
<activity android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="YourAppName" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
重要的是在这里用 com.facebook.FacebookActivity
activity 替换 com.facebook.LoginActivity
,Facebook 在几个版本前更改了它。有关详细信息,请查看 ti.facebook 存储库。