NativeScript / NativeScript/nativescript-cli

Passing compile sdk lower than 28 fails build with tns-android@next

未關閉
#4,052 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

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

描述

CLI: 5.0.0-2018-10-16-12488 (RC)
Android Runtime: 5.0.0-2018-10-23-165909-01

The new android runtime requires sdk 28. If you build such project with tns build --compileSdk 27 the build will fail with error for missing resources. We need a check in that case and warning that you cannot build project with last android runtime with sdk lower than 28.

Steps:

  1. tns create TestApp --js
  2. tns platform add android@next
  3. tns build android --compileSdk 27

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

Android resource linking failed
Output: D:\work\TestProjects\test3\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
D:\work\TestProjects\test3\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
D:\work\TestProjects\test3\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1153: error: resource android:attr/fontVariationSettings not found.
D:\work\TestProjects\test3\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1154: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: C:\Users\endarova.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\0925c6411c9bd9ae001a8948b7174069\aapt2-3.2.0-4818971-windows\aapt2.exe link -I
C:\Users\endarova\AppData\Local\Android\Sdk\platforms\android-27\android.jar --manifest\ D:\work\TestProjects\test3\platforms\android\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml-o\ D:\work\TestProjects\test3\platforms\android\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @D:\work\TestProjects\test3\platforms\android\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt
--auto-add-overlay\ --java\ D:\work\TestProjects\test3\platforms\android\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ org.nativescript.test3-0\apk--no-version-vectors
--output-text-symbols
D:\work\TestProjects\test3\platforms\android\app\build\intermediates\symbols\debug\R.txt
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
Output: C:\Users\endarova.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\6a6559d0a9305ecc5ded117112c3f7db\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
D:\work\TestProjects\test3\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.
C:\Users\endarova.gradle\caches\transforms-1\files-1.1\design-28.0.0.aar\c1e5d15a6b9134a1e23aed70d9b09c4b\res\values\values.xml:161:5-202: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\endarova.gradle\caches\transforms-1\files-1.1\design-28.0.0.aar\c1e5d15a6b9134a1e23aed70d9b09c4b\res\values\values.xml:161:5-202: AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: C:\Users\endarova.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\0925c6411c9bd9ae001a8948b7174069\aapt2-3.2.0-4818971-windows\aapt2.exe link -I
C:\Users\endarova\AppData\Local\Android\Sdk\platforms\android-27\android.jar
--manifest
D:\work\TestProjects\test3\platforms\android\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml-o\ D:\work\TestProjects\test3\platforms\android\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @D:\work\TestProjects\test3\platforms\android\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt--auto-add-overlay--java\ D:\work\TestProjects\test3\platforms\android\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r--custom-package org.nativescript.test3-0\apk
--no-version-vectors
--output-text-symbols
D:\work\TestProjects\test3\platforms\android\app\build\intermediates\symbols\debug\R.txt
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

先建立一個應用程式並加入 android@next,然後重現 tns build android --compileSdk 27,接著追蹤 CLI 對 --compileSdk 的處理。完成的標準是偵測到不相容的 SDK/Runtime 組合並發出警告,而不是之後因缺少 Android 資源而失敗。

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

評估

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

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

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