Nativescript: [MacOS] build android failed on app:mergeDebugAssets (unable to create new native thread)

Created on 24 Apr 2018  Β·  55Comments  Β·  Source: NativeScript/NativeScript

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes

Tell us about the problem

tns build android failed on ':app:mergeDebugAssets' > unable to create new native thread

Which platform(s) does your issue occur on?

Android
development on macOS Sierra

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

  • tns info output
    βœ” Component nativescript has 4.0.0 version and is up to date. βœ” Component tns-core-modules has 4.0.0 version and is up to date. βœ” Component tns-android has 4.0.1 version and is up to date.
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
    { "version": "4.0.0" }
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the
    package.json file of your project)
    "tns-android": { "version": "4.0.1" }
  • Plugin(s): (look for the version number in the package.json file of your
    project)
    No plugin

Please tell us how to recreate the issue in as much detail as possible.

I just run tns create sample-project --template tns-template-tab-navigation-ng, then run tns build android and the error mentioned above appeared

*note: run tns debug android --bundle completed without error

tns doctor output

βœ” Getting environment information 
βœ” 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.
βœ” Xcode is installed and is configured properly.
βœ” xcodeproj is installed and is configured properly.
βœ” CocoaPods are installed.
βœ” CocoaPods update is not required.
βœ” CocoaPods are configured properly.
βœ” Your current CocoaPods version is newer than 1.0.0.
βœ” Python installed and configured correctly.
βœ” The Python 'six' package is found.
No issues were detected.
βœ” Getting NativeScript components versions information...
βœ” Component nativescript has 4.0.0 version and is up to date.
βœ” Component tns-core-modules has 4.0.0 version and is up to date.
βœ” Component tns-android has 4.0.1 version and is up to date.
βœ– Component tns-ios is not installed.

tns debug android --log trace, output attached
trace.log.zip

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

No

needs more info android

Most helpful comment

gradle daemon runs a large number of threads while working on mergeDebugAssets task, when the number of threads exceeds the maximum limit of sysctl kern.num_taskthread the task will fail with that exception.

default nativescript org.gradle.jvmargs is-Xmx16384M, with default JVM stack size (-Xss1M), it can run a maximum of 16384 threads if it doesn't exceed thekern.num_taskthread limit.

adjusting jvm max heap (-Xmx) and max stack size (-Xss) will solve the problem

CMIIW

All 55 comments

Hi @ikhsan017,

I tested your case on my side, however, was unable to create this problem, while following the described steps. I can suggest removing the platform tns platform remove android, delete node_modules folder and build the project again tns build android.

If the problem persists, please provide more info about the Android SDK Build Tools, which you have installed on your machine.
Also, build the project with --log trace flag ->tns build android --log trace and send us the full log from the console.

Hi @tsonevn

Thanks for responding this issue.

I tried to remove 'platforms' and 'node_modules' and re-running tns build android, but the result is still the same

sdkmanager --list command produce this output

Installed packages:
  Path               | Version | Description                    | Location           
  -------            | ------- | -------                        | -------            
  build-tools;25.0.2 | 25.0.2  | Android SDK Build-Tools 25.0.2 | build-tools/25.0.2/
  emulator           | 26.0.0  | Android Emulator               | emulator/          
  patcher;v4         | 1       | SDK Patch Applier v4           | patcher/v4/        
  platform-tools     | 25.0.4  | Android SDK Platform-Tools     | platform-tools/    
  tools              | 26.0.1  | Android SDK Tools              | tools/             

full trace log attached
trace.log.zip

log.txt
same problem here

I just tried to update tns-android@next and rebuild the app, and got this line in the log

Caused by: java.lang.OutOfMemoryError: unable to create new native thread

It seems I need to add more ram 😬 , currently I have 4GB installed on my old 2011 mbp

i dont think that was the problem, i have 12GB ram...

I see new jvm process started with -Xmx16384M argument during build process if that helps

I was getting a similar issue with the error "unable to create new native thread". After removing platform and node_modules I got a "Configuration 'debugCompile' in project ':app' is deprecated. Use 'debugImplementation' instead." which lead me to update my gradle.

Gradle version: 4.4
Android Plugin Version: 3.1.2

I am still getting the deprecated error message but not the thread issue and it is running in the emulator.

which file need to be updated to change the android plugin version?

to upgrade gradle version, the file located at platforms/android/gradle/wrapper/gradle-wrapper.properties right?

Guys I was facing exactly the same problem. I tried several approaches but what finally worked for me was:

  1. Uninstalling both platforms via tns platform remove [ios/android]
  2. Install platforms in this order: 1st android / 2nd iOS.
    I did not understand what happened but it worked.

@olivgilberto I did the same, even running removing node_modules and platforms dir completely, and reinstall the platforms, but it didn't works

@mas-dude I just tried to upgrade via android studio, gradle sync and gradle build indeed succeeded on android studio, but when running tns build android on cli, I got different error now

Skipping prepare.
Building project...
Gradle build...
         + applying user-defined configuration from /Volumes/htdocs/nativescript/digital-logsheet/app/App_Resources/Android/app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-background-http/platforms/android/nativescript_background_http.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-barcodescanner/platforms/android/barcodescanner-release-2.1.6.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-barcodescanner/platforms/android/nativescript_barcodescanner.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-feedback/platforms/android/nativescript_feedback.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-local-notifications/platforms/android/nativescript_local_notifications.aar
         + adding jar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-local-notifications/platforms/android/libs/localnotlib.jar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-nfc/platforms/android/nativescript_nfc.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/Feedback-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSAutoComplete-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSCalendar-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSChart-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSCore-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSDataForm-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSGauge-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSListView-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSSideDrawer-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar
/Volumes/data/documents/ikhsan/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/12ae7627f6f356caa4c48426f64564a0/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

/Volumes/data/documents/ikhsan/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/12ae7627f6f356caa4c48426f64564a0/res/values-v26/values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.

/Volumes/data/documents/ikhsan/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/12ae7627f6f356caa4c48426f64564a0/res/values-v26/values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

/Volumes/data/documents/ikhsan/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/12ae7627f6f356caa4c48426f64564a0/res/values/values.xml:252:5-69: AAPT: error: resource android:attr/fontStyle not found.

/Volumes/data/documents/ikhsan/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/12ae7627f6f356caa4c48426f64564a0/res/values/values.xml:252:5-69: AAPT: error: resource android:attr/font not found

/Volumes/data/documents/ikhsan/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/12ae7627f6f356caa4c48426f64564a0/res/values/values.xml:252:5-69: AAPT: error: resource android:attr/fontWeight not found.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to process resources, see aapt output above for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

@ikhsan017 I am not sure what is going on but check out this https://github.com/NativeScript/nativescript-cli/issues/3552

Thanks, checking it out

I just realized that I have 2 sdk-path installed, with one managed by homebrew and another managed by android studio, so I remove one and set up my android studio to use existing sdk.

managed to install platform-26, upgrade gradle to 4.4 and gradle-android plugin to 3.1.2, tried to rebuild apk on cli and android studio, they are both show the same error now Unable to create new native thread

on android studio, I can see that app:MergeDebugAssets spawning a lot of com.android.build.gradle.tasks.MergeSourceSetFolders$AssetWorkAction processes

Hello @ikhsan017 I am still doing some tests. Got the same issues with android when creating new applications.
Nevertheless, after creating a test app and running "tns update next" from within the app folder the application is able to run without problems. The mentioned errors are simply gone. Take a look on the log below:

`MacBook-Pro-de-GILBERTO:app-comand gilberto$ tns update next
Gradle build...
Platform android successfully removed.
Successfully removed plugin tns-core-modules
Successfully removed plugin tns-core-modules-widgets
Copying template files...
β ‹ Installing tns-android
β ™ βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ΄ extract:zone.js: verb lock using /Users/gilberto/.npm/_locks/staging-984308bfef5bc61dβ Ή βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ΄ extract:zone.js: verb lock using /Users/gilberto/.npm/_locks/staging-984308bfef5bc61dβ Έ βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ΄ extract:zone.js: verb lock using /Users/gilberto/.npm/_locks/staging-984308bfef5bc61dβ Ό βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ΄ extract:zone.js: verb lock using /Users/gilberto/.npm/_locks/staging-984308bfef5bc61dβ ΄ βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ΄ extract:zone.js: verb lock using /Users/gilberto/.npm/_locks/staging-984308bfef5bc61dβ § βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ™ finalize:inherits: sill finalize /Volumes/Samsung/projects/app-comand/node_modules/inβ ‡ βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β Ή finalize:@angular/common: sill finalize /Volumes/Samsung/projects/app-comand/node_mod⠏ βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ‡ refresh-package-json:zone.js: sill finalize /Volumes/Samsung/projects/app-comand/nodeβ Ή Adding 'es2015.iterable' lib to tsconfig.json...
Project already targets TypeScript ~2.7.2

  • [email protected]
    added 59 packages in 62.679s
    Project successfully created.
    npm WARN [email protected] requires a peer of typescript@~2.6.2 but none is installed. You must install peer dependencies yourself.
  • [email protected]
    added 2 packages in 1.288s
    Successfully installed plugin tns-core-modules.
    MacBook-Pro-de-GILBERTO:app-comand gilberto$ tns run android
    Searching for devices...
    Executing before-liveSync hook from /Volumes/Samsung/projects/app-comand/hooks/before-liveSync/nativescript-angular-sync.js
    Executing before-prepare hook from /Volumes/Samsung/projects/app-comand/hooks/before-prepare/nativescript-dev-typescript.js
    Found peer TypeScript 2.7.2
    Preparing project...
    Successfully prepared plugin nativescript-angular for android.
    Successfully prepared plugin nativescript-theme-core for android.
    Successfully prepared plugin tns-core-modules for android.
    Successfully prepared plugin nativescript-intl for android.
    Successfully prepared plugin tns-core-modules-widgets for android.
    Project successfully prepared (Android)
    Building project...
    Gradle build...
    + applying user-defined configuration from /Volumes/Samsung/projects/app-comand/app/App_Resources/Android/app.gradle
    + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
    + adding aar plugin dependency: /Volumes/Samsung/projects/app-comand/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Project successfully built.
    Installing...
    Successfully installed on device with identifier 'emulator-5554'.
    Successfully transferred all files.
    Refreshing application...
    Successfully synced application org.nativescript.appcomand on device emulator-5554.
    Executing before-watchPatterns hook from /Volumes/Samsung/projects/app-comand/hooks/before-watchPatterns/nativescript-dev-typescript.js
    Executing before-watch hook from /Volumes/Samsung/projects/app-comand/hooks/before-watch/nativescript-dev-typescript.js
    Found peer TypeScript 2.7.2
    19:22:47 - Starting compilation in watch mode...

ActivityManager: Start proc 10514:org.nativescript.appcomand/u0a81 for activity org.nativescript.appcomand/com.tns.NativeScriptActivity
19:22:50 - Compilation complete. Watching for file changes.

JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.`

Unfortunately, the solution doesn't work for me

  • tns update next done, build still failed
  • update gradle and gradle-android plugin done, build still failed
tns build android
Skipping prepare.
Building project...
Gradle build...
         + applying user-defined configuration from /Volumes/htdocs/nativescript/digital-logsheet/app/App_Resources/Android/app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-background-http/platforms/android/nativescript_background_http.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-barcodescanner/platforms/android/barcodescanner-release-2.1.6.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-barcodescanner/platforms/android/nativescript_barcodescanner.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-feedback/platforms/android/nativescript_feedback.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-local-notifications/platforms/android/nativescript_local_notifications.aar
         + adding jar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-local-notifications/platforms/android/libs/localnotlib.jar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-nfc/platforms/android/nativescript_nfc.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/Feedback-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSAutoComplete-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSCalendar-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSChart-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSCore-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSDataForm-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSGauge-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSListView-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/nativescript-pro-ui/platforms/android/TNSSideDrawer-release.aar
         + adding aar plugin dependency: /Volumes/htdocs/nativescript/digital-logsheet/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> unable to create new native thread

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 13m 40s
Command ./gradlew failed with exit code 1

tns info

βœ” Getting NativeScript components versions information...
βœ” Component nativescript has 4.0.0 version and is up to date.
⚠ Update available for component tns-core-modules. Your current version is 4.0.0-2018-05-04-01 and the latest available version is 4.0.0.
βœ” Component tns-android has 4.1.0-2018.5.8.2 version and is up to date.
βœ– Component tns-ios is not installed.

Hey @ikhsan017 I was doing some research and found out that the path length might represent a problem if a deep folder structure is in place.
iOS uses a 1024 bits max long if I am not wrong. Therefore longer path strings would be a problem to be resolved.
I did a test with a project folder which was not working - same reasons as before - and move it up in the folder structure and it worked as expected. Think it might be worth to try.

just moved to higher path and rename the dir to shorter name with no effect

the strange one is, build with --bundle give no problem

I'm afraid I didn't follow you... did it finally work for you?

tns build android --bundle did works, but tns build android still emit same error message

I had a very similar problem. After updating my Android build tools, the problem went away.

I just ran: sdkmanager "platform-tools" "platforms;android-26" (Since I was using API 26)

tns update next resolved here.

this command makes that modification on package.json:
"tns-android": { "version": "4.1.0-2018.5.17.2" },"

@datanotion @yassern tried both, but unfortunately the problem still occure

I'm having the exact same problem, on a Mac OSX High Sierra.
Installed Nativescript and Android platform tools just a few days ago and verify installation with tns doctor. Everything seems to be ok but when I try to build an android app, it says:

`* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.

unable to create new native thread`

tns info:
βœ” Getting NativeScript components versions information... βœ” Component nativescript has 4.0.2 version and is up to date. βœ” Component tns-core-modules has 4.0.1 version and is up to date. βœ” Component tns-android has 4.1.0-2018.5.18.1 version and is up to date. βœ” Component tns-ios has 4.1.0-2018-04-24-01 version and is up to date.

I've already tried removing/adding android platform several times. Updated to nativescript@next
DonΒ΄t know what else to do.

@andresggarcia, have you tried tns run android --bundle? It seems to be a workaround for this issue.

I'm also experiencing this on a Mac mini (8GB RAM) running High Sierra, TNS 4.0. It is a really strange problem and doesn't happen always. But always affects NG projects, haven't experienced it with core projects. Below are the cases I did and the respective result:

  1. Demo NG project of Drop Down plugin - works both w/ and w/o --bundle
  2. Demo NG project of Grid View plugin - fails w/o --bundle, works ok w/ --bundle
  3. Demo NG project of Image Swipe plugin - fails w/o --bundle, works ok w/ --bundle
  4. Demo NG Project of MaskedTextField plugin - fails w/o --bundle, works ok w/ --bundle

For the failures of 2, 3 and 4 above Travis CI built the project fine.

I can confirm running with --bundle does work and without it it get the famous error. but what does --bundle do to fix to problem ?

Hi. I would like to add to this issue that, in my case, after getting the error the Mac restarts unexpectedly.

I'm also trying to build from cloud and getting another build failed and an error message about android sdk licence.

I haven't been able to go forward with my project. Is this been watched? It can't be an isolated issue. I've just installed NativeScript from scratch a few weeks ago.

Any other info I could provide to help solve this, I'm open to. Thanks.

@andresggarcia what is your java version?

@vtrifonov Thanks for the reply.

java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

Is it ok?

Your version should be OK, upgrading Java to 1.8.0_171 improved that behavior a little bit on a user with the same issue, but in your case that’s not the case :( Is it working with β€”bundle in your case?

I'm sorry for the delay.

In fact, it works with --bundle but i'm facing another issue. When i run my app with:

tns debug android --bundle --env.aot

It compiles correctly but LiveSync doesn't work. When I save a file the recompile proccess throws this error:

Error: ENOENT: no such file or directory, stat '/Users/agarciag/Documents/nativescript/LiveData/app/app-routing.module.ngfactory.js' at Object.fs.statSync (fs.js:948:11) at Object.statSync (/Users/agarciag/Documents/nativescript/LiveData/node_modules/graceful-fs/polyfills.js:297:22) at Storage.provideSync (/Users/agarciag/Documents/nativescript/LiveData/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:98:13) at CachedInputFileSystem.statSync (/Users/agarciag/Documents/nativescript/LiveData/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:251:28) at VirtualFileSystemDecorator.statSync (/Users/agarciag/Documents/nativescript/LiveData/node_modules/@ngtools/webpack/src/packages/ngtools/webpack/src/virtual_file_system_decorator.ts:75:44) at virtualFilesStats._virtualInputFileSystem.getVirtualFilesPaths.map (/Users/agarciag/Documents/nativescript/LiveData/node_modules/@ngtools/webpack/src/packages/ngtools/webpack/src/virtual_file_system_decorator.ts:134:48) at Array.map (<anonymous>) at newCallback (/Users/agarciag/Documents/nativescript/LiveData/node_modules/@ngtools/webpack/src/packages/ngtools/webpack/src/virtual_file_system_decorator.ts:132:10) at Watchpack.watcher.once (/Users/agarciag/Documents/nativescript/LiveData/node_modules/webpack/lib/node/NodeWatchFileSystem.js:43:4) at Object.onceWrapper (events.js:317:30) at emitTwo (events.js:126:13) at Watchpack.emit (events.js:214:7) at Watchpack._onTimeout (/Users/agarciag/Documents/nativescript/LiveData/node_modules/watchpack/lib/watchpack.js:144:7) at ontimeout (timers.js:482:11) at tryOnTimeout (timers.js:317:5) at Timer.listOnTimeout (timers.js:277:5)

Without the --env.aot flag, LiveSync works well but I'm using lazy loaded modules.

That's why I'm trying to make this work without webpack bundling but no success so far.

I have the same issue, just upgraded to {N} android 4.1.2.
tns build android --bundle works.
tns build android fails.

`πŸ” tns debug android
Searching for devices...
Executing before-liveSync hook from /Users/charles/projects/kanayo/mymobile-native/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-shouldPrepare hook from /Users/charles/projects/kanayo/mymobile-native/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Executing before-prepare hook from /Users/charles/projects/kanayo/mymobile-native/hooks/before-prepare/nativescript-dev-sass.js
Found peer node-sass
Executing before-prepare hook from /Users/charles/projects/kanayo/mymobile-native/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.7.2
Preparing project...
Executing before-prepareJSApp hook from /Users/charles/projects/kanayo/mymobile-native/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Successfully prepared plugin nativescript-angular for android.
Successfully prepared plugin nativescript-anyline for android.
Successfully prepared plugin nativescript-bcryptjs for android.
Successfully prepared plugin nativescript-bluetooth for android.
Successfully prepared plugin nativescript-cardview for android.
Successfully prepared plugin nativescript-checkbox for android.
Successfully prepared plugin nativescript-dialogs for android.
Successfully prepared plugin nativescript-floatingactionbutton for android.
Successfully prepared plugin nativescript-idscanner for android.
Successfully prepared plugin nativescript-iqkeyboardmanager for android.
Successfully prepared plugin nativescript-local-notifications for android.
Successfully prepared plugin nativescript-medicalsensors for android.
Successfully prepared plugin nativescript-ng2-fonticon for android.
Successfully prepared plugin nativescript-orientation for android.
Successfully prepared plugin nativescript-pdf-view for android.
Successfully prepared plugin nativescript-permissions for android.
Successfully prepared plugin nativescript-secure-storage for android.
nativescript-swift-3.0 is not supported for android.
Successfully prepared plugin nativescript-swift-3.0 for android.
Successfully prepared plugin nativescript-textinputlayout for android.
Successfully prepared plugin nativescript-texttospeech for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-toast for android.
Successfully prepared plugin nativescript-ui-chart for android.
Successfully prepared plugin nativescript-ui-sidedrawer for android.
Successfully prepared plugin nativescript-unit-test-runner for android.
Successfully prepared plugin nativescript-urlhandler for android.
Successfully prepared plugin nativescript-uuid for android.
Successfully prepared plugin nativescript-videoplayer for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin nativescript-intl for android.
Successfully prepared plugin nativescript-dom for android.
Successfully prepared plugin nativescript-globalevents for android.
Successfully prepared plugin nativescript-ui-core for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Built aar for nativescript-bluetooth
Project successfully prepared (Android)
Executing after-prepare hook from /Users/charles/projects/kanayo/mymobile-native/hooks/after-prepare/nativescript-dev-sass.js
All SASS source files removed from app package
Executing after-prepare hook from /Users/charles/projects/kanayo/mymobile-native/hooks/after-prepare/nativescript-dev-webpack.js
Executing after-prepare hook from /Users/charles/projects/kanayo/mymobile-native/hooks/after-prepare/nativescript-unit-test-runner.js
Building project...
Gradle build...
+ setting applicationId
+ applying user-defined configuration from /Users/charles/projects/kanayo/mymobile-native/app/App_Resources/Android/app.gradle
Applying settings from /Users/charles/projects/kanayo/mymobile-native/app/App_Resources/Android/settings.json
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-anyline/platforms/android/anyline-idscanner-debug.aar
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-bluetooth/platforms/android/nativescript_bluetooth.aar
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-checkbox/platforms/android/nativescript_checkbox.aar
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-idscanner/platforms/android/idscanner.aar
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-local-notifications/platforms/android/localnotlib-release.aar
+ adding jar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-medicalsensors/platforms/android/medicalsensors.jar
+ adding jar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-medicalsensors/platforms/android/hgc-sensors-1.3.jar
+ adding jar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-medicalsensors/platforms/android/slf4j-android-1.6.1-RC1.jar
+ adding jar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-medicalsensors/platforms/android/commons-codec-1.4.jar
+ adding jar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-medicalsensors/platforms/android/commons-lang-2.5.jar
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-ui-chart/platforms/android/TNSChart-release.aar
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-ui-sidedrawer/platforms/android/TNSSideDrawer-release.aar
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/nativescript-ui-core/platforms/android/TNSCore-release.aar
+ adding aar plugin dependency: /Users/charles/projects/kanayo/mymobile-native/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugAssets'.

    unable to create new native thread

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3m 39s
Unable to apply changes on device: ZY2223NRS4. Error is: Command ./gradlew failed with exit code 1.
Executing after-watch hook from /Users/charles/projects/kanayo/mymobile-native/hooks/after-watch/nativescript-dev-sass.js
Executing after-watch hook from /Users/charles/projects/kanayo/mymobile-native/hooks/after-watch/nativescript-dev-typescript.js
Executing after-watch hook from /Users/charles/projects/kanayo/mymobile-native/hooks/after-watch/nativescript-dev-webpack.js`

Have the same problem at Win 7. After update from 3 to 4 version, tns build android reaches 71% ( app:mergeDebugAssets()), and then my computer hardly responses to any action for a very long time. I have not ios build installed at all.

i faced the same issue on MacOS and all i do is
1- tns update
2-npm install tns-core-modules@latest --save

and issue solved
hope this help you and sorry for my bad english

Just for update,

building sample app based on tab template succeeded, but building sample app based on sidedrawer template still emit the same error

I'm on Mac OS X High Sierra, trying to build on Android.

I am also encountering this same error, except I'm trying to import a module from Google Cloud Vision onto an empty NativeScript project. I've tried everything above except bundling but it's not working for me.

I ran the following:

tns create test_empty
tns plugin add nativescript-nodeify
tns run android 

The empty project runs perfectly fine.

Then I added the Cloud Vision module.

npm install --save @google-cloud/vision

Then in main-page.js, I added at the top var visionapi = require("@google-cloud/vision"), just before the var createViewModel = require("./main-view-model").createViewModel; After this, I deleted some .js.gz files: long.min.js.gz, bytebuffer.min.js.gz, bytebuffer-dataview.min.js.gz, protobuf-light.min.js.gz, protobuf.min.js.gz, to get rid of a Duplicate resources error.

Then I ran

tns run android

And it will throw up the :app:mergeDebugAssets unable to create a new native thread error.

I'm hoping this information will be useful somehow...

Here is the ouput.

Searching for devices...
Skipping prepare.
Building project...
Gradle build...
         + setting applicationId
         + applying user-defined configuration from /Users/zhihenglu/Desktop/Code Projects/GCP Experimentation/test_empty/app/App_Resources/Android/app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: /Users/zhihenglu/Desktop/Code Projects/GCP Experimentation/test_empty/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> unable to create new native thread

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 52s
Unable to apply changes on device: 8XV7N15A14000207. Error is: Command ./gradlew failed with exit code 1.
Zhis-iMac:test_empty zhihenglu$ 

After using --log trace, my terminal was flooded with these messages below when the NativeScript build was stuck at 71% at :app:mergeDebugAssets

operation root.1.9.496 could not be started (4 worker(s) in use).
23:23:29.509 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.9.2521 could not be started (4 worker(s) in use).
23:23:29.510 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.9.1081 could not be started (4 worker(s) in use).
23:23:29.510 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.9.2468 could not be started (4 worker(s) in use).

On my linux box, this process can be done successfully, but it take very long times, the shortest is 1 hours 30mins

and the longest is 9 hours until I dropped it

Same problem on a brand new build machine.
MacOS High Sierra.

Is anybody looking into this?

For those that experience the issue with --ng builds only, updating Gradle to the latest version (4.9 at this time) appears to resolve this problem.

How do you go about updating Gradle?

Here you go .... https://gradle.org/install/

@ChuckAtAlog @ikhsan017 @zhihil @daniil-timofeev @yassern @luishdez87 and all other participants that have struggled with this issue - have you tried the solution provided by @GijsOnGitHub (updating the Gradle to the latest version) - please let me know if the update is resolving the issue on your side

Yes, updating the Gradle to the latest version help me.

Updating to Gradle doesn't resolve the issue for me. I ran brew install gradle to update my Gradle version.

Running gradle --version in BASH reports that the version is 4.10.

Running tns run android produces the same behavior as before. This is the output

`Searching for devices...
Skipping prepare.
Building project...
Gradle build...
+ setting applicationId
+ applying user-defined configuration from /Users/zhihenglu/Desktop/Code Projects/GCP Experimentation/npmOutage/test_empty/app/App_Resources/Android/app.gradle
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
+ adding aar plugin dependency: /Users/zhihenglu/Desktop/Code Projects/GCP Experimentation/npmOutage/test_empty/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugAssets'.

    unable to create new native thread

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 41s
Unable to apply changes on device: 8XV7N15A14000207. Error is: Command ./gradlew failed with exit code 1.`

I'm facing the same issue. Already updated gradle to Version 4.10 without any success. is there any workaround?

@NickIliev with tns run android --bundle I'm able to install the app on the device. after the splashscreen I run into the following error:

Successfully synced application com.amsys.armo2018 on device HT24MW111104.
ActivityManager: Start proc com.amsys.armo2018 for activity com.amsys.armo2018/com.tns.NativeScriptActivity: pid=24238 uid=10167 gids={50167, 3003, 1028, 1015}
System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:
System.err: Error calling module function
System.err: Error calling module function
System.err: Error: Cannot find module "."
System.err: File: "file:///data/data/com.amsys.armo2018/files/app/bundle.js, line: 7436, column: 136
System.err: StackTrace:
System.err: Frame: function:'ZoneAwareError', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 62351, column: 33
System.err: Frame: function:'webpackMissingModule', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 69
System.err: Frame: function:'module.exports.e.code', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 147
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7445, column: 3
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'module.exports.webpackEmptyContext.keys', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 17587, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 25972, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'webpackJsonpCallback', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 25, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/starter.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: Cannot find module "."
System.err: File: ", line: 1, column: 265
System.err: StackTrace:
System.err: Frame: function:'ZoneAwareError', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 62351, column: 33
System.err: Frame: function:'webpackMissingModule', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 69
System.err: Frame: function:'module.exports.e.code', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 147
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7445, column: 3
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'module.exports.webpackEmptyContext.keys', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 17587, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 25972, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'webpackJsonpCallback', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 25, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/starter.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: Cannot find module "."
System.err: File: ", line: 1, column: 265
System.err: StackTrace:
System.err: Frame: function:'ZoneAwareError', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 62351, column: 33
System.err: Frame: function:'webpackMissingModule', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 69
System.err: Frame: function:'module.exports.e.code', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 147
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7445, column: 3
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'module.exports.webpackEmptyContext.keys', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 17587, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 25972, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'webpackJsonpCallback', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 25, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/starter.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4476)
System.err: at android.app.ActivityThread.access$1500(ActivityThread.java:144)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: at android.os.Looper.loop(Looper.java:136)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5146)
System.err: at java.lang.reflect.Method.invokeNative(Native Method)
System.err: at java.lang.reflect.Method.invoke(Method.java:515)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
System.err: at dalvik.system.NativeStart.main(Native Method)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Error calling module function
System.err: Error calling module function
System.err: Error: Cannot find module "."
System.err: File: "file:///data/data/com.amsys.armo2018/files/app/bundle.js, line: 7436, column: 136
System.err: StackTrace:
System.err: Frame: function:'ZoneAwareError', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 62351, column: 33
System.err: Frame: function:'webpackMissingModule', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 69
System.err: Frame: function:'module.exports.e.code', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 147
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7445, column: 3
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'module.exports.webpackEmptyContext.keys', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 17587, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 25972, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'webpackJsonpCallback', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 25, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/starter.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: Cannot find module "."
System.err: File: ", line: 1, column: 265
System.err: StackTrace:
System.err: Frame: function:'ZoneAwareError', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 62351, column: 33
System.err: Frame: function:'webpackMissingModule', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 69
System.err: Frame: function:'module.exports.e.code', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 147
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7445, column: 3
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'module.exports.webpackEmptyContext.keys', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 17587, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 25972, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'webpackJsonpCallback', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 25, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/starter.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: Cannot find module "."
System.err: File: ", line: 1, column: 265
System.err: StackTrace:
System.err: Frame: function:'ZoneAwareError', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 62351, column: 33
System.err: Frame: function:'webpackMissingModule', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 69
System.err: Frame: function:'module.exports.e.code', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7436, column: 147
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 7445, column: 3
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'module.exports.webpackEmptyContext.keys', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 17587, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 25972, column: 18
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 53, column: 30
System.err: Frame: function:'webpackJsonpCallback', file:'file:///data/data/com.amsys.armo2018/files/app/vendor.js', line: 25, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/bundle.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Frame: function:'', file:'file:///data/data/com.amsys.armo2018/files/app/starter.js', line: 2, column: 1
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: at com.tns.Runtime.runModule(Native Method)
System.err: at com.tns.Runtime.runModule(Runtime.java:553)
System.err: at com.tns.Runtime.run(Runtime.java:545)
System.err: at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4473)
System.err: ... 10 more
ActivityManager: Process com.amsys.armo2018 (pid 24238) has died.

hello everyone, have you got the nativescript maps plugin installed in your apps? i really think the problem is this plugin

@peppeg85 yes, same plugin here.

@peppeg85 I've not got nativescript maps installed.
This issue has been inconsistant for me, but I find when it does occur running
tns update (possibly an unnecessary step)
then removing the platforms directory
rm -rf platforms
when I next try tns run android it works.

@peppeg85 , no maps plugin in my case.

ok, anyway...my problem were the nativescript maps plugin instructions....following them they create a src/main/res/value folder where you must copy the google api file....just delete the src folder and copy the api file in the value folder inside Android

https://github.com/NativeScript/nativescript-cli/issues/3976

I get this error whenever I create a nativescript angular template, but a normal javascript template works fine. It only happens in an Android build on osx.

Other things I observed:
nativescript angular works fine with iphone.
nativescript angular also works fine with android on windows only.

gradle daemon runs a large number of threads while working on mergeDebugAssets task, when the number of threads exceeds the maximum limit of sysctl kern.num_taskthread the task will fail with that exception.

default nativescript org.gradle.jvmargs is-Xmx16384M, with default JVM stack size (-Xss1M), it can run a maximum of 16384 threads if it doesn't exceed thekern.num_taskthread limit.

adjusting jvm max heap (-Xmx) and max stack size (-Xss) will solve the problem

CMIIW

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings