首页 文章

Android即时应用播放商店错误

提问于
浏览
1

每当我将我的基地和功能APK上传到Play商店时,我都会遇到以下错误:

  • 您必须为Instant App APK提供默认网址 . 学到更多

  • 您的网站'www.example.com'尚未通过Digital Assets Link协议链接到您的应用 . 请通过Digital Assets Link协议将您的网站链接到您的应用 .

  • 您应该至少有一个活动的APK通过网络'intent-filter'映射到网站'www.example.com' .

这是我的清单文件:( 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>

我将assetlinks.json文件放到我的网站上,当我继续测试链接文件时,它会成功 . 我有什么不对的想法?谢谢你的帮助

3 回答

  • 3

    这是因为您的Instant App( https://www.example.com/product/productId )中的intent-filters不支持您指定的默认URL( https://www.example.com ) .

    您将需要更新默认URL以使其指向受支持的URL,或者添加支持默认URL的新intent-filter .

  • 0

    您必须在清单中指定域的主机,不能使用www.example.com

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

    ,也就是在manifest中的intent - filter之前,指定

    <元数据
    Android:name =“default-url”
    Android:value =“https://yourwebsite.com/main”/>

  • 0

    我同意@KitKat和AdamK . 基于此documentation . 要允许Google Play和Android启动器发现您的应用,您必须至少提供一项活动作为应用的入口点 . 在应用程序的清单中,入口点活动必须具有包含CATEGORY_LAUNCHERACTION_MAIN意图的<intent-filter>元素 .

    您的应用还必须为您的应用定义默认网址 . 在与入口点活动相同的Android清单中,您可以通过添加带有值属性的<meta-data>元素来定义应用程序的默认URL,该值属性提供活动可以处理的有效HTTPS URL . 此外,此默认网址还必须是已安装应用中CATEGORY_LAUNCHER活动的意图过滤器的一部分 .

相关问题