突然之间,当我在VS 2015构建Cordova应用程序时,我开始收到以下错误。Android中的包的升级/删除导致了这个问题。
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'.在过去的4天里,我一直试图解决这个问题,但没有成功。所作的努力如下:
完全相同,新的源代码为我的朋友编译,并为我在另一台计算机上编译。
有时它确实为我编译,没有做任何修改。在这些情况下,由于某种原因,不会为ARM/x86生成单独的包。它们应该是由于在嵌入式模式下使用人行横道项目而产生的。
失败构建
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 ==========失败构建与成功构建之间的区别是在prepareBarcodescannerLibrary之后开始的。
成功构建
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显然,库的版本是不同的。但我想不出如何解决这个问题。
config.xml插件
<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 (自动生成)
{
"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": {}
}发布于 2017-01-26 21:32:08
多亏了dpa99c -- cordova.plugins.diagnostic插件的作者--的指导,您可以找到上述问题的解决方案。您可以找到关于GitHub的更多细节和讨论。
这个问题是由Android中的Android Support Repository升级到rev. 41造成的。
解决方案1-短期
将Android Support Repository恢复为rev. 16。除了从另一台电脑复制之外,我不知道有什么办法可以做到这一点。在我的例子中,它是在c:\Program Files (x86)\Android\android-sdk\extras\android\m2repository。
解决方案2-短期
将cordova.plugins.diagnostic插件降级为3.0.0版,由@Juanánchez提供。这个插件的3.2版增加了对iOS 10的支持。
解决方案3-长期
bin、bld、Merge和platforms文件夹。config.xml并将Cordova CLI更改为6.4.0+。您可以在Platforms组中找到它。
SDK。它将为您提供编译项目的Android版本号。在我的例子中,它是24版。c:\Program Files (x86)\Android\android-sdk\tools。根据您的设置,它可能会有所不同。android update sdk --no-ui --filter build-tools-24.0.3,android-24。请将版本号更改为build输出中列出的Android版本。解决方案是从此以后。
_JAVA_OPTIONS=-Xmx512M中定义以下环境变量。如果需要的话,请使用更大的号码。解决方案是从此以后。执行上述步骤之后,所有内容都应该使用最新版本的cordova.plugins.diagnostic进行编译。
发布于 2017-01-13 09:25:47
解决这个问题的最简单的方法是将cordova.plugins.diagnostic降级到3.0.0版本,正如所述的这里
对我起作用了。
https://stackoverflow.com/questions/41599927
复制相似问题