Instant App无法从开发轨道加载

时间:2018-01-13 00:30:21

标签: android android-instant-apps

我有一个即时应用程序,可以通过我的本地开发环境部署并运行到模拟器或设备。事实上,我在生产中部署了一个旧版本,它工作得非常好但很长时间没有更新,并且自发布以来,许多Instant Apps工具都发生了变化。这当然意味着我已经在网站上正确设置了我的资产链接文件。

我可以毫无错误地将其上传并部署到Google Play上的我的开发轨道,但是在打开已处理的网址时,它会转到Chrome而不是即时应用。我已经阅读了docs。 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意图有关,但我已经多次运行并且每次都看到相同的行为。

有没有办法可以获得有关哪些内容出错以及无法启动即时应用的原因的更多信息?

另请注意,我已经检查了我的测试人员列表,并已通过网址等选择了。

这是我的意图过滤器的简化形式:

<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" />

如果我只有一些数据/路径元素,那么它似乎可以工作,但是当我得到大量数据时,即时应用程序无法加载。

1 个答案:

答案 0 :(得分:0)

启动即时应用程序确实需要来自Google Play服务的进程间通信。 (确切的类型取决于您是否正在运行Android Oreo。)

我们正在努力消除一些开销,但它需要很长时间才能推出。假设您在Android N或更早版本上观察到问题,可以使用较短的活动名称来解决此问题。例如,如果您有一个名为:

的类
com.really_long_package.SearchActivity

我建议创建一个带有短名称的别名,例如

package shortn;
public class SA extends com.really_long_package.SearchActivity {}

然后引用AndroidManifest.xml中的shortn.SA

相关问题