Streamline CI setup for your Apache Cordova, PhoneGap, Ionic, or Cordova CLI compatible app using a set of useful pre-defined build steps for VS Team Services or TFS
There is an issue with the new version of cordova-android and the VSTS Cordova build tasks. It seems that in the new version (6.4.0) the output directory has changed slightly and therefore the VSTS build tasks cannot find the APK to copy.
What we are seeing is the task successfully building and the APK is being written to the outputs directory, but not the correct one or at least not the same directory the VSTS task is expecting. The result is this: Error: Not found apkFile.
When running cordova build android --release with cordova-android@6.4.0 as a platform the output directory for the APK is the following:
platforms/android/build/outputs/apk/release/android-release.apk, this is causing the VSTS build to fail as the task is expecting the APK to be here: platforms/android/build/outputs/apk/android-release.apk.
Downgrading to cordova-android@6.3.0 allows the VSTS build task to continue and copy the APKs.
Here is my build log...
```
2017-11-15T08:28:52.9769030Z ==============================================================================
2017-11-15T08:28:52.9780380Z Task : Cordova Build
2017-11-15T08:28:52.9791740Z Description : Build a hybrid app project based on the Cordova CLI, Ionic CLI, TACO CLI, or other Cordova-compliant CLI
2017-11-15T08:28:52.9803160Z Version : 1.3.11
2017-11-15T08:28:52.9814400Z Author : Microsoft Corporation
2017-11-15T08:28:52.9825990Z Help : [More Information](http://go.microsoft.com/fwlink/?LinkID=691186)
2017-11-15T08:28:52.9837390Z ==============================================================================
2017-11-15T08:28:53.5295460Z Building Android on OSX. Add "cmd" as a "Demand" under "General" to your build definition to cause the build to always route to a Windows agent.
2017-11-15T08:28:53.5317910Z Module cache at /Users/robfinbow/.taco_home/node_modules
2017-11-15T08:28:54.1094650Z cordova@7.0.1 already installed.
2017-11-15T08:28:55.9652090Z Module cache at /Users/robfinbow/.taco_home/node_modules
2017-11-15T08:28:56.5241390Z cordova@7.0.1 already installed.
2017-11-15T08:28:56.8840080Z Adding support plugin.
2017-11-15T08:28:58.3171700Z Platform android already added.
2017-11-15T08:28:58.3184110Z Queueing build for platform android w/options: --release,--archs=x86 arm,--device,--gradleArg=--no-daemon
2017-11-15T08:28:58.3609050Z Before deploy hook started...
2017-11-15T08:28:58.3620740Z Checking is node modules installed...
2017-11-15T08:28:58.3632430Z Node modules already installed.
2017-11-15T08:28:58.3644200Z Cordova hook completed. Resuming to run your cordova command...
2017-11-15T08:28:58.3774460Z Processing res/native for android
2017-11-15T08:28:58.7323560Z ANDROID_HOME=/Users/robfinbow/Library/Android/sdk
2017-11-15T08:28:58.7337500Z JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
2017-11-15T08:28:59.6679530Z :wrapper
2017-11-15T08:28:59.6685560Z
2017-11-15T08:28:59.6696830Z BUILD SUCCESSFUL in 0s
2017-11-15T08:28:59.6708380Z 1 actionable task: 1 executed
2017-11-15T08:29:00.9891950Z Subproject Path: CordovaLib
2017-11-15T08:29:01.4606650Z To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.1/userguide/gradle_daemon.html.
2017-11-15T08:29:02.3695670Z Daemon will be stopped at the end of the build stopping after processing
2017-11-15T08:29:05.2531210Z Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead.
2017-11-15T08:29:05.4147090Z The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
2017-11-15T08:29:05.4179480Z at build_7k5jst7r8waaa9o5h7gkx14xg.run(/Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/build.gradle:144)
2017-11-15T08:29:07.6564000Z publishNonDefault is deprecated and has no effect anymore. All variants are now published.
2017-11-15T08:29:08.4418620Z :preBuild UP-TO-DATE
2017-11-15T08:29:08.4542230Z :CordovaLib:preBuild UP-TO-DATE
2017-11-15T08:29:08.4571590Z :CordovaLib:preReleaseBuild UP-TO-DATE
2017-11-15T08:29:08.5052830Z :CordovaLib:checkReleaseManifest
2017-11-15T08:29:08.6461450Z :CordovaLib:processReleaseManifest
2017-11-15T08:29:09.3784150Z :preReleaseBuild
2017-11-15T08:29:09.3807690Z :CordovaLib:compileReleaseAidl
2017-11-15T08:29:09.4614560Z :compileReleaseAidl
2017-11-15T08:29:09.4644070Z :CordovaLib:packageReleaseRenderscript NO-SOURCE
2017-11-15T08:29:09.4664810Z :compileReleaseRenderscript
2017-11-15T08:29:09.4685420Z :checkReleaseManifest
2017-11-15T08:29:09.4809630Z :generateReleaseBuildConfig
2017-11-15T08:29:09.4831410Z :prepareLintJar
2017-11-15T08:29:09.4856960Z :generateReleaseResValues
2017-11-15T08:29:09.4877730Z :generateReleaseResources
2017-11-15T08:29:09.5374480Z :CordovaLib:compileReleaseRenderscript
2017-11-15T08:29:09.5395000Z :CordovaLib:generateReleaseResValues
2017-11-15T08:29:09.5416390Z :CordovaLib:generateReleaseResources
2017-11-15T08:29:09.5598370Z :CordovaLib:packageReleaseResources
2017-11-15T08:29:28.5529210Z :mergeReleaseResources
2017-11-15T08:29:28.5744650Z :createReleaseCompatibleScreenManifests
2017-11-15T08:29:28.7234610Z :processReleaseManifest
2017-11-15T08:29:28.7254560Z :splitsDiscoveryTaskRelease
2017-11-15T08:29:28.8327420Z :CordovaLib:platformAttrExtractor
2017-11-15T08:29:28.8353870Z :CordovaLib:generateReleaseBuildConfig
2017-11-15T08:29:28.8379050Z :CordovaLib:prepareLintJar
2017-11-15T08:29:28.8442850Z :CordovaLib:javaPreCompileRelease
2017-11-15T08:29:28.8465390Z :CordovaLib:processReleaseJavaRes NO-SOURCE
2017-11-15T08:29:28.8486410Z :compileReleaseNdk NO-SOURCE
2017-11-15T08:29:28.8577100Z :mergeReleaseShaders
2017-11-15T08:29:28.8673570Z :compileReleaseShaders
2017-11-15T08:29:28.8702690Z :generateReleaseAssets
2017-11-15T08:29:28.8786590Z :CordovaLib:mergeReleaseShaders
2017-11-15T08:29:28.8821420Z :CordovaLib:compileReleaseShaders
2017-11-15T08:29:28.8855280Z :CordovaLib:generateReleaseAssets
2017-11-15T08:29:28.8896200Z :CordovaLib:mergeReleaseAssets
2017-11-15T08:29:29.1082520Z :mergeReleaseAssets
2017-11-15T08:29:29.1211140Z :mergeReleaseJniLibFolders
2017-11-15T08:29:29.1245550Z :CordovaLib:compileReleaseNdk NO-SOURCE
2017-11-15T08:29:29.1279720Z :CordovaLib:mergeReleaseJniLibFolders
2017-11-15T08:29:29.2152470Z :CordovaLib:transformNativeLibsWithMergeJniLibsForRelease
2017-11-15T08:29:29.2181540Z :CordovaLib:transformNativeLibsWithIntermediateJniLibsForRelease
2017-11-15T08:29:29.2259820Z :processReleaseJavaRes NO-SOURCE
2017-11-15T08:29:29.2277820Z :validateSigningRelease
2017-11-15T08:29:29.3227540Z :CordovaLib:processReleaseResources
2017-11-15T08:29:29.8968790Z :processReleaseResources
2017-11-15T08:29:29.8985630Z :generateReleaseSources
2017-11-15T08:29:29.9002620Z :CordovaLib:generateReleaseSources
2017-11-15T08:29:31.3096220Z Note: Some input files use or override a deprecated API.
2017-11-15T08:29:31.3122750Z Note: Recompile with -Xlint:deprecation for details.
2017-11-15T08:29:31.3942380Z :CordovaLib:compileReleaseJavaWithJavac
2017-11-15T08:29:31.4373800Z :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease
2017-11-15T08:29:31.7469200Z :javaPreCompileRelease
2017-11-15T08:29:33.1840600Z Note: Some input files use or override a deprecated API.
2017-11-15T08:29:33.1876160Z Note: Recompile with -Xlint:deprecation for details.
2017-11-15T08:29:33.1911160Z Note: Some input files use unchecked or unsafe operations.
2017-11-15T08:29:33.1942490Z Note: Recompile with -Xlint:unchecked for details.
2017-11-15T08:29:34.5873260Z :compileReleaseJavaWithJavac
2017-11-15T08:29:34.5902390Z :compileReleaseSources
2017-11-15T08:29:36.3986320Z :transformClassesWithPreDexForRelease
2017-11-15T08:29:37.2977030Z :transformDexWithDexForRelease
2017-11-15T08:29:38.0582170Z :transformNativeLibsWithMergeJniLibsForRelease
2017-11-15T08:29:38.3475670Z :transformResourcesWithMergeJavaResForRelease
2017-11-15T08:29:46.8181660Z :packageRelease
2017-11-15T08:29:55.8644220Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/src/cordova/plugins/Diagnostic.java:446: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing this.cordova.getActivity() to this.cordova.getActivity().getApplicationContext() [WifiManagerLeak]
2017-11-15T08:29:55.8708490Z WifiManager wifiManager = (WifiManager) this.cordova.getActivity().getSystemService(Context.WIFI_SERVICE);
2017-11-15T08:29:55.8745380Z ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-11-15T08:29:55.8785580Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/src/cordova/plugins/Diagnostic.java:536: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing this.cordova.getActivity() to this.cordova.getActivity().getApplicationContext() [WifiManagerLeak]
2017-11-15T08:29:55.8821200Z WifiManager wifiManager = (WifiManager) this.cordova.getActivity().getSystemService(Context.WIFI_SERVICE);
2017-11-15T08:29:55.8843080Z ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-11-15T08:29:55.8855780Z
2017-11-15T08:29:55.8876070Z Explanation for issues of type "WifiManagerLeak":
2017-11-15T08:29:55.8905100Z On versions prior to Android N (24), initializing the WifiManager via
2017-11-15T08:29:55.8939680Z Context#getSystemService can cause a memory leak if the context is not the
2017-11-15T08:29:55.8967560Z application context. Change context.getSystemService(...) to
2017-11-15T08:29:55.8989680Z context.getApplicationContext().getSystemService(...).
2017-11-15T08:29:55.8998140Z
2017-11-15T08:29:55.9038170Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values/arrays.xml:3: Error: "country_codes" is not translated in "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "es" (Spanish), "eu" (Basque), "fi" (Finnish), "fr" (French), "he" (Hebrew), "hi" (Hindi), "hu" (Hungarian), "id" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ko" (Korean), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "ru" (Russian), "sk" (Slovak), "sl" (Slovenian), "sv" (Swedish), "tr" (Turkish), "zh-CN" (Chinese: China), "zh-TW" (Chinese: Taiwan) [MissingTranslation]
2017-11-15T08:29:55.9062090Z
2017-11-15T08:29:55.9084470Z ~~~~~~~~~~~~~~~~~~~~
2017-11-15T08:29:55.9119660Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values/strings.xml:3: Error: "app_name" is not translated in "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "es" (Spanish), "eu" (Basque), "fi" (Finnish), "fr" (French), "he" (Hebrew), "hi" (Hindi), "hu" (Hungarian), "id" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ko" (Korean), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "ru" (Russian), "sk" (Slovak), "sl" (Slovenian), "sv" (Swedish), "tr" (Turkish), "zh-CN" (Chinese: China), "zh-TW" (Chinese: Taiwan) [MissingTranslation]
2017-11-15T08:29:55.9157130Z Tempest Photography
2017-11-15T08:29:55.9191030Z ~~~~~~~~~~~~~~~
2017-11-15T08:29:55.9224750Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values/strings.xml:4: Error: "launcher_name" is not translated in "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "es" (Spanish), "eu" (Basque), "fi" (Finnish), "fr" (French), "he" (Hebrew), "hi" (Hindi), "hu" (Hungarian), "id" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ko" (Korean), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "ru" (Russian), "sk" (Slovak), "sl" (Slovenian), "sv" (Swedish), "tr" (Turkish), "zh-CN" (Chinese: China), "zh-TW" (Chinese: Taiwan) [MissingTranslation]
2017-11-15T08:29:55.9264280Z @string/app_name
2017-11-15T08:29:55.9295980Z ~~~~~~~~~~~~~~~~~~~~
2017-11-15T08:29:55.9336780Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values/strings.xml:5: Error: "activity_name" is not translated in "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "es" (Spanish), "eu" (Basque), "fi" (Finnish), "fr" (French), "he" (Hebrew), "hi" (Hindi), "hu" (Hungarian), "id" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ko" (Korean), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "ru" (Russian), "sk" (Slovak), "sl" (Slovenian), "sv" (Swedish), "tr" (Turkish), "zh-CN" (Chinese: China), "zh-TW" (Chinese: Taiwan) [MissingTranslation]
2017-11-15T08:29:55.9376100Z @string/launcher_name
2017-11-15T08:29:55.9398340Z ~~~~~~~~~~~~~~~~~~~~
2017-11-15T08:29:55.9408620Z
2017-11-15T08:29:55.9428670Z Explanation for issues of type "MissingTranslation":
2017-11-15T08:29:55.9449750Z If an application has more than one locale, then all the strings declared
2017-11-15T08:29:55.9471170Z in one language should also be translated in all other languages.
2017-11-15T08:29:55.9481700Z
2017-11-15T08:29:55.9501860Z If the string should not be translated, you can add the attribute
2017-11-15T08:29:55.9536890Z translatable="false" on the element, or you can define all your
2017-11-15T08:29:55.9559520Z non-translatable strings in a resource file called donottranslate.xml. Or,
2017-11-15T08:29:55.9585370Z you can ignore the issue with a tools:ignore="MissingTranslation"
2017-11-15T08:29:55.9612010Z attribute.
2017-11-15T08:29:55.9622140Z
2017-11-15T08:29:55.9642250Z By default this detector allows regions of a language to just provide a
2017-11-15T08:29:55.9677340Z subset of the strings and fall back to the standard language strings. You
2017-11-15T08:29:55.9713610Z can require all regions to provide a full translation by setting the
2017-11-15T08:29:55.9736060Z environment variable ANDROID_LINT_COMPLETE_REGIONS.
2017-11-15T08:29:55.9751500Z
2017-11-15T08:29:55.9786860Z You can tell lint (and other tools) which language is the default language
2017-11-15T08:29:55.9816970Z in your res/values/ folder by specifying tools:locale="languageCode" for
2017-11-15T08:29:55.9849030Z the root element in your resource file. (The tools prefix
2017-11-15T08:29:55.9880270Z refers to the namespace declaration http://schemas.android.com/tools.)
2017-11-15T08:29:55.9898990Z
2017-11-15T08:29:55.9928180Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-ar/strings.xml:64: Error: "menu_settings" is translated here but not found in default locale [ExtraTranslation]
2017-11-15T08:29:55.9956460Z إعدادات
2017-11-15T08:29:55.9989130Z ~~~~~~~~~~~~~~~~~~~~
2017-11-15T08:29:56.0017460Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-bg/strings.xml:64: Also translated here
2017-11-15T08:29:56.0042300Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-ca/strings.xml:64: Also translated here
2017-11-15T08:29:56.0064840Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-cs/strings.xml:64: Also translated here
2017-11-15T08:29:56.0097620Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-da/strings.xml:64: Also translated here
2017-11-15T08:29:56.0132810Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-de/strings.xml:64: Also translated here
2017-11-15T08:29:56.0167510Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-el/strings.xml:64: Also translated here
2017-11-15T08:29:56.0201410Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-es/strings.xml:64: Also translated here
2017-11-15T08:29:56.0234940Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-eu/strings.xml:64: Also translated here
2017-11-15T08:29:56.0268950Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-fi/strings.xml:64: Also translated here
2017-11-15T08:29:56.0302160Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-fr/strings.xml:64: Also translated here
2017-11-15T08:29:56.0336260Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-he/strings.xml:64: Also translated here
2017-11-15T08:29:56.0370020Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-hi/strings.xml:64: Also translated here
2017-11-15T08:29:56.0404400Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-hu/strings.xml:64: Also translated here
2017-11-15T08:29:56.0438370Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-id/strings.xml:64: Also translated here
2017-11-15T08:29:56.0464560Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-it/strings.xml:64: Also translated here
2017-11-15T08:29:56.0486150Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-iw/strings.xml:64: Also translated here
2017-11-15T08:29:56.0509980Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-ja/strings.xml:64: Also translated here
2017-11-15T08:29:56.0531410Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-ko/strings.xml:64: Also translated here
2017-11-15T08:29:56.0556470Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-nl/strings.xml:64: Also translated here
2017-11-15T08:29:56.0584610Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-pl/strings.xml:64: Also translated here
2017-11-15T08:29:56.0619210Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-pt/strings.xml:64: Also translated here
2017-11-15T08:29:56.0648000Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-ru/strings.xml:64: Also translated here
2017-11-15T08:29:56.0672960Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-sk/strings.xml:64: Also translated here
2017-11-15T08:29:56.0694520Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-sl/strings.xml:64: Also translated here
2017-11-15T08:29:56.0715980Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-sv/strings.xml:64: Also translated here
2017-11-15T08:29:56.0738140Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-tr/strings.xml:64: Also translated here
2017-11-15T08:29:56.0768260Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-zh-rCN/strings.xml:64: Also translated here
2017-11-15T08:29:56.0795580Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values-zh-rTW/strings.xml:64: Also translated here
2017-11-15T08:29:56.0805570Z
2017-11-15T08:29:56.0825960Z Explanation for issues of type "ExtraTranslation":
2017-11-15T08:29:56.0847170Z If a string appears in a specific language translation file, but there is
2017-11-15T08:29:56.0880160Z no corresponding string in the default locale, then this string is probably
2017-11-15T08:29:56.0912840Z unused. (It's technically possible that your application is only intended
2017-11-15T08:29:56.0945540Z to run in a specific locale, but it's still a good idea to provide a
2017-11-15T08:29:56.0968480Z fallback.).
2017-11-15T08:29:56.0978590Z
2017-11-15T08:29:56.0997740Z Note that these strings can lead to crashes if the string is looked up on
2017-11-15T08:29:56.1029730Z any locale not providing a translation, so it's important to clean them
2017-11-15T08:29:56.1063110Z up.
2017-11-15T08:29:56.1079550Z
2017-11-15T08:29:56.1112610Z 7 errors, 0 warnings
2017-11-15T08:29:56.1145040Z :lintVitalRelease
2017-11-15T08:29:56.1177220Z :assembleRelease
2017-11-15T08:29:56.1209290Z :cdvBuildRelease
2017-11-15T08:29:56.1225210Z
2017-11-15T08:29:56.1257800Z BUILD SUCCESSFUL in 54s
2017-11-15T08:29:56.1293060Z 44 actionable tasks: 44 executed
2017-11-15T08:29:57.9427940Z Module cache at /Users/robfinbow/.taco_home/node_modules
2017-11-15T08:29:58.7626350Z cordova@7.0.1 already installed.
2017-11-15T08:29:58.7646650Z Platform android does not require a separate package step.
2017-11-15T08:29:58.7735170Z Copying /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/ant-build/*.apk to /Users/robfinbow/VSTS-Agent/_work/1/s/bin/android/release
2017-11-15T08:29:58.7752950Z Copying /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/bin/*.apk to /Users/robfinbow/VSTS-Agent/_work/1/s/bin/android/release
2017-11-15T08:29:58.7773850Z Copying /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/build/outputs/apk/*.apk to /Users/robfinbow/VSTS-Agent/_work/1/s/bin/android/release
2017-11-15T08:29:58.7796990Z Copying /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/ant-build/proguard/*.txt to /Users/robfinbow/VSTS-Agent/_work/1/s/bin/android/release
2017-11-15T08:29:58.7819240Z Copying /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/build/outputs/mapping/release/*.txt to /Users/robfinbow/VSTS-Agent/_work/1/s/bin/android/release
2017-11-15T08:29:58.9091780Z ##[section]Finishing: Cordova Build android
2017-11-15T08:29:58.9907110Z ##[section]Starting: Release platforms/android/build/outputs/release/apk/android-release.apk to alpha
2017-11-15T08:29:58.9993680Z ==============================================================================
2017-11-15T08:29:59.0014760Z Task : Google Play - Release
2017-11-15T08:29:59.0035620Z Description : Release an app to the Google Play Store
2017-11-15T08:29:59.0055550Z Version : 1.119.0
2017-11-15T08:29:59.0075440Z Author : Microsoft Corporation
2017-11-15T08:29:59.0095240Z Help :
2017-11-15T08:29:59.0115240Z ==============================================================================
2017-11-15T08:29:59.8538390Z ##[error]Error: Not found apkFile: /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/build/outputs/release/apk/android-release.apk
```
There is an issue with the new version of
cordova-android
and the VSTS Cordova build tasks. It seems that in the new version (6.4.0) the output directory has changed slightly and therefore the VSTS build tasks cannot find the APK to copy.What we are seeing is the task successfully building and the APK is being written to the outputs directory, but not the correct one or at least not the same directory the VSTS task is expecting. The result is this:
Error: Not found apkFile
.When running
cordova build android --release
withcordova-android@6.4.0
as a platform the output directory for the APK is the following:platforms/android/build/outputs/apk/release/android-release.apk
, this is causing the VSTS build to fail as the task is expecting the APK to be here:platforms/android/build/outputs/apk/android-release.apk
.Downgrading to
cordova-android@6.3.0
allows the VSTS build task to continue and copy the APKs.Here is my build log...
``` 2017-11-15T08:28:52.9769030Z ============================================================================== 2017-11-15T08:28:52.9780380Z Task : Cordova Build 2017-11-15T08:28:52.9791740Z Description : Build a hybrid app project based on the Cordova CLI, Ionic CLI, TACO CLI, or other Cordova-compliant CLI 2017-11-15T08:28:52.9803160Z Version : 1.3.11 2017-11-15T08:28:52.9814400Z Author : Microsoft Corporation 2017-11-15T08:28:52.9825990Z Help : [More Information](http://go.microsoft.com/fwlink/?LinkID=691186) 2017-11-15T08:28:52.9837390Z ============================================================================== 2017-11-15T08:28:53.5295460Z Building Android on OSX. Add "cmd" as a "Demand" under "General" to your build definition to cause the build to always route to a Windows agent. 2017-11-15T08:28:53.5317910Z Module cache at /Users/robfinbow/.taco_home/node_modules 2017-11-15T08:28:54.1094650Z cordova@7.0.1 already installed. 2017-11-15T08:28:55.9652090Z Module cache at /Users/robfinbow/.taco_home/node_modules 2017-11-15T08:28:56.5241390Z cordova@7.0.1 already installed. 2017-11-15T08:28:56.8840080Z Adding support plugin. 2017-11-15T08:28:58.3171700Z Platform android already added. 2017-11-15T08:28:58.3184110Z Queueing build for platform android w/options: --release,--archs=x86 arm,--device,--gradleArg=--no-daemon 2017-11-15T08:28:58.3609050Z Before deploy hook started... 2017-11-15T08:28:58.3620740Z Checking is node modules installed... 2017-11-15T08:28:58.3632430Z Node modules already installed. 2017-11-15T08:28:58.3644200Z Cordova hook completed. Resuming to run your cordova command... 2017-11-15T08:28:58.3774460Z Processing res/native for android 2017-11-15T08:28:58.7323560Z ANDROID_HOME=/Users/robfinbow/Library/Android/sdk 2017-11-15T08:28:58.7337500Z JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home 2017-11-15T08:28:59.6679530Z :wrapper 2017-11-15T08:28:59.6685560Z 2017-11-15T08:28:59.6696830Z BUILD SUCCESSFUL in 0s 2017-11-15T08:28:59.6708380Z 1 actionable task: 1 executed 2017-11-15T08:29:00.9891950Z Subproject Path: CordovaLib 2017-11-15T08:29:01.4606650Z To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.1/userguide/gradle_daemon.html. 2017-11-15T08:29:02.3695670Z Daemon will be stopped at the end of the build stopping after processing 2017-11-15T08:29:05.2531210Z Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead. 2017-11-15T08:29:05.4147090Z The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. 2017-11-15T08:29:05.4179480Z at build_7k5jst7r8waaa9o5h7gkx14xg.run(/Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/build.gradle:144) 2017-11-15T08:29:07.6564000Z publishNonDefault is deprecated and has no effect anymore. All variants are now published. 2017-11-15T08:29:08.4418620Z :preBuild UP-TO-DATE 2017-11-15T08:29:08.4542230Z :CordovaLib:preBuild UP-TO-DATE 2017-11-15T08:29:08.4571590Z :CordovaLib:preReleaseBuild UP-TO-DATE 2017-11-15T08:29:08.5052830Z :CordovaLib:checkReleaseManifest 2017-11-15T08:29:08.6461450Z :CordovaLib:processReleaseManifest 2017-11-15T08:29:09.3784150Z :preReleaseBuild 2017-11-15T08:29:09.3807690Z :CordovaLib:compileReleaseAidl 2017-11-15T08:29:09.4614560Z :compileReleaseAidl 2017-11-15T08:29:09.4644070Z :CordovaLib:packageReleaseRenderscript NO-SOURCE 2017-11-15T08:29:09.4664810Z :compileReleaseRenderscript 2017-11-15T08:29:09.4685420Z :checkReleaseManifest 2017-11-15T08:29:09.4809630Z :generateReleaseBuildConfig 2017-11-15T08:29:09.4831410Z :prepareLintJar 2017-11-15T08:29:09.4856960Z :generateReleaseResValues 2017-11-15T08:29:09.4877730Z :generateReleaseResources 2017-11-15T08:29:09.5374480Z :CordovaLib:compileReleaseRenderscript 2017-11-15T08:29:09.5395000Z :CordovaLib:generateReleaseResValues 2017-11-15T08:29:09.5416390Z :CordovaLib:generateReleaseResources 2017-11-15T08:29:09.5598370Z :CordovaLib:packageReleaseResources 2017-11-15T08:29:28.5529210Z :mergeReleaseResources 2017-11-15T08:29:28.5744650Z :createReleaseCompatibleScreenManifests 2017-11-15T08:29:28.7234610Z :processReleaseManifest 2017-11-15T08:29:28.7254560Z :splitsDiscoveryTaskRelease 2017-11-15T08:29:28.8327420Z :CordovaLib:platformAttrExtractor 2017-11-15T08:29:28.8353870Z :CordovaLib:generateReleaseBuildConfig 2017-11-15T08:29:28.8379050Z :CordovaLib:prepareLintJar 2017-11-15T08:29:28.8442850Z :CordovaLib:javaPreCompileRelease 2017-11-15T08:29:28.8465390Z :CordovaLib:processReleaseJavaRes NO-SOURCE 2017-11-15T08:29:28.8486410Z :compileReleaseNdk NO-SOURCE 2017-11-15T08:29:28.8577100Z :mergeReleaseShaders 2017-11-15T08:29:28.8673570Z :compileReleaseShaders 2017-11-15T08:29:28.8702690Z :generateReleaseAssets 2017-11-15T08:29:28.8786590Z :CordovaLib:mergeReleaseShaders 2017-11-15T08:29:28.8821420Z :CordovaLib:compileReleaseShaders 2017-11-15T08:29:28.8855280Z :CordovaLib:generateReleaseAssets 2017-11-15T08:29:28.8896200Z :CordovaLib:mergeReleaseAssets 2017-11-15T08:29:29.1082520Z :mergeReleaseAssets 2017-11-15T08:29:29.1211140Z :mergeReleaseJniLibFolders 2017-11-15T08:29:29.1245550Z :CordovaLib:compileReleaseNdk NO-SOURCE 2017-11-15T08:29:29.1279720Z :CordovaLib:mergeReleaseJniLibFolders 2017-11-15T08:29:29.2152470Z :CordovaLib:transformNativeLibsWithMergeJniLibsForRelease 2017-11-15T08:29:29.2181540Z :CordovaLib:transformNativeLibsWithIntermediateJniLibsForRelease 2017-11-15T08:29:29.2259820Z :processReleaseJavaRes NO-SOURCE 2017-11-15T08:29:29.2277820Z :validateSigningRelease 2017-11-15T08:29:29.3227540Z :CordovaLib:processReleaseResources 2017-11-15T08:29:29.8968790Z :processReleaseResources 2017-11-15T08:29:29.8985630Z :generateReleaseSources 2017-11-15T08:29:29.9002620Z :CordovaLib:generateReleaseSources 2017-11-15T08:29:31.3096220Z Note: Some input files use or override a deprecated API. 2017-11-15T08:29:31.3122750Z Note: Recompile with -Xlint:deprecation for details. 2017-11-15T08:29:31.3942380Z :CordovaLib:compileReleaseJavaWithJavac 2017-11-15T08:29:31.4373800Z :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease 2017-11-15T08:29:31.7469200Z :javaPreCompileRelease 2017-11-15T08:29:33.1840600Z Note: Some input files use or override a deprecated API. 2017-11-15T08:29:33.1876160Z Note: Recompile with -Xlint:deprecation for details. 2017-11-15T08:29:33.1911160Z Note: Some input files use unchecked or unsafe operations. 2017-11-15T08:29:33.1942490Z Note: Recompile with -Xlint:unchecked for details. 2017-11-15T08:29:34.5873260Z :compileReleaseJavaWithJavac 2017-11-15T08:29:34.5902390Z :compileReleaseSources 2017-11-15T08:29:36.3986320Z :transformClassesWithPreDexForRelease 2017-11-15T08:29:37.2977030Z :transformDexWithDexForRelease 2017-11-15T08:29:38.0582170Z :transformNativeLibsWithMergeJniLibsForRelease 2017-11-15T08:29:38.3475670Z :transformResourcesWithMergeJavaResForRelease 2017-11-15T08:29:46.8181660Z :packageRelease 2017-11-15T08:29:55.8644220Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/src/cordova/plugins/Diagnostic.java:446: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing this.cordova.getActivity() to this.cordova.getActivity().getApplicationContext() [WifiManagerLeak] 2017-11-15T08:29:55.8708490Z WifiManager wifiManager = (WifiManager) this.cordova.getActivity().getSystemService(Context.WIFI_SERVICE); 2017-11-15T08:29:55.8745380Z ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2017-11-15T08:29:55.8785580Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/src/cordova/plugins/Diagnostic.java:536: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing this.cordova.getActivity() to this.cordova.getActivity().getApplicationContext() [WifiManagerLeak] 2017-11-15T08:29:55.8821200Z WifiManager wifiManager = (WifiManager) this.cordova.getActivity().getSystemService(Context.WIFI_SERVICE); 2017-11-15T08:29:55.8843080Z ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2017-11-15T08:29:55.8855780Z 2017-11-15T08:29:55.8876070Z Explanation for issues of type "WifiManagerLeak": 2017-11-15T08:29:55.8905100Z On versions prior to Android N (24), initializing the WifiManager via 2017-11-15T08:29:55.8939680Z Context#getSystemService can cause a memory leak if the context is not the 2017-11-15T08:29:55.8967560Z application context. Change context.getSystemService(...) to 2017-11-15T08:29:55.8989680Z context.getApplicationContext().getSystemService(...). 2017-11-15T08:29:55.8998140Z 2017-11-15T08:29:55.9038170Z /Users/robfinbow/VSTS-Agent/_work/1/s/platforms/android/res/values/arrays.xml:3: Error: "country_codes" is not translated in "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "es" (Spanish), "eu" (Basque), "fi" (Finnish), "fr" (French), "he" (Hebrew), "hi" (Hindi), "hu" (Hungarian), "id" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ko" (Korean), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "ru" (Russian), "sk" (Slovak), "sl" (Slovenian), "sv" (Swedish), "tr" (Turkish), "zh-CN" (Chinese: China), "zh-TW" (Chinese: Taiwan) [MissingTranslation] 2017-11-15T08:29:55.9062090ZThanks