3

我快要瘋了試圖找出爲什麼Play商店不接受我的即時應用程序的構建。我已經成功地將Alpha常規應用程序版本部署到測試人員,因爲它是發佈即時應用程序的先決條件。我正在嘗試部署一個開發發佈即時應用程序。我究竟做錯了什麼?我試圖添加儘可能多的細節。如果您需要更多信息,請告訴我。Android的即時應用程序 - 遊戲控制檯發佈/部署錯誤和DAL(數字資產鏈接)不掛

我需要在以下鏈接使用數字資產鏈接API服務,爲生產即時應用或者是別的東西? https://console.developers.google.com/apis/api/digitalassetlinks.googleapis.com/overview

我上傳的即時應用程序建立到播放控制檯時,得到以下錯誤:

您的網站「example.com」尚未通過數字 資產Link協議爲您的應用鏈接。請通過 Digital Assets Link協議將您的網站鏈接到您的應用程序。

有一件事我有點困惑的是,爲什麼當我點擊鏈接並驗證一個得到錯誤信息「添加資產報表失敗。」如圖所示如下圖: Adding asset statements failed 我注意到,當我點擊鏈接和驗證按鈕,它會修改基地的strings.xml檔案,並添加以下字符串:<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>

在清單中,我有以下<meta-data android:name="asset_statements" android:resource="@string/asset_statements"/>

項目的描述和結構:

應用描述清單顧問應用標籤下的這是概念應用程序的一個證明。可安裝的應用程序將通過兩個按鈕打開主要活動活動,這些按鈕會在您點擊時將您帶入清單或顧問活動。有兩個即時應用程序,instantapp-checklist進入清單活動,instantapp(顧問)進入顧問活動。

  • 有3個功能模塊:mainfeature,清單,顧問
  • 有2個即時應用:instantapp檢查清單,instantapp(顧問)

Project structure

  • 我安裝的應用程序的束爲:blah.blah1.blah2.myappname
  • 我的清單即時應用程序的包ID爲:blah.blah1.blah2.mya ppname.checklist
  • 我的導師即時應用程序的包ID爲:blah.blah1.blah2.myappname.advisor

我assetlinks。JSON是:

[{ 
    "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"] 
    } 
}] 

在我的清單中的活動標籤內的清單如下:

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

自我檢查,我所做的:

  • 即時應用程序簽署簽署與我的密鑰庫,而不是調試密鑰。我查了一下,以確保即時應用程序和assetlinks.json顯示相同的sha256指紋。
  • 中的robots.txt允許通過所有機器人
  • assetlinks.json確實有一個有效的證書被搜索assetlinks.json並允許HTTPS
  • 的內容類型assetlinks.json報頭是application/JSON
  • 我不是opt'd在「谷歌Play應用簽名」
  • 我用下面的網站來測試我的說法,這是成功的:https://developers.google.com/digital-asset-links/tools/generator

任何幫助,謝謝先進!

+1

您在「[app]>發佈管理>應用簽名」下選擇了「Google Play應用簽名」的任何機會嗎? (並且不,您不需要數字資產鏈接API) – TWL

+0

否則,您是否可以提交錯誤,然後將其鏈接回此處?這對所有人都有幫助,謝謝! https://issuetracker.google.com/issues/new?component=316045&template=1018787 – TWL

+0

@TWL我沒有選擇參與Google Play應用簽名 – olearyj234

回答

1

assetlinks.json文件,場程序包設置爲blah.blah1.blah2.myappname.checklist

然而,上述是,安裝的應用程序的IDblah.blah1.blah2.myappname。這意味着包名AndroidManifest.xml設置爲blah.blah1.blah2.myappname

它們應該匹配。 blah.blah1.blah2.myappname必須添加到服務器上的assetlinks.json

的strings.xml,改變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> 

這裏有一些其他的注意事項,幫助我找到了解決方案:

  • 我用下面的命令行來測試即時應用工程:adb shell am start -a android.intent.action.VIEW -d "https://example.com/checklist/"
  • 在設備上,我去了設置> Google>即時應用和clicke d切換到卸載/關閉即時應用程序,然後再次單擊它將其重新打開。同時進入Chrome設置(設置>隱私>清除瀏覽數據)清除所有時間範圍內的所有數據。
  • 在Chrome中爲即時應用輸入網址時,它只會打開網站而不是即時應用。如果我在網站上點擊即時應用程序的鏈接,它會打開即時應用程序,而不是網站。
相關問題