Sorry if this sounds more like a rant… but…
I have an Ionic app which has been running for numerous years (with ongoing development) and has been built numerous with little issue. Recently we were required to update one of the plugins we use and we can now no longer can build with Android (more on that in a bit). The plugin developer says we need to update to:
- compileSdkVersion = 27
- buildToolsVersion - 27.0.3
- latest version of Gradle
With hours of searching through google results i still have some major questions:
- what versions do i have?
- how do i upgrade?
- what do i need / what versions of what tools are required for a working Ionic development system?
Why does Ionic not have a simple command to list your environment and flag which things need to be updated or are not compatible with other parts?
Yes, ionic info spits out a small part of this:
Your system information:
Cordova CLI: 7.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v8.9.4
Xcode version: Not installed
but is clearly missing many things like Gradle, Android, etc.
More on the actual error:
I was able to build fine for years. After updating a plugin i get this error:
E:\www\UStayMaster\platforms\android\build\intermediates\exploded-aar\com.pulsatehq.sdk\PulsateSdk\2.12.0\res\layout\card.xml:266:57-71: AAPT: No resource found that matches the given name (at ‘layout_alignBottom’ with value ‘@id/item_image’).
This is related to the plugin which was updated; so that makes sense. I have seen many posts stating to replace @id with @+id but these are for Cordova and not for Ionic. I can edit these but of course they are rewritten as soon as i build.
I used Android SDK manager to install SDK 27 but not sure it is being used. When i add android it states: Android target: android-26 even though in config.xml i have:
<preference name="android-minSdkVersion" value="16" /> <preference name="android-targetSdkVersion" value="27" /> <preference name="android-compileSdkVersion" value="27" />
As a side issue, i also now regularly get this when trying to add android platform:
Error: Failed to fetch platform cordova-android@~6.3.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Failed to get absolute path to installed module
which i am sure is not as a result of the plugin update but more likely because i have updated some parts of my dev system and it has now become flaky. Usually when i get this error i simple redo the platform add and it works the 2nd time.
Basic question for now is how do i know what my environment should be for a working Ionic 1 development system. How do i know if this is what i have? And how do i upgrade the parts i need?