freshplanet / ANE-Facebook

Air Native Extension (iOS and Android) for the Facebook mobile SDK
Apache License 2.0
221 stars 123 forks source link

Problem running this ANE #249

Open tufik2 opened 7 years ago

tufik2 commented 7 years ago

I am texting this ANE, but don't run in AIR 24/25 - Android

if (Facebook.isSupported) Facebook.instance.init("276277716117762", _initCallback);

_initCallback never execute.....

Do I need to load additional ANES? or extra libraries?? Thank you...

I only load AirFacebook.ane extension, 8MG

<extensions>
    <extensionID>com.freshplanet.ane.AirFacebook</extensionID>
  </extensions>

And have that configuration....

<![CDATA[<manifest>
        <uses-permission android:name="android.permission.INTERNET" />
        <application>
            <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb0000"/>
            <activity android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="MyAppName" />
            <activity android:name="com.freshplanet.ane.AirFacebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
            <provider android:authorities="com.facebook.app.FacebookContentProvider0000" android:name="com.facebook.FacebookContentProvider" android:exported="true"/>
        </application>
</manifest>]]>
RomanBurnIT commented 7 years ago

Hi, same problem here...

my AS3 code (building in Flash CC, AIR 25.0.0.134 for Android):

fbtest.txt

my app XML: fbtest-app.txt

and output in debugger: [SWF] fbtest.swf - 4267 bytes after decompression Facebook.isSupported: true FB INIT START [AirFacebook][AS3] ANE Facebook version: 4.19.0 [AirFacebook][NATIVE] FB application ID from AndroidManifest.xml: no metadata [AirFacebook][NATIVE] Initializing with custom applicationId: 1234567890123456 `

....FB id is replaced, but in code I use the valid one.... I will be glad to contribute some $ for consulting/help ;)

CaptainHug commented 7 years ago

Same problem here.

AIRSDK 25.0.0.134

Seeing exact same results as @RomanBurnIT above. It does seem to be related to the fact that the metaData object is null. Not sure if it's an issue with the ANE or AIRSDK, as I've pulled out the meta data with apktool and everything looks to be in order.

I tried re-compiling and debugging the android code, the callback for sdkInitialize is never called, and you get a bunch of errors in the logs as follows:

AirFacebook: [NATIVE] FB application ID from AndroidManifest.xml: no metadata art : Rejecting re-init on previously-failed class java.lang.Class

Yet there is no actual error for the original cause of the issue.

CaptainHug commented 7 years ago

Same results with AIR 24 and 25, also tried building against FacebookSdk 4.18 and 4.19

CaptainHug commented 7 years ago

Anyone found a workaround / solution to this yet? @tufik2 @RomanBurnIT

xiexueyong commented 7 years ago

A FacebookActivity instance will be created when Facebook sdk init.but at this time a Exception happen .the program will be interrupted.In ANE, no exception will be throw out ,and the ActionScript fill no thing ,so you can not fount what happen in ANE.Usually the exception is beacause loss dependency jar file,such as support.****.jar. unzip the AirFacebook.ane.you will find that in the extension.xml most jar dependency jar files are remove.I do not know why. solution: remove all dependency jar in airFacebook.ane ,rebuild it agin, then add this supportAne.ane in the project .it will be ok:https://github.com/myflashlab/common-dependencies-ANE/tree/master/androidSupport. maybe it will work. I use another way:I develop a Facebook without and dependency jar, then add the support.ane ,the it is ok.

CaptainHug commented 7 years ago

Have updated the Android SDK to 4.23.0 and re-added the platform dependencies in this branch:

https://github.com/CaptainHug/ANE-Facebook

Includes an updated binary.

Fixed the issue for me.

@tufik2 @RomanBurnIT

giaoban commented 7 years ago

Hi @CaptainHug When i use your ane on ios device, it is crash when I logInWithReadPermissions :( i using air sdk 26.0, please check it for me Thanks!

RomanBurnIT commented 7 years ago

hello, just to give some feedback....I gave up with this one and I purchased the one from myflashlabs....works well and I guess the price is worth of spared time...