Android Instant App Play Store Errors

♀尐吖头ヾ 提交于 2019-12-17 20:31:47

问题


Whenever I upload my base and feature APKs to Play Store I got these errors :

  • You must provide a default URL for your Instant App APKs. Learn More
  • Your site 'www.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.
  • You should have at least one active APK that is mapped to site 'www.example.com' via a web 'intent-filter'.

And here is my manifest file : (EDITED)

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.ex.example.feature.productdetail">

      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
      <uses-permission android:name="android.permission.INTERNET"/>
      <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
      <uses-permission android:name="android.permission.WAKE_LOCK"/>


      <application>

    <activity
        android:name=".activity.ProductDetail"
        android:configChanges="orientation|screenSize"
        android:screenOrientation="portrait">
      <meta-data
          android:name="default-url"
          android:value="https://www.example.com/product/12345" />

      <meta-data android:name="asset_statements" android:resource="@string/asset_statements"/>

      <intent-filter
          android:autoVerify="true"
          android:order="1"
          >
        <category android:name="android.intent.category.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>

        <data android:scheme="http" android:host="www.example.com"/>
        <data android:scheme="https" android:host="www.example.com"/>
        <data android:pathPattern="/product/12345"/>
      </intent-filter>

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

    </activity>

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id"/>
  </application>
    </manifest>

I put the assetlinks.json file to my web site, and when I proceed test link file, it gives success. What am I doing wrong any idea? Thanks your help in advanced


回答1:


This is because the default URL you specified (https://www.example.com) is not supported by the intent-filters in your Instant App (https://www.example.com/product/productId).

You will either need to update the default URL so it points to a supported URL, or add a new intent-filter that supports the default URL.




回答2:


You must specify the host of your domain in the manifest, you can not use www.example.com

> <data android:scheme="http" android:host="www.yuorwebsite.com"/>
> <data android:scheme="https" android:host="www.yuorwebsite.com"/>

, also before the intent - filter in manifest, specify

<meta-data
 Android: name = "default-url"
 Android: value = "https://yourwebsite.com/main" />



回答3:


I agree with @KitKat and AdamK. Based from this documentation. To allow Google Play and Android launcher to discover your app, you must provide at least one activity as the entry point for your app. In the manifest for your app, the entry point activity must have an <intent-filter> element that includes the CATEGORY_LAUNCHER and ACTION_MAIN intents.

Your app must also define a default URL for your app. Within the same Android manifest as your entry-point activity, you define the default URL for your app by adding a <meta-data> element with a value attribute that provides a valid HTTPS URL that the activity can handle. Further, this default url must also be part of the CATEGORY_LAUNCHER activity's intent filter in the installed app.



来源:https://stackoverflow.com/questions/44629143/android-instant-app-play-store-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!