NativeScript / NativeScript/nativescript-cli

Error is: The parser encountered some structural problem in the manifest.

未關閉
#5,639 2 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug-pending-triage
主要語言
JavaScript
星號
1.1k
分支
204
平均合併
1 天 9 小時
30 天內合併 PR
8

描述

Issue Description

Run the app with ns run android

You ll get a cryptic error at the end

Unable to apply changes on device: emulator-5554. Error is: The parser encountered some structural problem in the manifest..

The log below shows the actual error which should be brought back up to the user:

INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1130854405.tmp/base.apk (at Binary XML file line #30): com.tns.NativeScriptActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present
Reproduction

Run an app with a manifest not ready for android S

Relevant log output (if applicable)
d/app/build/outputs/apk/debug/app-debug.apk"
Result when throw error is false:
{
  stdout: 'Performing Streamed Install\n',
  stderr: 'adb: failed to install /Volumes/dev/nativescript/nativescript-material-components/demo-vue/platforms/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1130854405.tmp/base.apk (at Binary XML file line #30): com.tns.NativeScriptActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]\n',
  exitCode: 1
}
Error name: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED result code: -108
The parser encountered some structural problem in the manifest.
Unable to apply changes on device: emulator-5554. Error is: The parser encountered some structural problem in the manifest..
Environment
npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /Volumes/data/mguillon/.npm/_logs/2022-03-02T20_01_11_386Z-debug.log
Install for [ 'nativescript-envinfo@latest' ] failed with code 1
Please accept these terms

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

使用尚未準備好支援 Android S 的 manifest 執行回報的 ns run android 命令,並將 CLI 輸出與 issue 中顯示的 adb stderr 進行比較。追蹤 INSTALL_PARSE_FAILED_MANIFEST_MALFORMED 結果被轉換為一般 parser 訊息的位置;當向使用者顯示可採取行動的 Android 安裝錯誤時即完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
android, javascript
領域
cli, mobile
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。