无法获得提供者com.facebook.NativeAppCallContentProvider

时间:2015-02-10 18:51:17

标签: cocos2d-x

在使用cocos2dx-v3.3在Android上集成Facebook时,我陷入困境。

首先,我遵循了本教程:http://www.cocos2d-x.org/wiki/Facebook_integration_instruction_for_Cocos2d-x_and_Cocos2d-x-Lua_on_android 但它没有用。之后我尝试了这个:http://discuss.cocos2d-x.org/t/facebook-plugin-x-problems-android-eclipse-cocos2d-x-3-3rc1-please-help/18914/17 - 按照Arie的步骤。但我仍然有错误:

02-10 22:00:10.848: E/Trace(16113): error opening trace file: No such file or directory (2)
02-10 22:00:10.878: E/AndroidRuntime(16113): FATAL EXCEPTION: main
02-10 22:00:10.878: E/AndroidRuntime(16113): java.lang.RuntimeException: Unable to get provider com.facebook.NativeAppCallContentProvider: java.lang.ClassNotFoundException: com.facebook.NativeAppCallContentProvider
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.app.ActivityThread.installProvider(ActivityThread.java:4646)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4273)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4215)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.app.ActivityThread.access$1300(ActivityThread.java:138)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.os.Handler.dispatchMessage(Handler.java:99)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.os.Looper.loop(Looper.java:137)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.app.ActivityThread.main(ActivityThread.java:4845)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at java.lang.reflect.Method.invokeNative(Native Method)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at java.lang.reflect.Method.invoke(Method.java:511)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at dalvik.system.NativeStart.main(Native Method)
02-10 22:00:10.878: E/AndroidRuntime(16113): Caused by: java.lang.ClassNotFoundException: com.facebook.NativeAppCallContentProvider
02-10 22:00:10.878: E/AndroidRuntime(16113):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-10 22:00:10.878: E/AndroidRuntime(16113):    at android.app.ActivityThread.installProvider(ActivityThread.java:4631)
02-10 22:00:10.878: E/AndroidRuntime(16113):    ... 12 more

我的AndroidManifest.xml:

<?xml version='1.0' encoding='UTF-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="mypackage" android:installLocation="auto" android:versionCode="1" android:versionName="1.0">

    <uses-sdk android:minSdkVersion="9" />
    <uses-feature android:glEsVersion="0x00020000" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">


        <meta-data android:name="android.app.lib_name" android:value="cocos2dcpp" />

    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id" />

    <activity android:name="com.facebook.LoginActivity" />
    <provider android:authorities="com.facebook.app.NativeAppCallContentProvider1036705886358393" android:exported="true" android:name="com.facebook.NativeAppCallContentProvider" />

        <activity android:configChanges="orientation" android:label="@string/app_name" android:name="org.cocos2dx.cpp.AppActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    <activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.facebook.ads.InterstitialAdActivity" />
    </application>

    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />

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

</manifest>

希望有人看到&amp;给我答案。


我修好了,请你阅读。

1 个答案:

答案 0 :(得分:0)

在我的情况下,如果我不在清单中写这行,则错误消失。

<provider android:authorities="com.facebook.app.NativeAppCallContentProvider1036705886358393" android:exported="true" android:name="com.facebook.NativeAppCallContentProvider" />

但我不知道它是否会产生一些不良影响。因为,它不是用螺丝主样本应用程序编写的,也不是在许多其他地方编写的。