0

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

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

Also, in my 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

What I've done

  1. Downgrading the API version, just got errors
  2. Upgrading the API version and creating the platform using 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).
  3. Reinstall ionic and cordova at different versions. 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. And by the way, I can build and run iOs app with no errors.

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. I don't know why It doesn't work for me.

CamiloR
  • 153
  • 12
  • I think its more to do with Android support library's major version. Your android sdk version must match the support library's major version. Check out this link -http://stackoverflow.com/questions/32075498/error-retrieving-parent-for-item-no-resource-found-that-matches-the-given-name Also by any chance are you using any plugins? – Gandhi Mar 13 '17 at 15:02
  • @Gandhi my support library is at rev 44. I'll update the plugin list in the OP. – CamiloR Mar 13 '17 at 15:13
  • i guess your problem could be due to cordova diagnostic plugin. Check out this linke - https://forum.ionicframework.com/t/build-failed-android/38071 – Gandhi Mar 13 '17 at 15:45
  • Do keep us posted – Gandhi Mar 13 '17 at 16:07
  • @Gandhi I've already tested that. The thing is the build compiles, but I really need that plugin in the app. I've already researched that plugin and no one was getting the same error as me, thats why I think the problem might be in xwalk. – CamiloR Mar 13 '17 at 17:08
  • i am afraid that your research may be not be right. I could see people facing this issue with diagnostic plugin which could be resolved by updating to latest cordova android version. Check out this link - https://github.com/dpa99c/cordova-diagnostic-plugin/issues/161 – Gandhi Mar 14 '17 at 05:31
  • @Gandhi Thanks for that. I ditched it because the solution the posted didn't worked for me (and for work reasons, I have to keep some versiones untouched). But I re-read it and downgrading diagnostic to 3.0.0 worked ! – CamiloR Mar 14 '17 at 13:06
  • The problem now is that I need the 3.3.3 version of diagnostic to make it work for iOs :/ – CamiloR Mar 14 '17 at 13:17
  • downloading the plugin was one option. But the plugin author suggested to update to latest version of cordova android. Did you tried it? Any specific use case that fails in iOS with 3.0.0 version? – Gandhi Mar 14 '17 at 13:31
  • This is really bothering me. All my co-workers have the diagnostic 3.3.3, got the same versions of cordova (6.3.1, android 5.2.2) and they can build for android and ios without problems. I cant do much more with versions, since this product is already live and I have to keep the development decisions. – CamiloR Mar 14 '17 at 13:40
  • so you mean to say only your setup is having problem? – Gandhi Mar 14 '17 at 13:53
  • Any update on this? – Gandhi Mar 15 '17 at 04:56
  • @Gandhi not at all. For now, I just build android changing the plugin version to 3.0.0, then move to 3.3.3 to build iOs :/ – CamiloR Mar 15 '17 at 12:58
  • But is it happening only in your environment? – Gandhi Mar 15 '17 at 13:15
  • @Gandhi It seems like it does. I installed everything in the same versions like the others. I think that maybe i've missed something, but at this point is difficult to know what was it. – CamiloR Mar 15 '17 at 15:08
  • i guess it may be something to do with android and build tools installation. Shall i post the diagnostic plugin issue as answer? – Gandhi Mar 15 '17 at 15:23
  • @Gandhi sure, since it solves the build problem. – CamiloR Mar 15 '17 at 15:43

2 Answers2

0

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. Downgrading the diagnostic plugin to version 3.0.0 as suggested by the users
  2. Upgrading Cordova android version to the latest compatible version of the plugin as suggested by the plugin author.

Hope it helps. Cheers.

Gandhi
  • 11,875
  • 4
  • 39
  • 63
0

This worked for me, as of 6/16/2017

In the plugin.xml for diagnostic

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+" />
ohjeeez
  • 559
  • 4
  • 6