天道酬勤,学无止境

Android Instant App - Play Console release/deploy error and DAL(digital Asset Link) not linked

I'm trying to figure out why the play store will not accept my instant app build. I have successfully deployed an Alpha regular app release to testers since it is a prerequisite to release an instant app. I am trying to deploy a development release instant app. What am I doing wrong? I tried to add as much detail as possible.

Do I need to use the Digital Asset Link API service at the following link for a production instant app or is that for something else? https://console.developers.google.com/apis/api/digitalassetlinks.googleapis.com/overview

I get the following error when uploading the instant app build to the play console:

Your site 'example.com' has not been linked through the Digital Assets Link protocol to your app. Please link your site through the Digital Assets Link protocol to your app.

One thing i'm a little confused about is why when I click link and verify that a get the error message "Adding asset statements failed." as shown in the following picture: I notice that when I click the link and verify button, it modifies the strings.xml file in base and adds the following string: <string name="asset_statements" translatable="false">[{\n \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n \"target\": {\n \"namespace\": \"web\",\n \"site\": \"https://example.com\",\n }\n}]</string>

I have the following in the manifest of base, checklist and advisor under the application tag: <meta-data android:name="asset_statements" android:resource="@string/asset_statements"/>

Project description and structure:

App description: This is a proof of concept app. The installable app will open the mainfeature activity with two buttons that will bring you to either the checklist or advisor activity when clicked. There are two instant apps, instantapp-checklist goes to the checklist activity and instantapp(advisor) goes to the advisor activity.

  • There are 3 feature modules: mainfeature, checklist, advisor
  • There are 2 instant apps: instantapp-checklist, instantapp(advisor)

  • My installable app's bundle is is: blah.blah1.blah2.myappname
  • My checklist instant app's bundle id is: blah.blah1.blah2.myappname.checklist
  • My advisor instant app's bundle id is: blah.blah1.blah2.myappname.advisor

My assetlinks.json is:

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "blah.blah1.blah2.myappname.checklist",
    "sha256_cert_fingerprints":
    ["AA:...:53"]
  }
},
{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "blah.blah1.blah2.myappname.advisor",
    "sha256_cert_fingerprints":
    ["AA:...:53"]
  }
}]

In my checklist manifest inside the activity tag is the following:

        <meta-data
            android:name="default-url"
            android:value="https://example.com/checklist.html"/>

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>

            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
        <intent-filter android:order="1"
                       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:scheme="http"
                android:host="example.com"
                android:pathPattern="/checklist.html"/>
            <data android:scheme="https"/>
        </intent-filter>

Self checks I've done:

  • The instant app was signed signed with my keystore, not with the debug key. I checked to make sure the instant app's and the assetlinks.json show the same sha256 fingerprint.
  • The robots.txt allows assetlinks.json to be searched by all robots
  • assetlinks.json does have a valid cert and allows https
  • The content-type of assetlinks.json header is application/json
  • I am not opt'd in for "Google Play App Signing"
  • I used the following site to test my statement and it is successful: https://developers.google.com/digital-asset-links/tools/generator

评论

In the assetlinks.json file, the field package_name is set to blah.blah1.blah2.myappname.checklist.

However, mentioned above is that the installable app's id is blah.blah1.blah2.myappname. That means the package_name in the AndroidManifest.xml is set to blah.blah1.blah2.myappname.

They should match. blah.blah1.blah2.myappname must be added to the assetlinks.json on the server.

In the strings.xml, change the asset_statements:

<string name="asset_statements" translatable="false">[{\n  \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n  \"target\": {\n    \"namespace\": \"web\",\n    \"site\": \"https://qaapps.cio.ny.gov/apps/sandbox/james/hesc/checklist.html\",\n  }\n},{\n  \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n  \"target\": {\n    \"namespace\": \"web\",\n    \"site\": \"https://qaapps.cio.ny.gov/apps/sandbox/james/hesc/advisor.html\",\n  }\n}]</string>

Here are some other notes that helped me find the solution:

  • I used the following command line to test if the instant app works: adb shell am start -a android.intent.action.VIEW -d "https://example.com/checklist/"
  • On the device, I went to Settings > Google > Instant Apps and clicked the switch to uninstall/turn-off instant apps, then click it again to turn it back on . Also went to the Chrome settings(Settings > Privacy > Clear Browsing Data) to clear all data for time range, All Time.
  • When typing in the url to the instant app in Chrome, it only opens the website and not the instant app. If I click on a link to the instant app in a website it does open the instant app instead of the website.

It is weird, I had same problem. The solution was simple;

As @olearyj234 mentioned Link and Verify button adds string to end of string.xml.

I simply deleted the new string in string.xml and clicked the "Link and Verify" button.

受限制的 HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。

相关推荐
  • Google Play App Signing and Instant Apps
    Fairly straight forward question. Does anyone happen to know if Google Play App Signing supports Instant Apps? The reason I ask: Enter your app’s signing config, or select a keystore file. While it’s possible to use a debug config or keystore during testing, the generated Digital Asset Links file won’t be compatible with the release version of your app. If you do upload a Digital Asset Links file that uses a debug config or keystore, then before publishing your app you’ll need to generate and upload a new Digital Asset Links that uses your app’s release key. From Blog post:- How to Create an
  • Instant App - Digital Asset Links Protocol
    Whenever I tried to upload my instant app apks to Play store, it gives the following error : Your site 'www.mywebsitename.com' has not been linked through the Digital Assets Link protocol to your app. Please link your site through the Digital Assets Link protocol to your app. However, whenever I execute https://developers.google.com/digital-asset-links/tools/generator, it gives success for associating with my app and web site. Any idea why am I getting this error? What may cause this? Thanks for help in advance.
  • assetlinks.json 中的应用链接意图过滤器不适用于 Android(App links intent filters in assetlinks.json not working on Android)
    问题 我的应用程序定义了意图过滤器,以处理来自我的网站的URL,这些URL由 <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="www.host.com" android:scheme="http"/> </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="www.host.com" android:scheme="https"/>
  • Phonegap PushNotification打开特定的应用程序页面(Phonegap PushNotification to open a specific app page)
    问题 我正在为两个Android / IOS进行pushnotification。我使用了phonegap推送插件https://github.com/phonegap-build/PushPlugin,它看起来很棒。 我现在正在设备上接收消息,问题是当我单击接收到的消息时,它会转到应用程序index.html页面。但是当我单击消息时,我想打开其他页面,例如home.html,在home.html中,我会显示消息。 如何实现呢? MyPhoneGapActivity.java package com.test; import org.apache.cordova.DroidGap; import android.os.Bundle; public class MyPhoneGapActivity extends DroidGap { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.setIntegerProperty("splashscreen", R.drawable.splash); super.setIntegerProperty("loadUrlTimeoutValue", 60000); super.loadUrl(
  • Phonegap PushNotification to open a specific app page
    I am doing pushnotification for both Android/IOS.I have used a phonegap push-plugin https://github.com/phonegap-build/PushPlugin, it seems to work great. I am receiving message on my device now the problem is When i click on the received message it goes to app index.html page.But i want to open someother page eg home.html when i clicked the message and in home.html i will be showing the message. How to achieve this? MyPhoneGapActivity.java package com.test; import org.apache.cordova.DroidGap; import android.os.Bundle; public class MyPhoneGapActivity extends DroidGap { @Override public void
  • Instant app with Dynamic Features always show Disambiguation dialog with 1 option
    I'm experimenting with Dynamic Features and Instant Apps. To navigate between various features, I use Deep Links. Each time I navigate to another Activity, I see the disambiguation dialog for less than 1 second, with 1 app listed. Notice how the options for "Once" and "Always" (in dutch) are greyed out. Sample Github Project I created a minimalistic sample, that matches my current structure on Github. Requires Android Studio 3.5 - RC2 Some Context: I'm quite confident, the deeplinks are configured correct. But since you guys want to check that anyway, here's the configuration: 1 - Manifest:
  • Google Play Console error - Non-upgradable to installed app
    I developed an instant app apk basing on google tutorials and samples. When I'm trying to start rollout to production, I see one error: Non-upgradable to installed app PROBLEM Some users of this Instant App APKs will not be eligible for any of the APKs in your installed app. RESOLUTION Ensure that the targeting of your Instant App APKs matches the targeting of your APKs. Project structure: There are two scenarios, 1st: base - baseFeature, minSdk 18, targetSdk 26 application project(':apk') feature project(':item-details') item-details feature - minSdk 18, targetSdk 26 api project(':base') ui -
  • Google Play控制台错误-无法升级到已安装的应用(Google Play Console error - Non-upgradable to installed app)
    问题 我根据Google教程和示例开发了一个即时应用apk。 当我尝试开始将产品投入生产时,我看到一个错误:无法升级到已安装的应用程序 问题 此即时应用APK的某些用户将无法使用已安装应用中的任何APK。 解析度 确保您的Instant App APK的定位与您的APK的定位匹配。 项目结构:有两种方案,第一种: base-baseFeature,minSdk 18,targetSdk 26 application project(':apk') feature project(':item-details') 项目详细信息功能-minSdk 18,targetSdk 26 api project(':base') ui-功能未包含在即时模块,minSdk 18,targetSdk 26,模块中,包含所有视图 implementation project(':base') other modules like customcomponents, shared etc Instant-即时应用模块minSdk 18或23,targetSdk 26 implementation project(':base') implementation project(':item-details') apk-apk模块,minSdk 18,targetSdk 26 implementation
  • Digital Assets Link link to my website
    I have created an instant app. I uploaded it to my Google Console, and I got this error. The www.kochchy.cz website has not been linked to your application through the Digital Assets Link protocol. Link the application site with Digital Assets Link. [{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.kochchy.instantapptest.app", "sha256_cert_fingerprints":["A4:A6:74:15:F1:3E:38:3F:93:0F:EF:E3:A6:86:8E:7C:25:45:E8:80:5B:5E:35:70:49:20:DB:F8:CB:D4:FC:E0"] } }] Both apks, instant and installable use same id: com.kochchy
  • 在适用于Android的Phonegap应用上播放声音(Play sound on Phonegap app for Android)
    问题 我尝试播放mp3文件。 如果我更改本地Web服务器上文件的路径,则此方法有效,但是如果我在Android设备上运行此文件,则不会播放声音,也不会显示任何错误。 我很确定找不到mp3文件,但是我仍然不知道如何解决它。 这是HTML <body> <audio id="successSound" src="/android_asset/www/sound/successSound.mp3" type="audio/mpeg" ></audio> <audio id="errorSound" src="/android_asset/www/sound/errorSound.mp3" type="audio/mpeg" ></audio> <!-- some more UI --> </body> 这是Javascript document.getElementById('errorSound').play(); 是文件结构 phonyapp `-- www `-- index.html |-- sound | |-- errorSound.mp3 | `-- successSound.mp3 |-- res `-- spec 编辑1 我试过了 <audio id="successSound" src="sound/successSound.mp3" type="audio/mpeg
  • Is it possible to discover and run third-party Android Instant Apps on an emulated device?
    I'm currently trying to learn about Android instant apps. Since I don't own any real devices that support them, I'm using the emulator (from Android Studio 3.0 Canary 9). I can successfully run "toy" instant apps (like this) on my emulated Nexus 5x (with Play Store), so I believe that my development environment is configured correctly. However, I was curious to learn about the discovery process for third-party apps, and find out what the user experience is like. Lacking a suitable device of my own, I used the emulated Chrome browser to search for sites (like Stack Exchange) that have instant
  • Instant run is missing in Android Studio 3.5
    I want to disable instant run but the menu point is not there. I know where the instant run should be, but it is completely missing. I don't know why. I just upgraded to Android Studio 3.5 but I get an error when using AsyncTask and I know that the problem can be solved when disabling instant run, but I can't. See the screenshot for better understanding This is my gradle (app) apply plugin: 'com.android.application' android { compileSdkVersion 29 buildToolsVersion "29.0.0" defaultConfig { applicationId "com.project.myapp" minSdkVersion 21 targetSdkVersion 29 versionCode 13 versionName "1.1"
  • 无法在PhoneGap应用程序中播放HTML5音频(可以使用媒体吗?)(HTML5 audio not playing in PhoneGap App (Possible to use Media?))
    问题 在出国旅行的基础音板上工作。 设置一切以便在浏览器中正常运行,但由于单元服务将不可用,因此希望使用PhoneGap Build / GitHub使其可下载。 一切在桌面浏览器中都可以正常运行,但是一旦将其安装在Android上,mp3文件就无法播放。 我在这里还读过其他一些关于PhoneGap上mp3不一致的帖子。 使用“媒体”代替的一些建议。 我不确定如何替换掉我现在的代码。 似乎使用javascript而不是html。 http://docs.phonegap.com/en/2.0.0/cordova_media_media.md.html#Media我正在使用的示例: <audio id="yes" src="audio/basic/yes.mp3"></audio> <audio id="no" src="audio/basic/no.mp3"></audio> <button class="button" onclick="document.getElementById('yes').play()">Yes</button> <button class="button" onclick="document.getElementById('no').play()">No</button> 在浏览器中效果很好,但在Android上效果不佳。
  • 在Meteor-Cordova App中播放声音(Play Sound In Meteor-Cordova App)
    问题 在不使用cordova的情况下使用流星,我可以使用 new Audio('test.mp3').play() test.mp3在公用文件夹中的位置。 但是,一旦我在设备上将我的应用程序作为cordova应用程序运行,就无法播放声音。 我究竟做错了什么? 谢谢。 回答1 tl; dr 安装cordova媒体插件meteor add cordova:org.apache.cordova.media@0.2.15 将音频文件添加到公共目录使用/android_asset/www/application/path/to/sound.wav 如果您查看项目中的该文件夹, $PROJECT_ROOT/.meteor/local/cordova-build/platforms/android/assets/www/ 您将看到cordova为android构建应用程序的应用程序。 使用Cordova Media插件,我尝试使用文件路径/android_asset/www/path/to/sound.wav无济于事。 # Install the cordova media plugin with this command meteor add cordova:org.apache.cordova.media@0.2.15 相反,我看到我的声音文件夹位于www目录中,但位于应用程序目录下。 因此
  • Android Instant Apps - Cannot Find Symbol From Base Feature Asset
    I have a base feature module, and a feature module (you could call it the "child"). The base feature module has a strings.xml file asset containing: <resources> <string name="app_string">Test String</string> </resources> I attempt to reference this string resource in the "child" feature's activity, as below: int resId = R.string.app_string; Android Studio appears to respect this reference, and will even direct me to the app_string resource when I click it. However, during compilation, I am met with the following error message: Error:(13, 25) error: cannot find symbol variable app_string The
  • “ecb” doesn't work whit Cordova and PushPlugin
    I've tried to register my device using pushNotification, using a demo. It doesn't work. Print "Cordova PushNotification Plugin Demo" and "registering android" and look the alert "OK" (successHandler function works). The problem is that doesn't work the "ecb". Why? Can you help me? The plugin that I've installed with Cordova are: PushPlugin, Device, Notification, InAppBrowser and Network Information. I've tried the app on my LG L9 and on emulator. Same problem. This is the code: <script type="text/javascript" charset="utf-8" src="cordova.js"></script> <script type="text/javascript" charset="utf
  • HTML5 audio not playing in PhoneGap App (Possible to use Media?)
    Working on a basic sound board for a trip abroad. Set up everything to work fine in Browsers but wanted to use PhoneGap Build/GitHub to make it downloadable as cell service won't be available. Everything working great in desktop browser however once its installed on Android, the mp3 files don't play. I've read some others posts on here about the inconsistencies of mp3s on PhoneGap. Some suggestions offered using "media" in place of . I'm not sure how to swap that out in place of the code I have now. Seems to use javascript instead of just html. http://docs.phonegap.com/en/2.0.0/cordova_media
  • Android Firebase DynamiteModule:无法加载模块描述符(Android Firebase DynamiteModule: Failed to load module descriptor)
    问题 自从升级到最新版本的Firebase(9.0.0)以来,通过signInWithEmailAndPassword()对用户进行身份验证时,我无法摆脱以下两个错误。 有人知道发生了什么吗? 05-19 18:09:49.245 23550-23589/[PACKAGE] E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/[PACKAGE]-3/base.apk"],nativeLibraryDirectories= [/data/app/[PACKAGE]-3/lib/x86, /vendor/lib, /system/lib]] 和 05-19 18:09:49.252 23550-23550/[PACKAGE] E/FirebaseApp: Firebase API initialization failure.java.lang.reflect.InvocationTargetException at java
  • 音频无法与phoneGap一起使用(audio not working with phoneGap)
    问题 嗨,我尝试用我的aphoneGap代码为我的游戏添加声音: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Media Example</title> <script type="text/javascript" charset="utf-8" src="js/phonegap-1.4.1.js"></script> <script type="text/javascript" charset="utf-8"> // Wait for PhoneGap to load // document.addEventListener("deviceready", onDeviceReady, false); // PhoneGap is ready // function onDeviceReady() { playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3"); } // Audio player // var my_media = null; var mediaTimer = null; // Play audio
  • Gradle DSL method not found: 'implementation()'
    I had this error Error:(45, 0) Gradle DSL method not found: 'implementation()' Possible causes:<ul><li>The project 'LaTaxi2' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). <a href="fixGradleElements">Upgrade plugin to version 2.3.3 and sync project</a></li><li>The project 'LaTaxi2' may be using a version of Gradle that does not contain the method. <a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin. <a href="apply.gradle.plugin">Apply Gradle plugin</a></li>