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": {}
}