【发布时间】:2023-03-15 08:08:01
【问题描述】:
我有一个即时应用程序,可以通过我的本地开发环境在模拟器或设备上正常部署和运行。事实上,我在生产中部署了一个旧版本,它工作得非常好,但很长时间没有更新,而且自发布以来,大部分即时应用工具都发生了变化。这当然意味着我已经在网站上正确设置了我的资产链接文件。
我可以将其上传并部署到我在 Google Play 上的开发轨道上,但不会出错,但是当打开已处理的 URL 时,它会转到 Chrome 而不是即时应用程序。我已经阅读了docs。该 URL 在清单中(毕竟它适用于我的开发环境)。
我运行了几个 URL 并查看了日志以进行比较。这是我的精简版(我希望它能够启动即时应用,但它只是在 Chrome 上打开):
01-12 15:27:57.884 2887-4983/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 1017252)
01-12 15:27:57.933 926-2361/? I/ActivityManager: START u0 {act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=https://www.example.com/... flg=0x10000000 cmp=com.android.chrome/com.google.android.apps.chrome.IntentDispatcher} from uid 10143
01-12 15:27:57.983 4985-4985/? I/cr_InstantAppsHandler: Package manager handles intents on O+, not handling in Chrome
01-12 15:27:57.985 926-2363/? I/ActivityManager: START u0 {act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=https://www.example.com/... flg=0x14002000 cmp=com.android.chrome/org.chromium.chrome.browser.ChromeTabbedActivity (has extras)} from uid 10056
vs BuzzFeed(成功启动 IA):
01-12 14:36:37.688 927-9531/? I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=https://www.buzzfeed.com/... cmp=com.buzzfeed.android/com.buzzfeed.showxlib.activity.ShowPageInstantActivity} from uid 10166
01-12 14:36:37.814 927-2593/? I/ActivityManager: Start proc 13156:com.buzzfeed.android/u0a249 for activity com.buzzfeed.android/com.buzzfeed.showxlib.activity.ShowPageInstantActivity
vs https://www.google.com(按预期启动 Chrome):
01-12 16:10:18.962 926-19253/? I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=https://www.google.com/... cmp=com.android.chrome/com.google.android.apps.chrome.IntentDispatcher} from uid 10166
01-12 16:10:19.057 4985-4985/? I/cr_InstantAppsHandler: Package manager handles intents on O+, not handling in Chrome
01-12 16:10:19.060 926-3112/? I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=https://www.google.com/... flg=0x14002000 cmp=com.android.chrome/org.chromium.chrome.browser.ChromeTabbedActivity (has extras)} from uid 10056
FAILED BINDER TRANSACTION 是唯一突出的东西。虽然很难将其真正归因于与解决 IA 意图有关,但我已经运行了多次并且每次都看到相同的行为。
有什么方法可以让我获得更多信息,了解出现了什么问题以及为什么无法启动免安装应用?
另外请注意,我已经检查了我的测试人员列表并通过 URL 等选择加入。
这是我的意图过滤器的简化形式:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="www.example.com" />
<data android:scheme="https" />
<data android:scheme="http" />
<data android:path="/k/keyword1" />
<data android:path="/k/keyword2" />
<data android:path="/k/keyword3" />
...
<data android:path="/k/keyword1000" />
</intent-filter>
想象一下我不想匹配:
<data android:path="/k/keyword1001" />
...
<data android:path="/k/keyword2000" />
如果我只有几个数据/路径元素,那么它似乎可以工作,但是当我获得大量时,即时应用程序无法加载。
【问题讨论】:
-
请注意,
FAILED BINDER TRANSACTION的包裹尺寸很大。我想知道我非常大的清单是否导致我超过了 1MB 的活页夹事务缓冲区限制。这在本地工作似乎很奇怪,但不能通过 Play,但可能是设备PackageManager通过一些Intent运行一些元数据,而本地工具没有。 -
@PragatiSingh 是的,我已经多次阅读这两个文件。我实际上倾向于我在评论中的假设是正确的。我当前的清单在意图处理程序中有大量的 URL,看起来像
/a/<something>/b,如果不是在path中明确列出它们,我使用带有值/a/..*/b的patternPath,它似乎可以工作。然而,这不是一个完美的解决方案,因为我希望能够仅将免安装应用程序用于某些路径。 -
您能否以您希望使用的方式发布清单的意图过滤器示例?
标签: android android-instant-apps