question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

release apk no work in 3.4.1 version

See original GitHub issue

Please, provide the details below:

I finish code my code and anything fine in debug mode , after I release apk and install it. The Layout is run and cannot navigate to my another page.

I find out below 2 link but no work to me.

https://github.com/NativeScript/NativeScript/issues/3257 https://github.com/telerik/nativescript-ui-feedback/issues/131

Which platform(s) does your issue occur on?

Android

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.dabaolah.driver",
    "tns-android": {
      "version": "3.4.1"
    }
  },
  "dependencies": {
    "nativescript-barcodescanner": "^2.7.4",
    "nativescript-geolocation": "^4.2.3",
    "nativescript-loading-indicator": "^2.4.0",
    "nativescript-localstorage": "^1.1.5",
    "nativescript-phone": "^1.3.1",
    "nativescript-plugin-firebase": "^5.1.5",
    "nativescript-pro-ui": "^3.3.0",
    "nativescript-theme-core": "^1.0.4",
    "tns-core-modules": "^3.4.0"
  },
  "devDependencies": {
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "copy-webpack-plugin": "~4.3.0",
    "css-loader": "~0.28.7",
    "extract-text-webpack-plugin": "~3.0.2",
    "lazy": "1.0.11",
    "nativescript-dev-webpack": "^0.9.1",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.2.1",
    "uglifyjs-webpack-plugin": "~1.1.6",
    "webpack": "~3.10.0",
    "webpack-bundle-analyzer": "^2.9.1",
    "webpack-sources": "~1.1.0"
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
NickIlievcommented, Feb 2, 2018

@yclau I guess you are building in release with Webpack as there was a webpack.config.js file. Initially I have reproduced the issue but I was able to run your project in release and bundled with Webpack with the following command (release with Wwbpack bundling)

tns run android --bundle --env.uglify --env.snapshot --env.aot --release --for-device --key-store-path ./my-release-key.jks --key-store-password <pass> --key-store-alias <alias> --key-store-alias-password <alias-pass>

and few small changes in bundle.js file

if (global.TNS_WEBPACK) {
    // registers tns-core-modules UI framework modules
    require("bundle-entry-points");

    // register application modules
    // This will register each `page` postfixed xml, css, js, ts, scss etc. in the app/ folder

    // Important! Note that I have manually added the word "content"
    const context = require.context("~/", true, /(page|content|fragment)\.(xml|css|js|ts|scss|less|sass)$/);

    global.registerModule("nativescript-pro-ui/sidedrawer", function() { return require("nativescript-pro-ui/sidedrawer"); });
    global.registerModule("nativescript-pro-ui/listview", function() { return require("nativescript-pro-ui/listview"); });
}

Two things about the changes in bundle.js file

  • in the context regex I have added the word content because not all your XML pages are ending in -page (the one in shared-view/drawer-content is ending in -content) - details explained here
    const context = require.context("~/", true, /(page|content|fragment)\.(xml|css|js|ts|scss|less|sass)$/);
    global.registerWebpackModules(context);
  • I have registered the UI controls from nativescript-pro-ui plugin in bundle config as shown here
    global.registerModule("nativescript-pro-ui/sidedrawer", function() { return require("nativescript-pro-ui/sidedrawer"); });
    global.registerModule("nativescript-pro-ui/listview", function() { return require("nativescript-pro-ui/listview"); });

If there are any additional UI plugins (that are using xmlns-myControlName anywhere in the XML: files) you will need to register them as well.

After those changes, the project was successfully built in release and I was able to navigate from the login page to the drawer page as expected

1reaction
yclaucommented, Feb 2, 2018

Hi @NickIliev , Thank you your support. I try research and solve almost 1 week , finally you solved my problem. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

update the Android Gradle plugin from the current version 3.4 ...
When I load the project Roboyard Version 9.0 into Android Studio, building works fine, but A.S. suggests to upgrade Gradle.
Read more >
unable to build apk --release only a debug apk #31547 - GitHub
i can't build an apk release but only debug i have tried to switch from stable version to master but i'm stucking in...
Read more >
Android Studio Dolphin | 2021.3.1
Discover what's new in the latest versions of Android Studio, the official IDE for Android.
Read more >
Release notes — fish-shell 3.5.1 documentation
fish 3.4.1 (released March 25, 2022); fish 3.4.0 (released March 12, 2022) ... The minimum version of CMake required to build fish is...
Read more >
Android agent compatibility and requirements
Operating system. Android 7.0 or higher. Version 6.6.0 and higher: Build must be compiled with Android SDK Tools version 24 or higher. Version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found