VS2013 Cordova apps Exit code 1 - visual-studio-cordova

I am working on a cordova app using VS2013 tools for cordova and typescript.
I recently updated node and then i started getting this error
Building platform: android (TaskId:22)
1> Debug (TaskId:22)
1> ------ Build configuration options: --debug (TaskId:22)
1> Running command: E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\build.bat --debug (TaskId:22)
1> E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\node_modules\q\q.js:126 (TaskId:22)
1> throw e; (TaskId:22)
1> ^ (TaskId:22)
1> TypeError: Cannot read property 'prepEnv' of undefined (TaskId:22)
1> at Object.module.exports.run (E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\lib\build.js:326:19) (TaskId:22)
1> at E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\build:36:22 (TaskId:22)
1> at _fulfilled (E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\node_modules\q\q.js:798:54) (TaskId:22)
1> at self.promiseDispatch.done (E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\node_modules\q\q.js:827:30) (TaskId:22)
1> at Promise.promise.promiseDispatch (E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\node_modules\q\q.js:760:13) (TaskId:22)
1> at E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\node_modules\q\q.js:574:44 (TaskId:22)
1> at flush (E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\node_modules\q\q.js:108:17) (TaskId:22)
1> at process._tickCallback (node.js:355:11) (TaskId:22)
1> Command finished with error code 1: E:\Apps\myapp\myapp\bld\Debug\platforms\android\cordova\build.bat --debug,, (TaskId:22)

Looks like this is a known issue, adding a space to the project's path fixes it:
https://connect.microsoft.com/VisualStudio/feedback/details/1192337/tools-for-apache-cordova-ctp-3-1-cant-build-for-android
Note this happens only when targeting Android on CTP3.1.

I had the same problem. I remove node.js and reinstalled it. And I had to set my system variable for JAVA_HOME and JAVA like in this answer cordova platform add android get an error in JAVA_HOME (without (x86) despite it is in C:\Program Files (x86)).

I have exact same error but in 2015 CTP 6. I have correct JAVA_HOME.
Here is my env.
angularjs 1.3.14
jQuery 1.8.0
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_40
ADT_HOME =
C:\Users\MyUserName\AppData\Local\Android\android-sdk
ANT_HOME =C:\apache-ant-1.9.4-bin\apache-ant-1.9.4
Node.js verion 0.12.2
Everything works fine in Android and Ripple. I get this error while compiling for device. Device is connected.
....\bld\Debug\platforms\android\cordova\node_modules\q\q.js:126 (TaskId:11)
throw e; (TaskId:11)
^ (TaskId:11)
TypeError: Cannot read property 'prepEnv' of undefined (TaskId:11)
at process._tickCallback (node.js:355:11) (TaskId:11)

Related

Ionic cordova build failed on ios

The following build commands failed:
PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /var/root/Library/Developer/Xcode/DerivedData/APPNAME-amivxpiudfokodaybfmgyefynkvt/Build/Intermediates.noindex/EzSchoolApps.build/Debug-iphonesimulator/EzSchoolApps.build/Script-2E6AFD309B981ED6E1842543.sh
(1 failure)
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running sub process Cordova.
Cordova build iOS exited with exit code 65.
How to resolve above issue..?

MSBuild Error: Reading build config file results in cordova-build error : TypeError: undefined is not a function -Android

I ran in to this problem while performing Apache cordova build through visual studio-2015 i get this following error.
VS2015;
npm -v - 5.7.1
Node -v 8.8.0
Cordova tools 6.5.0
Android project created with cordova-android#6.4.0
Last few lines of error log
> Prepared android project successfully
> No scripts found for hook "after_prepare".
> Checking config.xml for saved plugins that haven't been added to the project
> ------ Copied C:\Project\Mobile\bin\Android\Debug\VSBuildInfo.xml to platforms\android\assets\www\VSBuildInfo.xml
> ------ Building platform: android
> Debug
> ------ Build configuration options: --debug
> No scripts found for hook "before_compile".
> ANDROID_HOME=C:\Users\<username>\AppData\Local\Android\sdk
> JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
> Reading build config file: C:\Project\Mobile\build.json
> MSBUILD : cordova-build error : TypeError: undefined is not a function
> TypeError undefined is not a function
Any help is appreciated.
I think is node version related issue.
After a few try to build with VS Cordova Tools and latest version of Cordova, i have encountred some issues on latest node versions.
Try to downgrade node to Node 4.8.7 LTS
https://nodejs.org/en/blog/release/v4.8.7/

Port framework 4.6 to asp.net core 1

I can't build a few test proyect that we have migrated from fwk 4.6 to asp.net core 1.
Here are the output result of build:
15>------ Rebuild All started: Project: EbookingCoreTest, Configuration: Debug Any CPU ------
15>Build started 31/8/2016 7:42:47 p. m..
15> 1>
15>CoreCompile:
15> C:\Program Files\dotnet\dotnet.exe build "D:\eBookingV4\tst\EbookingCoreTest" --configuration Debug --no-dependencies --no-incremental
15> Project EbookingCoreTest (.NETStandard,Version=v1.6) will be compiled because project is not safe for incremental compilation. Use --build-profile flag for more information.
15> Compiling EbookingCoreTest for .NETStandard,Version=v1.6
15> 1>
15>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : Can not find runtime target for framework '.NETStandard,Version=v1.6' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes:
15> 1>
15>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : 1. The project has not been restored or restore failed - run dotnet restore
15> 1>
15>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : 2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.
15> 1>
15>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : 3. You may be trying to publish a library, which is not supported. Use dotnet pack to distribute libraries.
15>
15>Build FAILED.
15>
dotnet --info
.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Anybody know why is this error?
My guess is that you probably have to include this in you project.json as exactly described in the error message
"runtimes": {
"win10-x64": {}
}
But that would have been better to include your full project.json with your question. We have too few information now.

cordova error running visual studio 2015 in parallels

What went wrong:
1> Unable to start the daemon process.
1> This problem might be caused by incorrect configuration of the daemon.
1> For example, an unrecognized jvm option is used.
1> Please refer to the user guide chapter on the daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
1> Please read the following process output to find out more:
1> -----------------------
1> java.lang.IllegalArgumentException: URI has an authority component
1> at java.io.File.(File.java:423)
1> at org.gradle.internal.classloader.ClasspathUtil.getClasspathForClass(ClasspathUtil.java:67)
1> at org.gradle.api.internal.classpath.DefaultModuleRegistry.findDistDir(DefaultModuleRegistry.java:75)
1> at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:55)
1> at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:44)
1> at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
1> at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)
1>
1>
1> * Try:
1> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Check your folder sharing settings on the windows side of parallels. Does it work without sharing?

Visual Studio Cordova cannot build on android

I got the following error at output when I build the code to android device.
1>------ Clean started: Project: Shhh...ItWorks, Configuration: Debug Android ------
1> ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
1> JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_55
1> Running: C:\app\TW Secret\11232015\Shhh...ItWorks_\Shhh...ItWorks\platforms\android\gradlew clean -b C:\app\TW Secret\11232015\Shhh...ItWorks_\Shhh...ItWorks\platforms\android\build.gradle -Dorg.gradle.daemon=true
1>
1> FAILURE: Build failed with an exception.
1>
1> * What went wrong:
1> A problem occurred configuring root project 'android'.
1> > Could not resolve all dependencies for configuration ':_debugCompile'.
1> > Could not find any version that matches com.android.support:support-v13:23+.
1> Searched in the following locations:
1> https://repo1.maven.org/maven2/com/android/support/support-v13/maven-metadata.xml
1> https://repo1.maven.org/maven2/com/android/support/support-v13/
1> Required by:
1> :android:unspecified
1> > Could not find any version that matches com.google.android.gms:play-services-gcm:+.
1> Searched in the following locations:
1> https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml
1> https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/
1> Required by:
1> :android:unspecified
1>
1> * Try:
1> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>
1> BUILD FAILED
1>
1> Total time: 2.267 secs
1> Picked up _JAVA_OPTIONS: -Xmx512M
1>
1> C:\app\TW Secret\11232015\Shhh...ItWorks_\Shhh...ItWorks\platforms\android\cordova\node_modules\q\q.js:126
1> throw e;
1> ^
1> Error code 1 for command: cmd with args: /s /c ""C:\app\TW Secret\11232015\Shhh...ItWorks_\Shhh...ItWorks\platforms\android\gradlew" clean -b "C:\app\TW Secret\11232015\Shhh...ItWorks_\Shhh...ItWorks\platforms\android\build.gradle" -Dorg.gradle.daemon=true"
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets(354,5): error MSB3073: The command "platforms\android\cordova\clean.bat" exited with code 1.
========== Clean: 0 succeeded, 1 failed, 0 skipped ==========
And when I tried to clean the solution it shows this error:
Severity Code Description Project File Line
Error MSB3073 The command "platforms\android\cordova\clean.bat" exited with code 1. Shhh...ItWorks C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets
I'm using Cordova 5.3.3
Does anyone knows how to fix this?
After removing and reinstalling plugins one by one, I found out it's the push plugin that is conflicting with the local notification plugin, remove one or another fix the problem : )

Resources