NativeScript / NativeScript/nativescript-cli

Adding strings.xml in App_Resources/Android/src/main/res/values is crashing the build

Đang mở
#3,670 5 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 build os: android
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ả

By the design with CLI 4.1.0 the structure of Android resource folder is as follows:

Android/src/main/res/values

By default in values folder there is colors.xml and styles.xml files.
When, I add a strings/xml file it will cause the app build to crash.
The reaons: the strings.xml is created during build and if a custom file is introduced it will replace the content of the default one causing two string to be missing (whic are used in AndoridManifes)

Error log

D:\git\NS-Issues-2018-II\NativeScript\issue-5897\platforms\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:33: AAPT: error: resource string/app_name (aka org.nativescript.issue5897:string/app_name) not found.

D:\git\NS-Issues-2018-II\NativeScript\issue-5897\platforms\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:44: AAPT: error: resource string/title_activity_kimera (aka org.nativescript.issue5897:string/title_activity_kimera) not found.

Reproducible with hello world template and CLI 4.1.0 on Win.

Steps to reporduce:

  • Create new project
  • Add strings.xml in Android/src/main/res/values
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="nativescript_google_maps_api_key">Some-Api-Key</string>
</resources>
  • Build the project - it fails due to missing title_activity_kimera and app_name

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

Tái hiện lỗi bằng một dự án hello-world sử dụng CLI 4.1.0 và một App_Resources/Android/src/main/res/values/strings.xml tùy chỉnh. Kiểm tra cách các tài nguyên Android được tập hợp trong quá trình build và xác minh rằng các chuỗi app_name và title_activity_kimera được tạo vẫn khả dụng cùng với chuỗi tùy chỉnh. Được xem là hoàn tất khi dự án build thành công với tệp tài nguyên tùy chỉnh.

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
45/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.