Skip to content

Android app crashes in release mode, OK in debug/run (ns 8.4.0) #10171

@nmandyam

Description

@nmandyam

Issue Description

I have an app built over the years and migrated to ns 8 recently. The iOS version works perfectly, the Android version fails without error.

Running the app using ns debug android or ns run android works fine, but ns run with --release ... fails consistently with no error shown. Creating an APK and installing on an Android device also fails without an error shown.

I have looked and tried suggestions from other posters with similar problems, including trying to unsucessfully downgrade to webpack 4 and with the webpack option of config.optimization.usedExports(false). None of them make any difference to the behaviour.

Reproduction

My release command is:
ns run android --release --keyStorePath<keystore> --keyStorePassword <passwd> --keyStoreAlias <alias> --keyStoreAliasPassword <alias-passwd> --log trace

I have no logs - when running with --log trace, the last line says spawn: D:\AppData\Android\Sdk\platform-tools\adb "-s" "emulator-5554" "logcat" "--pid=7476".

The behaviour is identical when I use a regular connected device instead of the emulator.

In the response to the command echo 'y' | npx nativescript-envinfo, I don't know why the version of nativescript is not shown. Here's the response to ns doctor:

✔ Getting environment information

No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.4.0 version and is up to date.
✔ Component @nativescript/core has 8.4.5 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 8.4.0 version and is up to date.

Relevant log output (if applicable)

No response

Environment

OS: Windows 10 10.0.22621
CPU: (8) x64 Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
Shell: Not Found
node: 14.21.2
npm: 6.14.17
nativescript: Not Found

# android
java: Not Found
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: Not Found
cocoapods: Not Found
python: Not Found
python3: Not Found
ruby: Not Found
platforms: Not Found

Dependencies

"dependencies": {
  "@codelab/nativescript-multi-select": "^2.0.1",
  "@nativescript/animated-circle": "^1.1.7",
  "@nativescript/apple-sign-in": "^1.0.0",
  "@nativescript/camera": "^5.0.15",
  "@nativescript/core": "^8.3.6",
  "@nativescript/firebase": "^11.1.3",
  "@nativescript/geolocation": "^8.1.0",
  "@nativescript/local-notifications": "^6.0.0",
  "@nativescript/social-share": "^2.3.0",
  "@nativescript/theme": "^3.0.2",
  "@nstudio/nativescript-cardview": "^2.0.1",
  "@nstudio/nativescript-checkbox": "^2.0.5",
  "@nstudio/nativescript-floatingactionbutton": "^3.0.4",
  "@proplugins/nativescript-dom": "^2.2.3",
  "@triniwiz/nativescript-toasty": "^4.1.3",
  "@triniwiz/nativescript-videorecorder": "^4.0.2",
  "cookie": "^0.3.1",
  "crypto-js": "^3.1.9-1",
  "deepmerge-json": "^1.3.2",
  "delay": "^4.3.0",
  "email-validator": "^2.0.4",
  "fs-extra": "^10.1.0",
  "html-entities": "^1.2.1",
  "https-proxy-agent": "^3.0.0",
  "hydra-page-previewer": "^0.2.1",
  "jsdom": "^15.1.1",
  "linkifyjs": "^2.1.8",
  "moment": "^2.14.1",
  "moment-timezone": "^0.5.25",
  "nativescript-clipboard": "^2.1.1",
  "nativescript-drawingpad": "^3.1.0",
  "nativescript-drop-down": "^6.0.2",
  "nativescript-exit": "^1.0.1",
  "nativescript-menu": "^1.1.7",
  "nativescript-modal-datetimepicker": "^2.1.5",
  "nativescript-popup": "^1.5.0",
  "nativescript-remote-builds": "^1.1.1",
  "nativescript-timedatepicker": "^1.2.1",
  "nativescript-ui-calendar": "^14.2.1",
  "nativescript-ui-chart": "^14.2.1",
  "nativescript-ui-listview": "^14.2.4",
  "nativescript-ui-sidedrawer": "^14.2.1",
  "nativescript-urlhandler": "^1.3.0",
  "net": "^1.0.2",
  "node-html-parser": "^1.1.16",
  "os": "^0.1.2",
  "promise-map-series": "^0.2.3",
  "tls": "0.0.1",
  "util": "^0.12.5"
},
"devDependencies": {
  "@nativescript/android": "8.4.0",
  "@nativescript/webpack": "~5.0.12",
  "babel-types": "^6.26.0"
}

Please accept these terms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions