Firebase动态链接导致在targetSdk 33上发生ActivityNotFoundException

huangapple go评论63阅读模式
英文:

firebase dynamic link causes ActivityNotFoundException on targetSdk 33

问题

以下是翻译的内容,其中包括了代码部分:

"Has anyone faced this issue? When I build the app on targetSdk 33, app wont open dynamic link which crashes on ActivityNotFoundException on my pixel 6 android 13."

"有没有人遇到这个问题?当我在targetSdk 33上构建应用程序时,应用程序无法打开动态链接,导致在我的pixel 6上的android 13上发生ActivityNotFoundException崩溃。"

"Build setup causing crash:"

"导致崩溃的构建设置:"

"compileSdk = 33"
"targetSdk = 33"
"minSdk = 23"
"buildTools = "33.0.1""

"logcat crash:"

"logcat 崩溃日志:"

"Activity not found to handle Intent action [CONTEXT service_id=77 ]"
"android.content.ActivityNotFoundException: Unable to find explicit activity class {com.somecompany.app/com.somecompany.app.MainActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?"

"找不到处理意图动作的活动:[CONTEXT service_id=77]"
"android.content.ActivityNotFoundException:找不到显式活动类{com.somecompany.app/com.somecompany.app.MainActivity};您是否在AndroidManifest.xml中声明了此活动,或者您的意图是否与其声明的<intent-filter>不匹配?"

"workaroud build setup which works normally:"

"正常工作的解决方案构建设置:"

"compileSdk = 33"
"targetSdk = 32"
"minSdk = 23"
"buildTools = "33.0.1""

"Just in case i will add my intent filter:"

"以防万一,我会添加我的意图过滤器:"

""
""
""
""

"<data android:host="mydomain.page.link""
android:pathPrefix="/link""
android:scheme="http"/>"
"<data android:host="mydomain.page.link""
android:pathPrefix="/link""
android:scheme="https"/>"
""

"Any suggestion fix for targetSdk 33?"

"有关targetSdk 33的修复建议吗?"

英文:

Has anyone faced this issue? When I build the app on targetSdk 33, app wont open dynamic link which crashes on ActivityNotFoundException on my pixel 6 android 13.

Build setup causing crash:

compileSdk = 33
targetSdk = 33
minSdk = 23
buildTools = &quot;33.0.1&quot;

logcat crash:

Activity not found to handle Intent action [CONTEXT service_id=77 ]
    android.content.ActivityNotFoundException: Unable to find explicit activity class {com.somecompany.app/com.somecompany.app.MainActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared &lt;intent-filter&gt;?
        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2197)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1839)
        at android.app.Activity.startActivityForResult(Activity.java:5471)
        at hcl.platform_startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at hck.startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at com.google.android.chimera.android.Activity.startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at hgw.startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at hck.public_startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at hcl.startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):3)
        at android.app.Activity.startActivityForResult(Activity.java:5429)
        at hcl.platform_startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at hck.startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at com.google.android.chimera.android.Activity.startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at hgw.startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at hck.public_startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at hcl.startActivityForResult(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at android.app.Activity.startActivity(Activity.java:5927)
        at hcl.platform_startActivity(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at hck.startActivity(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at com.google.android.chimera.android.Activity.startActivity(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at hck.public_startActivity(:com.google.android.gms@230313044@23.03.13 (190400-503260631):2)
        at hcl.startActivity(:com.google.android.gms@230313044@23.03.13 (190400-503260631):3)
        at android.app.Activity.startActivity(Activity.java:5894)
        at hcl.platform_startActivity(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at hck.startActivity(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at com.google.android.chimera.android.Activity.startActivity(:com.google.android.gms@230313044@23.03.13 (190400-503260631):1)
        at kmq.x(:com.google.android.gms@230313044@23.03.13 (190400-503260631):4)
        at kmr.onPostExecute(:com.google.android.gms@230313044@23.03.13 (190400-503260631):3)
        at android.os.AsyncTask.finish(AsyncTask.java:771)
        at android.os.AsyncTask.-$$Nest$mfinish(Unknown Source:0)
        at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7872)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

workaroud build setup which works normally:

compileSdk = 33
targetSdk = 32
minSdk = 23
buildTools = &quot;33.0.1&quot;

Just in case i will add my intent filter:

        &lt;intent-filter android:autoVerify=&quot;true&quot;&gt;
            &lt;action android:name=&quot;android.intent.action.VIEW&quot;/&gt;
            &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;
            &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot;/&gt;

            &lt;data android:host=&quot;mydomain.page.link&quot;
                android:pathPrefix=&quot;/link&quot;
                android:scheme=&quot;http&quot;/&gt;
            &lt;data android:host=&quot;mydomain.page.link&quot;
                android:pathPrefix=&quot;/link&quot;
                android:scheme=&quot;https&quot;/&gt;
        &lt;/intent-filter&gt;

Any suggestion fix for targetSdk 33?

答案1

得分: 1

你有两个选项来设置sdk = 32,或者将所有子域添加到你的意图过滤器中https://github.com/firebase/firebase-android-sdk/issues/4198#issuecomment-1278762724

英文:

You have two options to set sdk = 32
or add all subdomains to your intent filter
https://github.com/firebase/firebase-android-sdk/issues/4198#issuecomment-1278762724

答案2

得分: -1

在清单文件中添加 android:autoVerify="true" 到意图过滤器中:

<intent-filter android:autoVerify="true">
英文:

add android:autoVerify="true" in intent filter menifest file

&lt;intent-filter android:autoVerify=&quot;true&quot;&gt;

huangapple
  • 本文由 发表于 2023年2月8日 23:40:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/75388190.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定