Giovanni Giovanni - 12 days ago 6
Android Question

Ionic: Android platform build errors

I've been working on an ionic project for a long time now and I've faced a lot of problems. The problem I just bounced on was a new one and I really don't have an idea what to do about it.

I hope you guys could help me through this.

Build:

1>------ Build started: Project: TestProject, Configuration: Debug Android ------
1> ------ Ensuring correct global installation of package from source package di
1> rectory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Exte
1> nsions\ApacheCordovaTools\packages\vs-tac
1> ------ Name from source package.json: vs-tac
1> ------ Version from source package.json: 1.0.42
1> ------ Package already installed globally at correct version.
1> ------ Cordova tools 6.0.0 already installed.
1> ------ Build Settings:
1> ------ Build Settings:
1> ------ platformConfigurationBldDir: D:\workspaces\TestProject\TestProject\
1> bld\Android\Debug
1> ------ platformConfigurationBinDir: D:\workspaces\TestProject\TestProject\
1> bin\Android\Debug
1> ------ buildCommand: build
1> ------ platform: Android
1> ------ cordovaPlatform: android
1> ------ configuration: Debug
1> ------ cordovaConfiguration: Debug
1> ------ projectName: TestProject
1> ------ projectSourceDir: D:\workspaces\TestProject\TestProject
1> ------ npmInstallDir: C:\Users\User\AppData\Roaming\npm
1> ------ buildTarget: AndroidEmulator
1> ------ language: en-US
1> ------ Platform android already exists
1> ------ Updating plugins
1> ------ Currently installed plugins:
1> ------ Currently installed dependent plugins:
1> ------ Currently configured plugins:
1> ------ Preparing platform: android
1> Executing "before_prepare" hook for all plugins.
1> Executing "before_build" hook for all plugins.
1> Resolving module name for q => q
1> Resolving module name for cordova-common => cordova-common
1> Resolving module name for cordova-common => cordova-common
1> Resolving module name for fs => fs
1> Resolving module name for path => path
1> Resolving module name for elementtree => elementtree
1> Searching PlatformJson files for differences between project vs. platform ins
1> talled plugins
1> No differences found between project and android platform. Continuing...
1> Generating config.xml from defaults for platform "android"
1> Found "merges" for android platform. Copying over existing "www" files.
1> Wrote out Android application name to "TestProject"
1> Wrote out Android package name to "com.testProject.kandidatenapp"
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> hdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-hdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-ldpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-mdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-xhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-xxhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-xxxhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> ldpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> mdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-hdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-ldpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-mdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-xhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-xxhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-xxxhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> xhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> xxhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> xxxhdpi\icon.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\ic
1> on\drawable-ldpi-icon.png to D:\workspaces\TestProject\TestProject\platforms\
1> android\res\drawable-ldpi\icon.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\ic
1> on\drawable-mdpi-icon.png to D:\workspaces\TestProject\TestProject\platforms\
1> android\res\drawable-mdpi\icon.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\ic
1> on\drawable-hdpi-icon.png to D:\workspaces\TestProject\TestProject\platforms\
1> android\res\drawable-hdpi\icon.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\ic
1> on\drawable-xhdpi-icon.png to D:\workspaces\TestProject\TestProject\platforms
1> \android\res\drawable-xhdpi\icon.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\ic
1> on\drawable-xxhdpi-icon.png to D:\workspaces\TestProject\TestProject\platform
1> s\android\res\drawable-xxhdpi\icon.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\ic
1> on\drawable-xxxhdpi-icon.png to D:\workspaces\TestProject\TestProject\platfor
1> ms\android\res\drawable-xxxhdpi\icon.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> hdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-hdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-ldpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-mdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-xhdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-xxhdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> land-xxxhdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> ldpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> mdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-hdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-ldpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-mdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-xhdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-xxhdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> port-xxxhdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> xhdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> xxhdpi\screen.png
1> Deleted D:\workspaces\TestProject\TestProject\platforms\android\res\drawable-
1> xxxhdpi\screen.png
1> splash screens: [{"src":"resources\\android\\splash\\drawable-land-ldpi-scree
1> n.png","density":"land-ldpi","platform":"android"},{"src":"resources\\android
1> \\splash\\drawable-land-mdpi-screen.png","density":"land-mdpi","platform":"an
1> droid"},{"src":"resources\\android\\splash\\drawable-land-hdpi-screen.png","d
1> ensity":"land-hdpi","platform":"android"},{"src":"resources\\android\\splash\
1> \drawable-land-xhdpi-screen.png","density":"land-xhdpi","platform":"android"}
1> ,{"src":"resources\\android\\splash\\drawable-land-xxhdpi-screen.png","densit
1> y":"land-xxhdpi","platform":"android"},{"src":"resources\\android\\splash\\dr
1> awable-land-xxxhdpi-screen.png","density":"land-xxxhdpi","platform":"android"
1> },{"src":"resources\\android\\splash\\drawable-port-ldpi-screen.png","density
1> ":"port-ldpi","platform":"android"},{"src":"resources\\android\\splash\\drawa
1> ble-port-mdpi-screen.png","density":"port-mdpi","platform":"android"},{"src":
1> "resources\\android\\splash\\drawable-port-hdpi-screen.png","density":"port-h
1> dpi","platform":"android"},{"src":"resources\\android\\splash\\drawable-port-
1> xhdpi-screen.png","density":"port-xhdpi","platform":"android"},{"src":"resour
1> ces\\android\\splash\\drawable-port-xxhdpi-screen.png","density":"port-xxhdpi
1> ","platform":"android"},{"src":"resources\\android\\splash\\drawable-port-xxx
1> hdpi-screen.png","density":"port-xxxhdpi","platform":"android"}]
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-land-ldpi-screen.png to D:\workspaces\TestProject\TestProject\p
1> latforms\android\res\drawable-land-ldpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-land-mdpi-screen.png to D:\workspaces\TestProject\TestProject\p
1> latforms\android\res\drawable-land-mdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-land-hdpi-screen.png to D:\workspaces\TestProject\TestProject\p
1> latforms\android\res\drawable-land-hdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-land-xhdpi-screen.png to D:\workspaces\TestProject\TestProject\
1> platforms\android\res\drawable-land-xhdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-land-xxhdpi-screen.png to D:\workspaces\TestProject\TestProject
1> \platforms\android\res\drawable-land-xxhdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-land-xxxhdpi-screen.png to D:\workspaces\TestProject\MeesterBaa
1> n\platforms\android\res\drawable-land-xxxhdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-port-ldpi-screen.png to D:\workspaces\TestProject\TestProject\p
1> latforms\android\res\drawable-port-ldpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-port-mdpi-screen.png to D:\workspaces\TestProject\TestProject\p
1> latforms\android\res\drawable-port-mdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-port-hdpi-screen.png to D:\workspaces\TestProject\TestProject\p
1> latforms\android\res\drawable-port-hdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-port-xhdpi-screen.png to D:\workspaces\TestProject\TestProject\
1> platforms\android\res\drawable-port-xhdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-port-xxhdpi-screen.png to D:\workspaces\TestProject\TestProject
1> \platforms\android\res\drawable-port-xxhdpi\screen.png
1> copying image from D:\workspaces\TestProject\TestProject\resources\android\sp
1> lash\drawable-port-xxxhdpi-screen.png to D:\workspaces\TestProject\MeesterBaa
1> n\platforms\android\res\drawable-port-xxxhdpi\screen.png
1> updated project successfully
1> Executing "after_prepare" hook for all plugins.
1> Running command: C:\Users\User\AppData\Roaming\Microsoft\VisualStudio\MDA
1> \vs-npm\2.14.9\node.exe D:\workspaces\TestProject\TestProject\hooks\after_pre
1> pare\010_add_platform_class.js D:\workspaces\TestProject\TestProject
1>MSBUILD : cordova-build error : net.js:635
1> net.js:635
1>MSBUILD : cordova-build error : throw new TypeError('invalid data');
1> throw new TypeError('invalid data');
1>MSBUILD : cordova-build error : ^
1> ^
1>MSBUILD : cordova-build error : TypeError: invalid data
1> TypeError invalid data
1>MSBUILD : cordova-build error : at Socket.write (net.js:635:11)
1> at Socket.write (net.js:635:11)
1>MSBUILD : cordova-build error : at Object.<anonymous> (D:\workspaces\MeesterBa
1>an\TestProject\hooks\after_prepare\010_add_platform_class.js:90:22)
1> at Object.<anonymous> (D:\workspaces\TestProject\TestProject\hooks\after_
1> prepare\010_add_platform_class.js:90:22)
1>MSBUILD : cordova-build error : at Module._compile (module.js:460:26)
1> at Module._compile (module.js:460:26)
1>MSBUILD : cordova-build error : at Object.Module._extensions..js (module.js:47
1>8:10)
1> at Object.Module._extensions..js (module.js:478:10)
1>MSBUILD : cordova-build error : at Module.load (module.js:355:32)
1> at Module.load (module.js:355:32)
1>MSBUILD : cordova-build error : at Function.Module._load (module.js:310:12)
1> at Function.Module._load (module.js:310:12)
1>MSBUILD : cordova-build error : at Function.Module.runMain (module.js:501:10)
1> at Function.Module.runMain (module.js:501:10)
1>MSBUILD : cordova-build error : at startup (node.js:129:16)
1> at startup (node.js:129:16)
1>MSBUILD : cordova-build error : at node.js:814:3
1> at node.js:814:3
1> Command finished with error code 1: C:\Users\User\AppData\Roaming\Microso
1> ft\VisualStudio\MDA\vs-npm\2.14.9\node.exe D:\workspaces\TestProject\MeesterB
1> aan\hooks\after_prepare\010_add_platform_class.js,D:\workspaces\TestProject\M
1> eesterBaan
1>MSBUILD : cordova-build error : Error: Hook failed with error code 1: D:\worksp
1>aces\TestProject\TestProject\hooks\after_prepare\010_add_platform_class.js
1> Error Hook failed with error code 1: D:\workspaces\TestProject\TestProject\ho
1> oks\after_prepare\010_add_platform_class.js
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I am using Team Foundation Server as source control. I've checked in everything.

I really don't have a clue what is going wrong here. Hope I don't get down voted, because of the small information.

Greetings,

Giovanni

Answer

The problem was indeed related to the team foundation source control. I'd to check out the index.html to make it work again. I've found the answer on Error executing 010_add_platform_class.js using VS Tools for Apache Cordova

This was the solution to my problem!

Comments