NativeScript / NativeScript/nativescript-cli
Adding strings.xml in App_Resources/Android/src/main/res/values is crashing the build
Chưa có ai nhận issue này.
- 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_kimeraandapp_name
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- 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