1

All the sudden I started receiving the following error when building Cordova application in VS 2015. The upgrade / deletion of packages in Android SDK lead to this issue.

platforms\android\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3 : AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
platforms\android\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4 : AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

I tried to resolve it for the last 4 days already, with no success. The following attempts were made:

  • Reinstallation of VS 2015 with all corresponding third-party applications
  • Reinstallation of Android SDK using VS installer
  • Complete Android SDK transfer from another computer where the same source code compiles
  • Complete reinstall of Win10 (3 times!) with and without deletion of all user data
  • Clean VS 2015 build with and without my original MS user - to avoid possibility that VS restores some user settings stored in my account
  • Installation of other Android SDK platforms, extras, Google APIs, Android SDK build tools etc.
  • Compilation with JDK 1.8.x
  • Compilation using different Target API defined in config.xml: 16, 23 & 24
  • Removing dependent plugins, like Cordova Compat and BarcodeScanner
  • VS 2017 compile - fails complaining about missing licenses. There is no Licenses folder in Android SDK so I cannot copy it from there as described by Google
  • Compilation for Cordova CLI versions higher than 6.0.0. The newer fail will the same licensing issue as VS 2017
  • Deletion of platforms/plugins/bower/node_modules folders before build
  • Moving the source code to root folder so that the paths are shorter

Exactly the same, fresh source code compiles for my friends and does compile for me on another computer.

Sometimes it does compile for me, with no changes made. In those cases, for some reason, separate packages for ARM/x86 are not generated. They should be generated as the result of using Crosswalk project in embedded mode..

Failing build

1>  ------ Building platform: android
1>  Debug
1>  ------ Build configuration options: --debug
1>  Executing "before_compile"  hook for all plugins.
1>  ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
1>  JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_55
1>  null
1>  org.xwalk:xwalk_core_library:20+
1>  :preBuild UP-TO-DATE
1>  :preArmv7DebugBuild UP-TO-DATE
1>  :checkArmv7DebugManifest
1>  :preX86DebugBuild UP-TO-DATE
1>  :CordovaLib:preBuild UP-TO-DATE
1>  :CordovaLib:preDebugBuild UP-TO-DATE
1>  :CordovaLib:compileDebugNdk UP-TO-DATE
1>  :CordovaLib:compileLint
1>  :CordovaLib:copyDebugLint UP-TO-DATE
1>  :CordovaLib:mergeDebugProguardFiles
1>  :CordovaLib:packageDebugRenderscript UP-TO-DATE
1>  :CordovaLib:checkDebugManifest
1>  :CordovaLib:prepareDebugDependencies
1>  :CordovaLib:compileDebugRenderscript
1>  :CordovaLib:generateDebugResValues
1>  :CordovaLib:generateDebugResources
1>  :CordovaLib:packageDebugResources
1>  :CordovaLib:compileDebugAidl
1>  :CordovaLib:generateDebugBuildConfig
1>  :CordovaLib:generateDebugAssets UP-TO-DATE
1>  :CordovaLib:mergeDebugAssets
1>  :CordovaLib:processDebugManifest
1>  :CordovaLib:processDebugResources
1>  :CordovaLib:generateDebugSources
1>MSBUILD : cordova-build warning : Note: Some input files use or override a deprecated API.
1>  Note: Some input files use or override a deprecated API.
1>MSBUILD : cordova-build warning : Note: Recompile with -Xlint:deprecation for details.
1>  Note: Recompile with -Xlint:deprecation for details.
1>  :CordovaLib:compileDebugJavaWithJavac
1>  :CordovaLib:processDebugJavaRes UP-TO-DATE
1>  :CordovaLib:transformResourcesWithMergeJavaResForDebug
1>  :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
1>  :CordovaLib:mergeDebugJniLibFolders
1>  :CordovaLib:transformNative_libsWithMergeJniLibsForDebug
1>  :CordovaLib:transformNative_libsWithSyncJniLibsForDebug
1>  :CordovaLib:bundleDebug
1>  :prepareAndroidCordovaLibUnspecifiedDebugLibrary
1>  :preArmv7ReleaseBuild UP-TO-DATE
1>  :preX86ReleaseBuild UP-TO-DATE
1>  :CordovaLib:preReleaseBuild UP-TO-DATE
1>  :CordovaLib:compileReleaseNdk UP-TO-DATE
1>  :CordovaLib:copyReleaseLint UP-TO-DATE
1>  :CordovaLib:mergeReleaseProguardFiles
1>  :CordovaLib:packageReleaseRenderscript UP-TO-DATE
1>  :CordovaLib:checkReleaseManifest
1>  :CordovaLib:prepareReleaseDependencies
1>  :CordovaLib:compileReleaseRenderscript
1>  :CordovaLib:generateReleaseResValues
1>  :CordovaLib:generateReleaseResources
1>  :CordovaLib:packageReleaseResources
1>  :CordovaLib:compileReleaseAidl
1>  :CordovaLib:generateReleaseBuildConfig
1>  :CordovaLib:generateReleaseAssets UP-TO-DATE
1>  :CordovaLib:mergeReleaseAssets
1>  :CordovaLib:processReleaseManifest
1>  :CordovaLib:processReleaseResources
1>  :CordovaLib:generateReleaseSources
1>MSBUILD : cordova-build warning : Note: Some input files use or override a deprecated API.
1>  Note: Some input files use or override a deprecated API.
1>MSBUILD : cordova-build warning : Note: Recompile with -Xlint:deprecation for details.
1>  Note: Recompile with -Xlint:deprecation for details.
1>  :CordovaLib:compileReleaseJavaWithJavac
1>  :CordovaLib:processReleaseJavaRes UP-TO-DATE
1>  :CordovaLib:transformResourcesWithMergeJavaResForRelease
1>  :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
1>  :CordovaLib:mergeReleaseJniLibFolders
1>  :CordovaLib:transformNative_libsWithMergeJniLibsForRelease
1>  :CordovaLib:transformNative_libsWithSyncJniLibsForRelease
1>  :CordovaLib:bundleRelease
1>  :prepareBarcodescannerLibrary
1>  :prepareComAndroidSupportAnimatedVectorDrawable2510Library
1>  :prepareComAndroidSupportAppcompatV72510Library
1>  :prepareComAndroidSupportSupportCompat2510Library
1>  :prepareComAndroidSupportSupportCoreUi2510Library
1>  :prepareComAndroidSupportSupportCoreUtils2510Library
1>  :prepareComAndroidSupportSupportFragment2510Library
1>  :prepareComAndroidSupportSupportMediaCompat2510Library
1>  :prepareComAndroidSupportSupportV42510Library
1>  :prepareComAndroidSupportSupportVectorDrawable2510Library
1>  :prepareOrgXwalkXwalk_core_library205053312Library
1>  :prepareArmv7DebugDependencies
1>  :compileArmv7DebugAidl
1>  :compileArmv7DebugRenderscript
1>  :generateArmv7DebugBuildConfig
1>  :generateArmv7DebugAssets UP-TO-DATE
1>  :mergeArmv7DebugAssets
1>  :createXwalkCommandLineFileArmv7Debug
1>  :generateArmv7DebugResValues
1>  :generateArmv7DebugResources
1>MSBUILD : cordova-build error : AAPT err(Facade for 8377832): platforms\android\build\intermediates\exploded-aar\barcodescanner\res\drawable\toggle_torch.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
1>  AAPT err(Facade for 8377832): platforms\android\build\intermediates\exploded-aar\barcodescanner\res\drawable\toggle_torch.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
1>  :mergeArmv7DebugResources
1>  :processArmv7DebugManifest
1>MSBUILD : cordova-build error : platforms\android\build\intermediates\res\merged\armv7\debug\values-v24\values-v24.xml:3 : AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
1>  platforms\android\build\intermediates\res\merged\armv7\debug\values-v24\values-v24.xml:3 : AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
1>
1>  :processArmv7DebugResources FAILED
1>MSBUILD : cordova-build error : platforms\android\build\intermediates\res\merged\armv7\debug\values-v24\values-v24.xml:4 : AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
1>  platforms\android\build\intermediates\res\merged\armv7\debug\values-v24\values-v24.xml:4 : AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
1>
1>
1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception.
1>  FAILURE: Build failed with an exception.
1>
1>MSBUILD : cordova-build error : * What went wrong:
1>  * What went wrong:
1>MSBUILD : cordova-build error : Execution failed for task ':processArmv7DebugResources'.
1>  Execution failed for task ':processArmv7DebugResources'.
1>
1>  BUILD FAILED
1>
1>  Total time: 23.263 secs
1>MSBUILD : cordova-build error : > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1
1>  > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1
1>
1>MSBUILD : cordova-build error : * Try:
1>  * Try:
1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>  ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"platforms\android\gradlew cdvBuildDebug -b platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
1>  You may not have the required environment or OS to build this project
1>MSBUILD : cordova-build error : Error code 1 for command: cmd with args: /s,/c,"platforms\android\gradlew cdvBuildDebug -b platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
1>  Error code 1 for command: cmd with args: /s,/c,"platforms\android\gradlew cdvBuildDebug -b platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The difference between failing build and a successful build starts after prepareBarcodescannerLibrary.

Successful build

1>  :prepareBarcodescannerLibrary
1>  :prepareComAndroidSupportAppcompatV72221Library
1>  :prepareComAndroidSupportSupportV42221Library
1>  :prepareOrgXwalkXwalk_core_library205053312Library
1>  :prepareArmv7DebugDependencies
1>  :compileArmv7DebugAidl
1>  :compileArmv7DebugRenderscript
1>  :generateArmv7DebugBuildConfig
1>  :generateArmv7DebugAssets UP-TO-DATE
1>  :mergeArmv7DebugAssets
1>  :createXwalkCommandLineFileArmv7Debug
1>  :generateArmv7DebugResValues
1>  :generateArmv7DebugResources
1>MSBUILD : cordova-build error : AAPT err(Facade for 24487251): platforms\android\build\intermediates\exploded-aar\barcodescanner\res\drawable\toggle_torch.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
1>  AAPT err(Facade for 24487251): platforms\android\build\intermediates\exploded-aar\barcodescanner\res\drawable\toggle_torch.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
1>  :mergeArmv7DebugResources
1>  :processArmv7DebugManifest
1>  :processArmv7DebugResources
1>  :generateArmv7DebugSources
1>MSBUILD : cordova-build warning : Note: Some input files use or override a deprecated API.
1>  Note: Some input files use or override a deprecated API.
1>MSBUILD : cordova-build warning : Note: Recompile with -Xlint:deprecation for details.
1>  Note: Recompile with -Xlint:deprecation for details.
1>MSBUILD : cordova-build warning : Note: platforms\android\src\cordova\plugins\Diagnostic.java uses unchecked or unsafe operations.
1>  Note: platforms\android\src\cordova\plugins\Diagnostic.java uses unchecked or unsafe operations.
1>MSBUILD : cordova-build warning : Note: Recompile with -Xlint:unchecked for details.
1>  Note: Recompile with -Xlint:unchecked for details.
1>  :compileArmv7DebugJavaWithJavac
1>  :compileArmv7DebugNdk UP-TO-DATE
1>  :compileArmv7DebugSources
1>
1>  :transformClassesWithDexForArmv7Debug
1>  :mergeArmv7DebugJniLibFolders
1>  :transformNative_libsWithMergeJniLibsForArmv7Debug
1>  :processArmv7DebugJavaRes UP-TO-DATE

Obviously the versions of the libraries are different. But I ran out of ideas how this issue could be fixed.

config.xml plugins

  <preference name="android-minSdkVersion" value="16" />
  <feature name="Keyboard">
    <param name="ios-package" onload="true" value="IonicKeyboard" />
  </feature>
  <plugin name="cordova-sqlite-storage" src="https://github.com/litehelpers/Cordova-sqlite-storage.git" version="0.7.15-pre" />
  <plugin name="cordova-sqlite-storage" version="0.7.15-pre" />
  <plugin name="phonegap-plugin-barcodescanner" src="https://github.com/phonegap/phonegap-plugin-barcodescanner" version="6.0.1" />
  <plugin name="cordova-plugin-whitelist" version="1.2.1" />
  <plugin name="ionic-plugin-keyboard" src="https://github.com/driftyco/ionic-plugin-keyboard.git" version="2.0.1" />
  <plugin name="cordova-plugin-geolocation" version="2.1.0" />
  <plugin name="cordova-plugin-app-version" src="https://github.com/whiteoctober/cordova-plugin-app-version.git" version="0.1.8" />
  <plugin name="cordova-plugin-compat" version="1.0.0" />
  <plugin name="cordova-plugin-device" version="1.1.2" />
  <plugin name="cordova-plugin-inappbrowser" version="1.2.1" />
  <plugin name="cordova-plugin-crosswalk-webview" version="2.1.0" />
  <plugin name="cordova.plugins.diagnostic" version="3.3.2" />
  <plugin name="phonegap-plugin-barcodescanner" version="6.0.4">
    <variable name="CAMERA_USAGE_DESCRIPTION" value="Barcode scanning" />
  </plugin>
  <plugin name="cordova-custom-config" version="3.1.2" />
  <preference name="xwalkVersion" value="20+" />
  <preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
  <preference name="xwalkMode" value="embedded" />
  <!-- <preference name="xwalkMode" value="shared" /> -->
  <preference name="xwalkMultipleApk" value="true" />

bower.json

{
  "name": "project_name",
  "devDependencies": {
    "angular": "~1.6.0",
    "angular-animate": "~1.6.0",
    "angular-messages": "~1.6.0",
    "angular-resource": "~1.6.0",
    "angular-sanitize": "~1.6.0",
    "angular-ui-router": "^0.3.2",
    "ionic": "^1.3.2",
    "ngEnter": "^0.0.1",
    "ngstorage": "^0.3.11",
    "ngtouch": "^1.0.1",
    "underscore-min": "^1.8.3"
  },
  "resolutions": {
    "angular": "~1.6.0",
    "angular-sanitize": "~1.6.0",
    "angular-resource": "~1.6.0",
    "angular-animate": "~1.6.0",
    "angular-ui-router": "^0.3.2"
  }
}

plugins\fetch.json

{
    "cordova-sqlite-storage": {
        "source": {
            "type": "git",
            "url": "https://github.com/litehelpers/Cordova-sqlite-storage.git",
            "subdir": "."
        },
        "is_top_level": true,
        "variables": {}
    },
    "cordova-plugin-whitelist": {
        "source": {
            "type": "registry",
            "id": "cordova-plugin-whitelist@1.2.1"
        },
        "is_top_level": true,
        "variables": {}
    },
    "ionic-plugin-keyboard": {
        "source": {
            "type": "git",
            "url": "https://github.com/driftyco/ionic-plugin-keyboard.git",
            "subdir": "."
        },
        "is_top_level": true,
        "variables": {}
    },
    "cordova-plugin-geolocation": {
        "source": {
            "type": "registry",
            "id": "cordova-plugin-geolocation@2.1.0"
        },
        "is_top_level": true,
        "variables": {}
    },
    "cordova-plugin-app-version": {
        "source": {
            "type": "git",
            "url": "https://github.com/whiteoctober/cordova-plugin-app-version.git",
            "subdir": "."
        },
        "is_top_level": true,
        "variables": {}
    },
    "phonegap-plugin-barcodescanner": {
        "source": {
            "type": "git",
            "url": "https://github.com/phonegap/phonegap-plugin-barcodescanner",
            "subdir": "."
        },
        "is_top_level": true,
        "variables": {}
    },
    "cordova-plugin-compat": {
        "source": {
            "type": "registry",
            "id": "cordova-plugin-compat@1.0.0"
        },
        "is_top_level": true,
        "variables": {}
    },
    "cordova-plugin-device": {
        "source": {
            "type": "registry",
            "id": "cordova-plugin-device@1.1.2"
        },
        "is_top_level": true,
        "variables": {}
    },
    "cordova-plugin-inappbrowser": {
        "source": {
            "type": "registry",
            "id": "cordova-plugin-inappbrowser@1.2.1"
        },
        "is_top_level": true,
        "variables": {}
    },
    "cordova-plugin-crosswalk-webview": {
        "source": {
            "type": "registry",
            "id": "cordova-plugin-crosswalk-webview@2.1.0"
        },
        "is_top_level": true,
        "variables": {
            "XWALK_VERSION": "21+",
            "XWALK_LITEVERSION": "xwalk_core_library_canary:17+",
            "XWALK_COMMANDLINE": "--disable-pull-to-refresh-effect",
            "XWALK_MODE": "embedded",
            "XWALK_MULTIPLEAPK": "true"
        }
    },
    "cordova.plugins.diagnostic": {
        "source": {
            "type": "registry",
            "id": "cordova.plugins.diagnostic@3.3.2"
        },
        "is_top_level": true,
        "variables": {}
    },
    "cordova-custom-config": {
        "source": {
            "type": "registry",
            "id": "cordova-custom-config@3.1.2"
        },
        "is_top_level": true,
        "variables": {}
    }
}

plugins\android.json (auto-generated)

{
    "prepare_queue": {
        "installed": [],
        "uninstalled": []
    },
    "config_munge": {
        "files": {}
    },
    "installed_plugins": {
        "cordova-custom-config": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova-plugin-app-version": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova-plugin-compat": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova-plugin-crosswalk-webview": {
            "XWALK_VERSION": "21+",
            "XWALK_LITEVERSION": "xwalk_core_library_canary:17+",
            "XWALK_COMMANDLINE": "--disable-pull-to-refresh-effect",
            "XWALK_MODE": "embedded",
            "XWALK_MULTIPLEAPK": "true",
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova-plugin-device": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova-plugin-geolocation": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova-plugin-inappbrowser": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova-plugin-whitelist": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova-sqlite-storage": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "cordova.plugins.diagnostic": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "ionic-plugin-keyboard": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        },
        "phonegap-plugin-barcodescanner": {
            "PACKAGE_NAME": "io.cordova.myappe2785d518e9f4f6ea03055878dd7a400"
        }
    },
    "dependent_plugins": {}
}

package.json

{
  "name": "project_name",
  "version": "1.0.0",
  "devDependencies": {
    "elementtree": "^0.1.6",
    "gulp": "^3.9.1",
    "gulp-concat": "^2.6.1",
    "gulp-uglify": "^2.0.0",
    "plist": "^2.0.1",
    "tostr": "^0.1.0",
    "xcode": "^0.9.0",
    "ng-cordova": "^0.1.27-alpha",
    "lodash": "4.17.4"
  },
  "dependencies": {}
}
mlemanczyk
  • 121
  • 1
  • 8
  • What plugins or libraries are you using? And which Android API level are you targeting? – Elvis Xia - MSFT Jan 12 '17 at 01:53
  • I've updated the question with the information you asked about. I've tried targetting it for API 16, 23 & 24 in config.xml, but it didn't change anything. – mlemanczyk Jan 12 '17 at 07:28
  • So, the issue is related to cordova.plugins.diagnostic plugin. After it's removed, the project compiles again. But how can I get my environment to the previous state, where it compiled? The primary difference seems to be in appcompat library. – mlemanczyk Jan 13 '17 at 00:10
  • Could you please try remove the android platform and rebuild again? – Elvis Xia - MSFT Jan 13 '17 at 01:24
  • I already tried that (removed `platforms` folder in VS) and it didn't change anything. Until the issue is resolved by the author of the plugin, I think the best workaround is to downgrade Android Support Repository to rev. <41. For example, the project compiles with rev. 16. If someone could provide the right way to do it using Android SDK Manager in Windows, I'd mark it as an answer. The only way I know myself is to copy it from another (not upgraded) computer. The issue with the plugin was reported to the author https://github.com/dpa99c/cordova-diagnostic-plugin/issues/168 – mlemanczyk Jan 15 '17 at 11:23
  • From the github thread you posted, you are facing a out of heap problem, have you tried install the 64 bit Java? – Elvis Xia - MSFT Jan 16 '17 at 02:36
  • I'm sorry for the delay. Days are too short. I didn't try installing Java 64-bit. The easiest was to set appropriate system variable. I'll post the solution to this issue shortly. – mlemanczyk Jan 26 '17 at 20:55

2 Answers2

2

Thanks to guidance from dpa99c - the author of cordova.plugins.diagnostic plugin, below you can find the solution to the issue above. You can find more details and discussions on GitHub.

The issue is caused by upgrade of Android Support Repository to rev. 41 in Android SDK Manager.

Solution 1 - short-term

Revert Android Support Repository back to rev. 16. I don't know any way of doing this, other than copying from another computer. In my case it was in c:\Program Files (x86)\Android\android-sdk\extras\android\m2repository.

Solution 2 - short-term

Downgrade cordova.plugins.diagnostic plugin to version 3.0.0, as provided by @Juan Sánchez. Version 3.2 of the plugin adds support for iOS 10, tough.

Solution 3 - long-term

  1. Delete bin, bld, Merge and platforms folders in your project tree in VS.
  2. Double click config.xml of your project and change Cordova CLI to 6.4.0+. You can find it in Platforms group.
  3. If you don't already have JDK 1.8+ installed, install it and override JAVA_HOME setting in VS => Tools => Options => Tools for Apache Cordova => Environment Variables Overrides to point to your JDK 1.8+ folder.
  4. Build the project and verify, if it compiles. In case you get compile error about
    • unaccepted Android SDK licenses, please proceed to point 5.
    • insufficient JAVA heap, please proceed to point 6.
  5. To resolve unaccepted Android SDK licenses, please:
    • search for SDK in build output. It will provide you the Android SDK version number your project is compiled against. In my case it was version 24.
    • open command prompt with administrative rights and change directory to c:\Program Files (x86)\Android\android-sdk\tools. It may differ depending on your setup.
    • run the following command android update sdk --no-ui --filter build-tools-24.0.3,android-24. Please change the version number to Android SDK version listed in your build output. The solution comes from SO.
  6. To resolve insufficient JAVA heap error please define the following environment variable in your system _JAVA_OPTIONS=-Xmx512M. Please use a bigger number, if needed. The solution comes from SO.

After executing the steps above, everything should compile for you with the latest version of cordova.plugins.diagnostic.

Community
  • 1
  • 1
mlemanczyk
  • 121
  • 1
  • 8
0

Easiest way to solve this problem is downgroading cordova.plugins.diagnostic to version 3.0.0, as stated here

It worked for me.

Juan Sánchez
  • 980
  • 2
  • 10
  • 26
  • Although it could be an acceptable solution, version 3.2 adds support for iOS 10, which will be more and more important. For this reason I won't mark it as the selected solution. – mlemanczyk Jan 15 '17 at 11:20