ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

[Bug] Ionic run android Typeerror

Open luchillo17 opened this issue 10 years ago • 14 comments

Hi, i updated to lates ionic-cli and now when i try to build for android this happens:

Running command: /Users/aplicacionesosgroup/Documents/OSGroup/taoappionic2/hooks/after_prepare/010_add_platform_class.js /Users/aplicacionesosgroup/Documents/OSGroup/taoappionic2
add to body class: platform-android
ANDROID_HOME=/Users/aplicacionesosgroup/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home
null
org.xwalk:xwalk_core_library:17+
:preBuild UP-TO-DATE
:preArmv7DebugBuild UP-TO-DATE
:checkArmv7DebugManifest
:preX86DebugBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:compileDebugAidl
:CordovaLib:generateDebugBuildConfig
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets
:CordovaLib:processDebugManifest
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:compileDebugJavaWithJavacCaught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues


:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:preArmv7ReleaseBuild UP-TO-DATE
:preX86ReleaseBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:compileReleaseAidl
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets
:CordovaLib:processReleaseManifest
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:compileReleaseJavaWithJavacCaught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues


:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportV42400Alpha2Library
:prepareOrgXwalkXwalk_core_library174644810Library
:prepareArmv7DebugDependencies
:compileArmv7DebugAidl
:compileArmv7DebugRenderscript
:generateArmv7DebugBuildConfig
:generateArmv7DebugAssets UP-TO-DATE
:mergeArmv7DebugAssets
:createXwalkCommandLineFileArmv7Debug
:generateArmv7DebugResValues
:generateArmv7DebugResources
:mergeArmv7DebugResources
:processArmv7DebugManifest
:processArmv7DebugResources
:generateArmv7DebugSources
:compileArmv7DebugJavaWithJavacCaught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

 FAILED
Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues


BUILD FAILED

Total time: 34.584 secs
Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:640:11)
    at WriteStream.stream.write (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:535:20) 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

luchillo17 avatar May 11 '16 16:05 luchillo17

It seems related to the latest plugin versions, if i remove the crosswalk plugin it still outputs some of this errors but build is successful in such case.

luchillo17 avatar May 11 '16 18:05 luchillo17

I removed all related to CrossWalk in the package.json, config.xml, plugins/android.json, plugins/ios.json and plugins/fetch.json, then re-added the Crosswalk plugin and now the errors were reduced to 1 and it now compiles ok, still waiting for the last error solution though.

luchillo17 avatar May 11 '16 21:05 luchillo17

Hey! Thanks for opening an issue with us! Would you mind posting the last error you are getting?

jgw96 avatar May 11 '16 21:05 jgw96

Exactly the same as the one repeated like 10 times in the first post.

luchillo17 avatar May 11 '16 23:05 luchillo17

I have the same issue. When I change the xwalkMultipleApk setting to false in the config.xml and I remove the android platform and add it again, then it works. Do note then it is building android-debug.apk. I have found that when it builds the ARM7 version, then I always get the above exception.

0v3rst33r avatar May 17 '16 20:05 0v3rst33r

Using apk: E:/MM2/platforms/android/build/outputs/apk/android-debug.apk
Caught exception:
 TypeError: Invalid data, chunk must be a string or buffer, not function
    at WriteStream.Socket.write (net.js:647:11)
    at WriteStream.stream.write (C:\Users\adils\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\cordova-lib\node_modules\npm\node_modules\ansi\lib\newlines.js:36:21)
    at Socket.<anonymous> (C:\Users\adils\AppData\Roaming\npm\node_modules\ionic\lib\ionic\cordova.js:284:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at Pipe.onread (net.js:542:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

My application runs well on Windows 7 which I have been working for since the last few months. I have copied the application on a different machine having windows 10 as the operating system. When I run the application in android (ionic run android), I get the above error. Is there any thing I need to update in my configuration?

shaikhspear16 avatar Jun 08 '16 12:06 shaikhspear16

My project was made in alpha.42, i updated my config.xml and it still shows that error but at least now it builds ok and works fine in device, if it helps here i put the diff between the old and the fixed versions, also made an ionic state reset:

config.xml:

diff --git a/config.xml b/config.xml
index ...
--- a/config.xml
+++ b/config.xml
@@ -65,14 +65,19 @@
   <preference name="SplashScreenDelay" value="10000"/>
   <preference name="FadeSplashScreenDuration" value="500"/>
   <preference name="SplashMaintainAspectRatio" value="true"/>
-  <preference name="xwalkVersion" value="xwalk_core_library_beta:18+"/>
+  <preference name="xwalkVersion" value="18+"/>
   <preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect"/>
   <preference name="xwalkMode" value="embedded"/>
   <preference name="xwalkMultipleApk" value="true"/>
   <feature name="StatusBar">
     <param name="ios-package" onload="true" value="CDVStatusBar"/>
   </feature>
+  <plugin name="cordova-plugin-device" spec="~1.1.2"/>
+  <plugin name="cordova-plugin-console" spec="~1.0.3"/>
+  <plugin name="cordova-plugin-whitelist" spec="~1.2.2"/>
+  <plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>
+  <plugin name="cordova-plugin-statusbar" spec="~2.1.3"/>
+  <plugin name="ionic-plugin-keyboard" spec="~2.2.0"/>
+  <plugin name="cordova-plugin-x-toast" spec="~2.5.2"/>
   <icon src="resources/android/icon/drawable-xhdpi-icon.png"/>
-  <plugin name="cordova-plugin-x-toast" spec="~2.4.0"/>
-  <engine name="android" spec="~5.1.1"/>
 </widget>

package.json:

diff --git a/package.json b/package.json
index ...
--- a/package.json
+++ b/package.json
@@ -55,17 +55,29 @@
     "cordova-plugin-whitelist",
     "cordova-plugin-statusbar",
     "ionic-plugin-keyboard",
-    "cordova-plugin-x-toast",
     {
       "locator": "https://github.com/apache/cordova-plugin-splashscreen.git",
       "id": "cordova-plugin-splashscreen"
     },
     "cordova-plugin-crosswalk-webview",
-    "cordova-plugin-geolocation"
+    "cordova-plugin-geolocation",
+    "cordova-plugin-compat",
+    "cordova-plugin-x-toast",
+    "cordova-plugin-console"
   ],
   "cordovaPlatforms": [
     "android",
-    "ios"
+    "ios",
+    {
+      "platform": "android",
+      "version": "",
+      "locator": "android"
+    },
+    {
+      "platform": "ios",
+      "version": "",
+      "locator": "ios"
+    }
   ],

luchillo17 avatar Jun 08 '16 12:06 luchillo17

I have the similar problem, but I am NOT using crosswalk at all. I can finally run ionic build android after upgrading cordova from 5.0.0. to 6.2.0, but I still got error below when running ionic run android.

Here is my error: Running command: $SOMEPATH/hooks/after_prepare/010_add_platform_class.js $SOMEPATH add to body class: platform-android Running command: $SOMEPATH/platforms/android/cordova/run

Caught exception: TypeError: invalid data at WriteStream.Socket.write (net.js:617:11) at WriteStream.stream.write ($SOMEPATH/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21) at Socket. ($SOMEPATH/node_modules/ionic/lib/ionic/cordova.js:284:22) at emitOne (events.js:82:20) at Socket.emit (events.js:169:7) at readableAddChunk (_stream_readable.js:146:16) at Socket.Readable.push (_stream_readable.js:110:10) at Pipe.onread (net.js:523:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception: TypeError: invalid data at WriteStream.Socket.write (net.js:617:11) at WriteStream.stream.write ($SOMEPATH/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/ansi/lib/newlines.js:36:21) at Socket. ($SOMEPATH/node_modules/ionic/lib/ionic/cordova.js:284:22) at emitOne (events.js:82:20) at Socket.emit (events.js:169:7) at readableAddChunk (_stream_readable.js:146:16) at Socket.Readable.push (_stream_readable.js:110:10) at Pipe.onread (net.js:523:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Here is the error if I run cordova run android:

Running command: $SOMEPATH/hooks/after_prepare/010_add_platform_class.js $SOMEPATH add to body class: platform-android ANDROID_HOME=$SOMEPATH/android-sdk JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 Error: adb: Command failed with exit code ENOENT

Here is my config.xml (Sorry, github has problem to display the xml nicely): `

TEST Test Test `

Here is part of the package.json: "cordovaPlugins": [ "cordova-plugin-device", "cordova-plugin-console", "cordova-plugin-whitelist", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "ionic-plugin-keyboard", "cordova-plugin-geolocation", "cordova.plugins.diagnostic" ], "cordovaPlatforms": []

Here is my ionic info:

Cordova CLI: 6.2.0 Gulp version: CLI version 3.8.11 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.8-201606151824 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Node Version: v4.2.1

Surprisingly, my app can actually be compiled in phonegap cloud build.

Finally, thanks for this framework, it rocks!

grapemix avatar Jun 25 '16 06:06 grapemix

@grapemix could you update to node 5.x and see if you still have the same issue please? And thanks for the kind words!

jgw96 avatar Jun 27 '16 21:06 jgw96

After upgrading to node 5.x, the error from 'ionic run android' and 'cordova run android' are still the same.

Your system information:

Cordova CLI: 6.2.0 Gulp version: CLI version 3.8.11 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.8-201606151824 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Node Version: v5.12.0

and thanks @jgw96

grapemix avatar Jun 28 '16 04:06 grapemix

I have stumbled across this issue, as I hade the same exception when writing to the stream. It is for the other libraries, but may be it will be helpful also for you. The reason for the exception is actually in the message. You pass a function to the write method. It happens for me as I have updated babel which includes core-js library, and it rewrites all built-in methods, particulary, for String. And we had extensions for strings prototype, which added colors for the console, one of the extensions was bold getter which transformed string into ascii bold. It looked like this: console.log("Hello".green.bold). But as core-js rewrites some built-ins, so the String.prototype.bold is then the function, not the overwritten getter. Now my process.stdout.write('OK'.green.bold); failed with this exception.

Hope it helps.

tenbits avatar Oct 12 '16 20:10 tenbits

@jgw96 Actually, ionic run android was working when we upgraded to rc0 and rc1, but it is suddenly not working. We just gave up wrote our own script to build the package and install package to devices. So we are good. This problem is really low priority anyway.

grapemix avatar Oct 27 '16 05:10 grapemix

I had the same problem and solved this by removing and adding the plugins folder:

sudo rm -rf /plugins

1fabiopereira avatar Jan 19 '17 23:01 1fabiopereira

Maybe a little bit late, but, seems there are many ways this problem.

For me, this problem started when I changed the app name in config.xml, I had to remove iOS platform and add it again to make it work (even tho I was trying to build Android).

Perhaps this info can help to diagnose the problem.

Scombr0 avatar Jul 03 '17 20:07 Scombr0