简体   繁体   English

Ionic Android构建失败,找不到匹配项

[英]Ionic android build fails, no matches found

I'm trying to build android using ionic, but I get the following error: 我正在尝试使用ionic构建android,但是出现以下错误:

/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'.

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版本有关,但是我确实将所有版本对齐:

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

Also, in my config.xml : 另外,在我的config.xml

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

Ionic build the platform using cordova add platform android@5.2.2 Ionic使用cordova add platform android@5.2.2构建平台并cordova add platform android@5.2.2

What I've done 我做了什么

  1. Downgrading the API version, just got errors 降级API版本,出现错误
  2. Upgrading the API version and creating the platform using ionic platform android@6.0.0 . 升级API版本并使用ionic platform android@6.0.0创建ionic platform android@6.0.0 It did compile, but got new errors (like deviceready not beign fired and the icon and splash not beign loaded). 它确实可以编译,但是出现了新的错误(例如deviceready not beign fired ,图标和启动画面未beign被加载)。
  3. Reinstall ionic and cordova at different versions. 重新安装不同版本的ionic和cordova。 Nothing changed. 没有改变。

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. 在这一点上,我真的不知道发生了什么,因为所有其他有关此错误的文章都通过获取正确的android版本来解决。 And by the way, I can build and run iOs app with no errors. 顺便说一句,我可以毫无错误地构建和运行iOs应用程序。

Plugin list 插件清单

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"

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. 如果我将其降级到3.0.0,则该版本适用于Android,但不适用于iO,因为源代码是使用该版本制作的。 I don't know why It doesn't work for me. 我不知道为什么它对我不起作用。

The build problem is due to compatibility issue with Cordova diagnostic plugin. 生成问题是由于Cordova诊断插件的兼容性问题所致。

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. Downgrading the diagnostic plugin to version 3.0.0 as suggested by the users 根据用户的建议将诊断插件降级到3.0.0版
  2. Upgrading Cordova android version to the latest compatible version of the plugin as suggested by the plugin author. 按照插件作者的建议,将Cordova android版本升级到该插件的最新兼容版本。

Hope it helps. 希望能帮助到你。 Cheers. 干杯。

This worked for me, as of 6/16/2017 截至2017年6月16日,这对我有用

In the plugin.xml for diagnostic 在plugin.xml中进行诊断

Change these 2 lines: 更改这两行:

<framework src="com.android.support:support-v4:25.+" />
<framework src="com.android.support:appcompat-v7:25.+" />

to

<framework src="com.android.support:support-v13:23+"/>
<framework src="com.android.support:appcompat-v7:23+" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于“找不到与包名称&#39;io.ionic.starter&#39;相匹配的客户端”,Ionic Cordova构建android在:processDebugGoogleServices失败 - Ionic Cordova build android fails at :processDebugGoogleServices due to “No matching client found for package name 'io.ionic.starter'” Android项目构建失败,错误检索项目的父项:找不到与给定名称匹配的资源 - Android Project Build Fails with Error retrieving parent for item: No resource found that matches the given name 离子Android构建失败CordovaLib:processDebugResources - Ionic Android Build Fails CordovaLib:processDebugResources Unity Google Cardboard构建失败:“找不到与给定名称匹配的资源” - Unity Google Cardboard build fails: “No resource found that matches the given name” 找不到离子构建android错误api - ionic build android error api not found Ionic Android找不到与给定名称匹配的资源.. cardBackgroundColor - Ionic Android No resource found that matches the given name.. cardBackgroundColor 离子构建android失败-找不到构建工具 - ionic build android failed -- no build-tools found Ionic Cordova Build Android 未找到已安装的构建工具 - Ionic Cordova Build Android No installed build tools found 离子构建失败 - Ionic Build Fails 离子cordova构建android失败 - 由于一些路径错误 - Ionic cordova build android fails - Due to some path error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM