本文介绍了离子android构建失败,找不到匹配项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ionic构建android,但是我收到以下错误:

I'm trying to build android using ionic, but I get the following error:

/Users/xxx/dev/workspace/project/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'.

对于我研究的内容,这与Android SDK版本不匹配有关,但是我确保所有版本对齐:

For what I've researched, this has something to do with a mismatching android SDK version, but I do have all the versions aligned:

Android SDK: 23
Android Build-tools: 23.0.3 (also got 23.0.2 and 23.0.1)
Android Platform-tools: 23.1.0

另外,在我的 config.xml 中:

<preference name="android-minSdkVersion" value="16" />
<preference name="android-targetSdkVersion" value="23" />

Ionic使用 cordova add platform [email protected]构建平台

我做了什么


  1. 降级API版本,只是出现错误

  2. 升级API版本并使用离子平台[email protected] 。它确实编译了,但是遇到了新的错误(例如 deviceready not beign fired 并且图标和启动没有加载beign)。

  3. 重新安装离子和cordova在不同的版本。没有任何改变。

  1. Downgrading the API version, just got errors
  2. Upgrading the API version and creating the platform using ionic platform [email protected]. It did compile, but got new errors (like deviceready not beign fired and the icon and splash not beign loaded).
  3. Reinstall ionic and cordova at different versions. Nothing changed.

此时我真的不知道发生了什么,因为所有其他关于这个错误的帖子都得到了解决正确的Android版本。顺便说一句,我可以构建和运行iOs应用程序,没有任何错误。

At this point I really don't what is happening, since all the others post about this errors get solved by getting the correct android versions. And by the way, I can build and run iOs app with no errors.

插件列表

com.shoety.cordova.plugin.inappbrowserxwalk 0.3.3 "InAppBrowser Crosswalk"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.6 "Console"
cordova-plugin-crosswalk-webview 2.1.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.5 "Device"
cordova-plugin-file 4.3.2 "File"
cordova-plugin-geolocation 2.4.2 "Geolocation"
cordova-plugin-inappbrowser 1.6.0-dev "InAppBrowser"
cordova-plugin-media 2.4.1 "Media"
cordova-plugin-network-information 1.3.2 "Network Information"
cordova-plugin-splashscreen 4.0.2 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-sqlite-storage 1.5.3 "Cordova sqlite storage plugin"
cordova.plugins.diagnostic 3.3.3 "Diagnostic"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-barcodescanner 6.0.5 "BarcodeScanner"
uk.co.workingedge.phonegap.plugin.launchnavigator 3.2.1 "Launch Navigator"

编辑:问题是Diagnostic的版本。如果我将它降级到3.0.0,那么构建适用于Android,但是对于iOs来说是失败的,因为源代码是使用该版本制作的。我不知道为什么它对我不起作用。

EDIT: The problem is the version of Diagnostic. If I downgrade it to 3.0.0, the build works for Android, but Fails for iOs, since the source code was made using that version. I don't know why It doesn't work for me.

推荐答案

构建问题是由于Cordova诊断的兼容性问题插入。

The build problem is due to compatibility issue with Cordova diagnostic plugin.

根据我的分析,我发现了这个。解决构建问题有两种可能的解决方案,如下所示:

As per my analysis, I came across this issue in the official issue tracking section of the plugin page. There are two possible solutions to resolve the build issue as follows:


  1. 按照用户的建议将诊断插件降级到3.0.0版本

  2. 按照插件作者的建议将Cordova Android版本升级到该插件的最新兼容版本。



Hope it helps. Cheers.

这篇关于离子android构建失败,找不到匹配项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 00:32