NativeScript / NativeScript/nativescript-cli

[NS7] Initial project fails to build production release

Open
#5,393 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Environment

  • CLI: 7.0.8
  • Android Runtime: 7.0.0

Describe the bug
running ns build android --release --env.snapshot --env.compileSnapshot --env.uglify --keyStorePath <KEYSTORE> --keyStorePassword <PASSWORD> --keyStoreAlias <ALIAS> --keyStoreAliasPassword <PASSWORD> --aab

throws

/test-project/node_modules/webpack-cli/bin/cli.js:93
				throw err;
				^

Error: In order to generate a V8 snapshot you must have the "android" platform installed - to do so please run "tns platform add android".
    at NativeScriptSnapshotPlugin.ProjectSnapshotGenerator.validateAndroidRuntimeVersion (/test-project/node_modules/@nativescript/webpack/snapshot/android/project-snapshot-generator.js:124:15)

Adding this to package.json resolves the error but I think it's not intended to be like that in NS7:

  "nativescript": {
    "id": "io.thisapp.thisappmap",
    "tns-android": {
      "version": "7.0.0"
    }
  },

To Reproduce

  • Initialize a new project
  • Run the command mentioned above

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported command with a freshly initialized project using NativeScript CLI 7.0.8 and Android Runtime 7.0.0. Start from the stack-trace path in node_modules/@nativescript/webpack/snapshot/android/project-snapshot-generator.js and compare it with the generated package.json nativescript configuration. Done means the release AAB build succeeds without manually adding the tns-android version.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
build-system, cli, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.