2017-11-07 1 views
0

웹 서버에 assetlinks.json 파일을 설정하여 모바일 앱에서 딥 링크를 처리하고 웹 사이트와 휴대 기기간에 로그인 자격 증명을 공유해야 함을 나타냅니다.assetlinks.json이 ERROR_CODE_MALFORMED_CONTENT을 제공하는지 확인합니다.

내 devv 서버 (https://devtesting.narrpr.com/.well-known/assetlinks.json)에 hosting 된 assetlinks.json 파일이 있습니다. 그것은 유효한 JSON은 그러나 jsonlint 다를 남죠 아니라고 말한다

{ 
    "maxAge": "599.999999890s", 
    "debugString": "********************* ERRORS *********************\n* Error: invalid_argument: Could not parse statement list (not valid JSON): \\357\\273\\277[{\\r\\n\\t\\t\\\"relation\\\": [\\\"delegate_permission/common.get_login_creds\\\"],\\r\\n\\t\\t\\\"target\\\": {\\r\\n\\t\\t\\t\\\"namespace\\\": \\\"web\\\",\\r\\n\\t\\t\\t\\\"site\\\": \\\"https://devtesting.narrpr.com/\\\"\\r\\n\\t\\t}\\r\\n\\t},\\r\\n\\t{\\r\\n\\t\\t\\\"relation\\\": [\\\"delegate_permission/common.get_login_creds\\\", \\\"delegate_permission/common.handle_all_urls\\\"],\\r\\n\\t\\t\\t\\\"target\\\": {\\r\\n\\t\\t\\t\\t\\\"namespace\\\": \\\"droid\\\",\\r\\n\\t\\t\\t\\t\\\"package_name\\\": \\\"com.rpr.mobile\\\",\\r\\n\\t\\t\\t\\t\\\"sha256_cert_fingerprints\\\": [\\r\\n\\t\\t\\t\\t\\t\\\"D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21\\\"\\r\\n\\t\\t\\t\\t]\\r\\n\\t\\t\\t}\\r\\n\\t}\\r\\n] [0] while fetching Web statements from https://devtesting.narrpr.com./.well-known/assetlinks.json (which is equivalent to 'https://devtesting.narrpr.com/.well-known/assetlinks.json') using download from the web (ID 1).\n********************* INFO MESSAGES *********************\n* Info: No statements were found that match your query\n", 
    "errorCode": [ 
    "ERROR_CODE_MALFORMED_CONTENT" 
    ] 
} 

디버그 줄에 : 나는 그것을 테스트 this url을 실행하면

[{ 
     "relation": ["delegate_permission/common.get_login_creds"], 
     "target": { 
      "namespace": "web", 
      "site": "https://devtesting.narrpr.com/" 
     } 
    }, 
    { 
     "relation": ["delegate_permission/common.get_login_creds", "delegate_permission/common.handle_all_urls"], 
      "target": { 
       "namespace": "android_app", 
       "package_name": "com.rpr.mobile", 
       "sha256_cert_fingerprints": [ 
        "D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21" 
       ] 
      } 
    } 
] 

, 그것은 오류를 제공합니다. 내가 뭘 잘못하고 있는거야?

답변

0

수동으로가 아닌 Android Studio를 통해 assetlinks.json 파일을 생성 한 후 작동이 시작되었습니다. 콘텐츠를 놓친 경우 또는 Windows 텍스트 인코딩 문제인 경우 확실하지 않습니다.

[{ 
    "relation": ["delegate_permission/common.handle_all_urls"], 
    "target": { 
    "namespace": "android_app", 
    "package_name": "com.rpr.mobile", 
    "sha256_cert_fingerprints": 
    ["D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21"] 
    } 
}, 
{ 
    "relation": ["delegate_permission/common.get_login_creds"], 
    "target": { 
    "namespace": "web", 
    "site": "https://devtesting.narrpr.com" 
    } 
}, 
{ 
    "relation": ["delegate_permission/common.get_login_creds"], 
    "target": { 
    "namespace": "android_app", 
    "package_name": "com.rpr.mobile", 
    "sha256_cert_fingerprints": 
    ["D3:7B:D8:D7:47:AF:08:2E:BA:EF:02:96:8C:F2:3A:1A:46:F9:B0:81:E9:E3:6D:BA:01:3C:00:59:95:39:8D:21"] 
    } 
}] 
0

Android 사양은 네임 스페이스로 android_app이 필요합니다.

- "namespace": "droid", 
+ "namespace": "android_app", 
+0

네임 스페이스를 변경 한 후에도 여전히 "유효하지 않은 JSON"오류가 발생합니다. – Justin

관련 문제