NativeScript / NativeScript/nativescript-cli

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

オープン
#3,670 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug build os: android
主要言語
JavaScript
スター
1.1k
フォーク
204
平均マージ
1日 9時間
マージ済み PR(30日)
8

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

CLI 4.1.0 とカスタムの App_Resources/Android/src/main/res/values/strings.xml を使用する hello-world プロジェクトで失敗を再現します。ビルド中に Android リソースがどのように組み立てられるかを調査し、生成された app_name と title_activity_kimera の文字列がカスタム文字列とともに引き続き利用可能であることを確認します。カスタムリソースファイルを使用してプロジェクトが正常にビルドできれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, javascript
領域
build-system, cli, mobile-dev
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。