facebook / facebook-sdk-for-unity

The facebook sdk for unity.
https://developers.facebook.com/docs/unity
Other
492 stars 257 forks source link

v7.18 Crash app On Android 6.0.1 #347

Open sonjoono opened 5 years ago

sonjoono commented 5 years ago

anyone fixed this?


D/AndroidRuntime: Shutting down VM
E/com.facebook.appevents.codeless.ViewIndexer: UI Component tree indexing failure!
    java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
        at android.os.Handler.<init>(Handler.java:200)
        at android.os.Handler.<init>(Handler.java:114)
        at com.android.internal.policy.multiwindow.MinimizeAnimator$2.<init>(MinimizeAnimator.java:140)
        at com.android.internal.policy.multiwindow.MinimizeAnimator.<init>(MinimizeAnimator.java:140)
        at com.android.internal.policy.MultiPhoneWindow.generatePenWindowLayout(MultiPhoneWindow.java:1192)
        at com.android.internal.policy.MultiPhoneWindow.generateLayout(MultiPhoneWindow.java:1161)
        at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:4683)
        at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2263)
        at com.facebook.appevents.codeless.ViewIndexer$1.run(ViewIndexer.java:94)
        at java.util.Timer$TimerImpl.run(Timer.java:284)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=MessagingUnityPlayerActivity, ga_previous_id(_pi)=5639538366480461061, ga_screen_class(_sc)=FBUnityLoginActivity, ga_screen_id(_si)=5639538366480461066}]

D/FA: Logging event (FE): _ae, Bundle[{ga_event_origin(_o)=clx, _r=1, ga_screen_class(_sc)=FBUnityLoginActivity, ga_screen_id(_si)=5639538366480461066, timestamp=1573017141917, fatal=1}]

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.xxx.xxxxxx, PID: 954
    java.lang.Error: FATAL EXCEPTION [main]
    Unity version     : 2018.3.4f1
    Device model      : samsung SM-G930L
    Device fingerprint: samsung/heroltelgt/heroltelgt:6.0.1/MMB29K/G930LKLU1APF5:user/release-keys

    Caused by: java.lang.RuntimeException: Window couldn't find content container view
        at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:4614)
        at com.android.internal.policy.MultiPhoneWindow.generateLayout(MultiPhoneWindow.java:1140)
        at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:4683)
        at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2263)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4276)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3361)
        at android.app.ActivityThread.access$1100(ActivityThread.java:222)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:158)
        at android.app.ActivityThread.main(ActivityThread.java:7229)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
smfltn commented 5 years ago

same issue https://github.com/facebook/facebook-sdk-for-unity/issues/345#issue-515220019 You should not call FB.ActivateApp ()

sonjoono commented 5 years ago

I tried your solution but I still got the same problem @smfltn

sonjoono commented 5 years ago

I think, sometimes API(apprequest, login, feedshare, ..) is called twice so, called of second window couldn't find content container view and it crashed

I tried to IL2CPP build of arm64 only (it has not contained armeabi-v7a lib in apk) but still I get crashed android app Therefore this issue is not unity build problem

sonjoono commented 5 years ago

add crash log

11-08 13:57:06.328 13508-13618/? E/chromium: [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw .. .. until app has crashed

zenith-jacob commented 5 years ago

Same here, I have reported it long time ago. https://github.com/facebook/facebook-sdk-for-unity/issues/245

Just out of curiosity, do you use Proguard?

sonjoono commented 5 years ago

no, i don't use proguard and i have tested it using proguard but i see same problem

MohHeader commented 4 years ago

Just a question, ( raised due to this issue ) What SDK version should we use for live apps?

i.e. the most reliable version?

I can see a lot of issues reported regarding v7.18, should we downgrade to a more stable version?

MohHeader commented 4 years ago

@KylinChang what would be your advice regarding the most stable version to use?

Thanks,

zenith-jacob commented 4 years ago

They won't respond. The last, stable release is 7.13.

It all really depends on the other plugins you use. Some people use 7.14/7.15 without issues, but as soon as they for example update IAP libraries or Ads libraries, everything crashes, because Facebook SDK is written without any respect for any other plugins.

MohHeader commented 4 years ago

Thanks @zenith-jacob for answering Funny thing is ( 7.13 is not listed in the releases page )

Ok, then mostly I will just remove the plugin from my Project, I only use it for Analytics & ( tracking ads, and now we don't depend anymore on ads through FB )

So no need to wait anymore longer for a fix,

Thanks again!

zenith-jacob commented 4 years ago

We're using Facebook Unity SDK from here: https://developers.facebook.com/docs/unity/

On the downloads page, there's a 7.13. If you're using Android or iOS specifically, you'll have to extract which version of the Android and iOS plugins are included in 7.13 Unity's SDK.

But yes, the best decision to make is to get rid of Facebook SDK. I wish we could do that...

num0n1 commented 4 years ago

exact same issue appeared after upgrading from 7.16 to 7.18, fb login, send gifts, share, will crash, had to revert back to 7.16

bowthemes commented 4 years ago

Same here, crash on Android 5 and 6.0

java.lang.Error: FATAL EXCEPTION [main] Unity version : 2018.4.12f1 Device model : samsung SM-J700F Device fingerprint: samsung/j7eltexx/j7elte:6.0.1/MMB29K/J700FXXU4BRA1:user/release-keys Caused by at com.android.internal.policy.PhoneWindow.generateLayout (PhoneWindow.java:4568) at com.android.internal.policy.PhoneWindow.installDecor (PhoneWindow.java:4637) at com.android.internal.policy.PhoneWindow.getDecorView (PhoneWindow.java:2263) at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4349) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3426) at android.app.ActivityThread.access$1100 (ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1821) at android.os.Handler.dispatchMessage (Handler.java:102) at android.os.Looper.loop (Looper.java:148) at android.app.ActivityThread.main (ActivityThread.java:7325) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

tigerwng commented 4 years ago

I have same problem on Samsung Galaxy J5(j5lte), 1536MB RAM, Android 5.1