android: Nativescript app builds and crashes upon launch

Please, provide the details below:

Application builds on both platforms, but runs on IOS only as it crashes upon launch on Android, while it used to run as should before (can’t tell what’s the change that broke it since i usually test it on IOS), it simply crashes on emulator and my s7. here’s the build log tns_build_android_log.txt

Did you verify this is a real problem by searching [Stack Overflow]

I searched everywhere, found some suggestions like removing Platform and node_modules folders and rebuild, but that did’t work

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.5.2
  • Cross-platform modules: 2.3.0
  • Runtime(s): 2.5.0
  • package.json:
{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.makhzoumifoundation.general",
    "tns-ios": {
      "version": "2.5.0"
    },
    "tns-android": {
      "version": "2.5.0"
    }
  },

  "dependencies": {
    "nativescript-intl": "0.0.10",
    "nativescript-loading-indicator": "^2.3.2",
    "nativescript-local-notifications": "^1.2.1",
    "nativescript-push-notifications": "^0.1.2",
    "nativescript-sqlite": "^1.1.2",
    "nativescript-statusbar": "^1.0.0",
    "nativescript-telerik-ui-pro": "file:///Users/ryanzaatari/Documents/Development/NativeScript/nativescript-ui-pro.tgz",
    "nativescript-theme-core": "^1.0.3",
    "tns-core-modules": "^2.5.2"
  },
  "devDependencies": {
    "babel-traverse": "6.23.1",
    "babel-types": "6.23.0",
    "babylon": "6.16.1",
    "lazy": "1.0.11"
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

@Pip3r4o that caused the crash indeed, after pasting the new app.gradle content, and replaced the ApplicationId, the app now builds and runs perfectly fine.

Cheers!

Hi @ryanzaatari, I reviewed this case on my side while using the above-given information and the mentioned plugins, however, was unable to reproduce this runtime exception. It would help if you provide sample project, which could help us to research further this case and allow us to debug the problem on our side.

Something that I could suggest is to setup __enableVerboseLogging(); in the very beginning of the app.ts or app.js file, which will enable logging all runtime errors. For example: app.ts

declare var __enableVerboseLogging:any
__enableVerboseLogging();
import "./bundle-config";
import * as app from 'application';

app.start({ moduleName: 'main-page' });

app.js

__enableVerboseLogging();
require("./bundle-config");
var app = require("application");
app.start({ moduleName: 'main-page' });

After that, you could run adb logcat command in the terminal and start the app on the device or emulator. When the app crash, please send us the full log from the terminal.