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 摘要。