[英]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 我做了什么
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被加载)。 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: 有两种可能的解决方案来解决生成问题,如下所示:
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.