airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.37k stars 407 forks source link

Crashing with IllegalStateException #271

Open NStreet8579 opened 4 years ago

NStreet8579 commented 4 years ago

Hi, I have been facing this issue, with the following log

Fatal Exception: java.lang.RuntimeException: Unable to stop activity {app.appId/packagename.DeepLinkDispatchActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4862) at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4832) at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4907) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:192) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)>

Can someone help me with this, Please see the code in my manifest

<activity
            android:name=".deeplink.DeepLinkDispatchActivity"
            android:launchMode="singleTask"
            android:theme="@android:style/Theme.NoDisplay">
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="@string/WEB_DOMAIN"
                    android:scheme="https" />
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="@string/WWW_WEB_DOMAIN"
                    android:scheme="https" />
            </intent-filter>

            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="@string/HOUSIE_HOST"
                    android:scheme="https" />
            </intent-filter>

            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="@string/HOUSIE_HOST"
                    android:scheme="@string/SCHEMA" />
            </intent-filter>

            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="@string/WEB_DOMAIN"
                    android:scheme="@string/SCHEMA" />
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="@string/WWW_WEB_DOMAIN"
                    android:scheme="@string/SCHEMA" />
            </intent-filter>
        </activity>
NStreet8579 commented 4 years ago

@felipecsl can you help me with this?. i'm stuck from days.

rossbacher commented 4 years ago

@NStreet8579 Which version are you using?

NStreet8579 commented 4 years ago

@rossbacher I'm using 4.1.0

ikermart commented 3 years ago

This happens when you are using AppCompatActivity in your DeepLinkDispatchActivity, use Activity instead.