NativeScript / NativeScript/nativescript-cli

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

Đang mở
#4,052 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug severity: low
Ngôn ngữ chính
JavaScript
Star
1.1k
Fork
204
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
8

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện tns build android --compileSdk 27 sau khi tạo một ứng dụng và thêm android@next, sau đó theo dõi cách CLI xử lý --compileSdk. Công việc được xem là hoàn tất khi phát hiện tổ hợp SDK/Runtime không tương thích và đưa ra cảnh báo, thay vì về sau bị lỗi do thiếu tài nguyên Android.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, javascript
Lĩnh vực
build-system, cli, mobile-dev
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.