Visual Studio Cordova cannot build on android - visual-studio-cordova

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 : )

Related

sbt: Getting error output from an external process (yarn)

We run into a problem with 'yarn build' command run from build.sbt:
println(Process("yarn build", frontEndFile).!!)
The output is just:
[info] yarn build 3456
[error] java.lang.RuntimeException: Nonzero exit value: 1
But we don't see the acutal error output from yarn. How can we get that error output from the yarn process?

AppCenter build error: Project firebaseauth_web at : is either no Android app project or build version has not been set to override

I have a mobile project in flutter and I am trying to build it on AppCenter but I got this error:
Project firebaseauth_web at : is either no Android app project or build version has not been set to override. Skipping...
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.3+1/android/build.gradle' line: 22
* What went wrong:
A problem occurred evaluating root project 'firebaseauth_web'.
> Failed to apply plugin [id 'com.android.library']
> Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in /Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.3+1/android/gradle/wrapper/gradle-wrapper.properties to gradle-5.4.1-all.zip
* 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 4s
The plugin firebase_auth_web could not be built due to the issue above.
##[error]The process '/bin/bash' failed with exit code 1
##[error]Bash failed with error: The process '/bin/bash' failed with exit code 1
##[section]Finishing: Post Clone Script
##[section]Starting: Checkout Chofu#master to s
==============================================================================
Task : Get sources
Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version : 1.0.0
Author : Microsoft
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: Chofu (ExternalGit)
##[section]Finishing: Checkout Chofu#master to s
##[section]Starting: Finalize Job
Cleaning up task ***
Start cleaning up orphan processes.
Terminate orphan process: pid (1490) (java)
Terminate orphan process: pid (1470) (java)
Terminate orphan process: pid (1462) (java)
Terminate orphan process: pid (1404) (java)
Terminate orphan process: pid (1289) (adb)
##[section]Finishing: Finalize Job
##[section]Finishing: Build
My gradle version is actually 6.1.1.
Here is my gradle-wrapper.properties from android/gradle code:
...
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
...
I have tried to change the version to 5.4.1 but I got a similar error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/runner/runners/2.170.1/work/1/s/android/app/build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.internal.version-check']
> Minimum supported Gradle version is 6.1.1. Current version is 5.4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/runner/runners/2.170.1/work/1/s/android/gradle/wrapper/gradle-wrapper.properties to gradle-6.1.1-all.zip
* 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 18s
Running Gradle task 'assembleRelease'... 19.8s
Gradle task assembleRelease failed with exit code 1
EDITED:
After a better look I discover other 2 errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':appcenter:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':appcenter_analytics:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
If someone could help me I would be grateful!
After one month of struggle I found how to solve the problem:
I have changed gradle version from android/gradle/wrapper/gradle-wrapper.properties from 6.1.1 to 5.6.2 . So my file looks like:
...
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
...
In android/build.gradle I have changed gradle tool version from 4.0.0 to 3.5.0:
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
...
}
In android/app/build.gradle I have added checkReleaseBuilds false to lintOptions :
lintOptions {
...
checkReleaseBuilds false
}
In android/app/appcenter-post-clone.sh I have added two builds before --release build:
...
# build APK
flutter build apk --debug
flutter build apk --profile
flutter build apk --release
...
I hope this will help others :)

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?

VS2015 build with Cordova-cli#5.4.0 shows deployment errors

Currently, I upgrade my VS2015 Tools for Apache Cordova to update 4, in this version run #5.3.3 well, but change taco.json to run #5.4.0(the newly version) will get the error as follow. It looks like "org.gradle.internal.UncheckedException: java.io.IOException" gradle error.
My question does taco.json support the newly #5.4.0 as well?
2>
2> BUILD SUCCESSFUL
2>
2> Total time: 3.272 secs
2>Picked up _JAVA_OPTIONS: -Xmx512M
2> Built the following apk(s):
2> D:\BlankCordovaApp1\BlankCordovaApp1\platforms\android\build\outputs\apk\android-debug.apk
2> Using apk: D:\BlankCordovaApp1\BlankCordovaApp1\platforms\android\build\outputs\apk\android-debug.apk
2> Installing app on device...
2> Launching application...
2> LAUNCH SUCCESS
2> Command finished with error code 0: cmd /s /c "D:\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\run.bat --buildConfig=D:\BlankCordovaApp1\BlankCordovaApp1\build.json"
2> Executing "after_run" hook for all plugins.
2>
2>Exception in thread "DisconnectableInputStream source reader" org.gradle.internal.UncheckedException: java.io.IOException: Stream Closed
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
I work on the Tools for Apache Cordova in Visual Studio at Microsoft.
We are interpreting the Cordova output from 5.4.0 incorrectly. We think it's telling us there was an error when there actually wasn't one.
We'll fix this in the next update, but for now you can just click "Yes" on that dialog and ignore the warning since there wasn't actually a problem.
Thanks for reporting this to us!

VS2013 Cordova apps Exit code 1

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)

Resources