Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to androidX #302

Open
ikermart opened this issue Nov 4, 2020 · 2 comments
Open

Migration to androidX #302

ikermart opened this issue Nov 4, 2020 · 2 comments

Comments

@ikermart
Copy link

ikermart commented Nov 4, 2020

Previous situation, all the deeplinks working
Deeplink Version: 3.1.1
My project using Android Support : v7

After upgrading my entire project to androidX sometimes crashed, see below:
Deeplink Version: 5.2.0
My project now using androidX

Started to throw this crashes:

Exception: java.lang.IllegalArgumentException
android.os.Parcel.nativeAppendFrom (Parcel.java)
android.content.Intent.getExtras (Intent.java:5387)
com.airbnb.deeplinkdispatch.BaseDeepLinkDelegate.createResult (BaseDeepLinkDelegate.java:170)
com.airbnb.deeplinkdispatch.BaseDeepLinkDelegate.dispatchFrom (BaseDeepLinkDelegate.java:121)
com.airbnb.deeplinkdispatch.BaseDeepLinkDelegate.dispatchFrom (BaseDeepLinkDelegate.java:102)

@DeepLinkHandler(AppDeepLinkModule.class)
public class HandlerDeepLinkActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try{
            DeepLinkDelegate deepLinkDelegate = new DeepLinkDelegate(new AppDeepLinkModuleRegistry());
            deepLinkDelegate.dispatchFrom(this);
            finish();
        }catch (Exception e){
            FirebaseCrashlytics.getInstance().recordException(e);
            sendFailedAnswer();
        }

    }

**AndroidManifest.xml**
``
<activity  android:name=".deeplink.HandlerDeepLinkActivity"
            android:launchMode="singleInstance"
            android:theme="@android:style/Theme.NoDisplay">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="paymnt"
                    android:scheme="txtxtx" />
            </intent-filter>
        </activity>
@rossbacher
Copy link
Collaborator

I'd debug if there is anything funky in the intent that is getting processed here. From the code it looks like the a simple .getExtras() call on the incoming intent is causing this and I'm pretty sure that is not caused by this lib in any way.

@ikermart
Copy link
Author

@rossbacher thank you for your comment, it´s so weird, but something related with the migration to AndroidX is causing that randomly unmarshalling the bundle crash the application. There is a related bug https://cs.android.com/android/_/android/platform/frameworks/base/+/694753465b577509cecba33a90fb7cb6d50f5533 that in Android7 and above resolves this issue. The bad new is that my project only works for specifically hardware running Android5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants