Facebook SDK for Unity 5.0.2 Beta doesn't work on Android Device
Asked Answered
B

1

1

Unity: 4.3.1 Device:Samsung I9300 Facebook SDK for Unity: 5.0.2 Beta

When I use Facebook SDK for Unity 4.3.6, this works well.

When I use 5.0.2 Beta, it does not work. When I run FB.Init on device, it shows

The Facebook Dll : not Loaded

Facebook settings are the same as in 4.3.6, but I changed the Class Name com.facebook.unity.FBUnityPlayerActivity to com.facebook.unity.FBUnityDeepLinkingActivity in the facebook.com. But this doesn't work either.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:theme="@android:style/Theme.NoTitleBar" android:versionCode="1" android:versionName="1.0">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    </activity>
    <activity android:name="com.facebook.unity.FBUnityLoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
    </activity>
    <activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
    </activity>
    <activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
    </activity>
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 487550674688377" />
  </application>
</manifest>
Beguile answered 22/1, 2014 at 8:20 Comment(7)
Did you also go to "Facebook->Edit Settings" then click "Regenerate Android Manifest"? There has been some changes to how we handle the SDK for Unity when it exports to Android. The biggest change is that it'll no longer require FBUnityPlayerActivity to be the main class. It'll require a one time migration to generate the new fields in your AndroidManifest.xml which can be accomplished with the regenerate button.Ashti
I know these changes in this new version,I had tried done as your said,but it doesn't work.It can't load the facebook Dll when FB.Init() on the Android device.But it work well in the Unity editor.So I don't know Why.Beguile
Without more details, I'm gonna be shooting in the dark here: -was the Plugins folder imported with the rest of the package? You could try first deleting Plugins/Android/facebook folder then reimporting. Could I also see what your AndroidManifest.xml currently looks like?Ashti
My AndroidManifest add to my question.I don't change anything,just import facebook sdk to a new project.Facebook settings is ok in the facebook sdk for unity 4.3.6.But fail in 5.0.2 Beta.Beguile
As it turns out, 5.0.2 did not build correctly for Android. Please download 5.0.3 that we just released: developers.facebook.com/docs/unity/downloadsAshti
@BrianJew Since this is an active thread, so I might want to ask a query here. Is it working with the chartboost plugin? If yes, then which activity do we have to enter in the facebook dev dashboard.Hypophyge
@user1683989, com.facebook.unity.FBUnityDeepLinkingActivity should go in the settings in developers.facebook.com. You can use the chartboost plugin's main activity.Ashti
C
3

Assets/Plugins/Android/Facebook is missing the bin folder in this release. I don't think there is any Android binary included. Could try building it in Eclipse from the source code.

Chandless answered 23/1, 2014 at 10:44 Comment(1)
Thanks for pointing that out. We fixed this in 5.0.3: developers.facebook.com/docs/unity/downloadsAshti

© 2022 - 2024 — McMap. All rights reserved.