Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Crash with Deeplinking

Discussion in 'Android' started by lblast, Jun 10, 2019.

  1. lblast

    lblast

    Joined:
    Dec 1, 2016
    Posts:
    66
    I am using Unity 2018.4.1, and I am focusing on Android devices at the moment.

    I have written a plugin that extends UnityPlayerActivity that uses three main methods.

    This is the Java:
    Code (CSharp):
    1.  
    2.     @Override
    3.     protected void onCreate(Bundle savedInstanceState) {
    4.         super.onCreate(savedInstanceState);
    5.  
    6.         //read deep-linking for android, and send callback
    7.         handleDeepLink(getIntent());
    8.     }
    9.  
    10.     private void handleDeepLink(Intent intent)
    11.     {
    12.         String action = intent.getAction();
    13.         Uri data = intent.getData();
    14.         Bundle extras = intent.getExtras();
    15.  
    16.         if(data != null && action == Intent.ACTION_VIEW)
    17.         {
    18.             Log.d("DEEPLINK", "Sending android deep link: " + data.toString());
    19.             UnityPlayer.UnitySendMessage("DeeplinkManager", "HandleAndroidDeepLink", data.toString());
    20.         }
    21.         if(extras != null && action == Intent.ACTION_VIEW)
    22.         {
    23.             Log.d("DEEPLINK", "Sending android deep link extras: " + extras.toString());
    24.             UnityPlayer.UnitySendMessage("DeeplinkManager", "HandleAndroidDeepLinkExtras", extras.toString());
    25.         }
    26.     }
    27.  
    28.     @Override
    29.     protected void onNewIntent(Intent intent)
    30.     {
    31.         super.onNewIntent(intent);
    32.         setIntent(intent);
    33.         handleDeepLink(intent);
    34.     }
    35.  
    When I send a deeplink and the app is closed, I have success. If the app is open and I click on the deeplink (say from some IAM) I get a crash.

    There are a few concerning messages here, and I'm not sure what is causing the crash. I have put a snippet of the log below.

    What I have done is ran a command using ADB and used Android Studio logcat to get this (I have tried both IL2CPP and mono backends with the same result):
    Code (CSharp):
    1. 2019-06-10 14:33:31.284 3718-3718/com.company.testapp D/DEEPLINK: Sending android deep link: testapp://deeplinking?{action=campaign%26id=QA_Test_Camp}
    2. 2019-06-10 14:33:31.339 3718-3718/com.company.testapp I/Unity: onResume
    3. 2019-06-10 14:33:31.443 3718-4859/com.company.testapp D/Unity: SetWindow 0 0xb6eca808
    4. 2019-06-10 14:33:31.443 3718-4859/com.company.testapp D/Unity: SetWindow 0 0xb6eca808
    5. 2019-06-10 14:33:31.489 3718-3718/com.company.testapp I/Unity: windowFocusChanged: true
    6. 2019-06-10 14:33:31.490 3718-4859/com.company.testapp D/Unity: [EGL] Attaching window :0xb6eca808
    7. 2019-06-10 14:33:31.503 3718-4859/com.company.testapp D/Unity: ANativeWindow: (1920/1080) RequestedResolution: (0/0) RenderingResolution: (0/0) EGLSurface: (1920/1080)
    8. 2019-06-10 14:33:31.555 3718-3774/com.company.testapp D/Unity: SetWindow 0 0x0
    9. 2019-06-10 14:33:32.328 3718-4859/com.company.testapp D/Unity: NativeCrashSerializer::EndReport() Success!
    10. 2019-06-10 14:33:32.328 3718-4859/com.company.testapp E/CRASH: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
    11. 2019-06-10 14:33:32.328 3718-4859/com.company.testapp E/CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    12. 2019-06-10 14:33:32.328 3718-4859/com.company.testapp E/CRASH: Build type 'Development', Scripting Backend 'mono', CPU 'armeabi-v7a'
    13. 2019-06-10 14:33:32.328 3718-4859/com.company.testapp E/CRASH: Build fingerprint: 'google/bullhead/bullhead:8.1.0/OPM7.181005.003/4984324:user/release-keys'
    14. 2019-06-10 14:33:32.328 3718-4859/com.company.testapp E/CRASH: Revision: 'rev_1.0'
    15. 2019-06-10 14:33:32.329 3718-4859/com.company.testapp E/CRASH: pid: 3718, tid: 4859, name: UnityMain  >>> com.company.testapp <<<
    16. 2019-06-10 14:33:32.329 3718-4859/com.company.testapp E/CRASH:     r0 00000000  r1 c2570b00  r2 00000000  r3 80000000
    17. 2019-06-10 14:33:32.329 3718-4859/com.company.testapp E/CRASH:     r4 00000001  r5 0000009c  r6 00000000  r7 c256fe48
    18. 2019-06-10 14:33:32.329 3718-4859/com.company.testapp E/CRASH:     r8 00000000  r9 b6054200  sl c256fc48  fp c256fbd4
    19. 2019-06-10 14:33:32.329 3718-4859/com.company.testapp E/CRASH:     ip cf289c9c  sp c256fb20  lr ce7f7408  pc ce5a84e4  cpsr 000012fb
    20. 2019-06-10 14:33:32.329 3718-4859/com.company.testapp E/CRASH: backtrace:
    21. 2019-06-10 14:33:32.332 3718-4859/com.company.testapp E/CRASH:     #00  pc 00ca74e4  /data/app/com.company.testapp-OZIX9rQMGMUtDuUwrG2F2A==/lib/arm/libunity.so (AndroidGraphics::AcquireContext()+120)
    22. 2019-06-10 14:33:32.332 3718-4859/com.company.testapp E/CRASH:     #01  pc 00ca7818  /data/app/com.company.testapp-OZIX9rQMGMUtDuUwrG2F2A==/lib/arm/libunity.so (AndroidGraphics::ApplyPendingWindowChanges()+236)
    23. 2019-06-10 14:33:32.332 3718-4859/com.company.testapp E/CRASH:     #02  pc 00ca4034  /data/app/com.company.testapp-OZIX9rQMGMUtDuUwrG2F2A==/lib/arm/libunity.so (nativeFocusChanged(_JNIEnv*, _jobject*, bool)+76)
    24. 2019-06-10 14:33:32.332 3718-4859/com.company.testapp E/CRASH:     #03  pc 0000143f  /data/app/com.company.testapp-OZIX9rQMGMUtDuUwrG2F2A==/oat/arm/base.odex (oatexec+4294833215)
    25. 2019-06-10 14:33:32.332 3718-4859/com.company.testapp E/CRASH: memory near r3:
    Is it a problem with EGL setting the resolution to 0x0? Any help is appreciated.
     
    Last edited: Jun 25, 2019
  2. lblast

    lblast

    Joined:
    Dec 1, 2016
    Posts:
    66
    Any information on this? I added Firebase Crashlytics to my build yesterday, but it didn't receive any crashes.
     
  3. lblast

    lblast

    Joined:
    Dec 1, 2016
    Posts:
    66
    I now suspect that this has something to do with changing from .NET 3.5 to .NET 4x - does that provide any possible solutions?

    I only suspect this because very little else has changed in our project.
     
  4. flashmandv

    flashmandv

    Joined:
    Mar 26, 2015
    Posts:
    154
    I have the same problem. Any solution to the issue? Tried android:launchMode="singleInstance" and all possible values and the deep link still tries to open second instance and crashes the game

    UPDATE: This only happens from messenger overlay link clicks.
    If facebook messenger is not in overlay (switched normally instead of the bubble) the deeplink works normally
     
    Last edited: Nov 16, 2019