Ionic cordova android build fail


#1

Hey all

I’ve hit a brick wall in trying to build an Android version of our app. I thought at first my old versions of Android Studio were conflicting so I have completely removed all traces of it and the SDK’s and started with a fresh version of 3.1.2. I am getting a build fail message that I can’t seem to find with almost a day spent on Google. Hopefully someone on here has seen it though. This is what I get:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
   > 
Could not find compilerCommon.jar (com.android.databinding:compilerCommon:3.0.0).

     Searched in the following locations:

         https://jcenter.bintray.com/com/android/databinding/compilerCommon/3.0.0/compilerCommon-3.0.0.jar
   > Could not find builder-model.jar (com.android.tools.build:builder-model:3.0.0).

     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/builder-model/3.0.0/builder-model-3.0.0.jar
   > Could not find apksig.jar (com.android.tools.build:apksig:3.0.0).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/apksig/3.0.0/apksig-3.0.0.jar

This is what my ionic info gives me:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.6
    Cordova Platforms  : android 7.0.0 ios 4.3.1
    Ionic Framework    : ionic-angular 3.8.0

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2 
    ios-sim           : 6.1.2 
    Node              : v8.9.1
    npm               : 5.5.1 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : /Users/michael/Library/Android/sdk

Has anyone seen this before or can see something simple?! I’ve been looking at this for a looooong time so I’m not ruling out something simple staring me right in the face!

Thanks in advance all!


#2

I had the same problem until today. I think it has something todo with firewall settings.

I removed android studio completly and did a fresh install. I using windows for development, it seems to me, that you are using mac os or linux.

After this i did a cleanup with ccleaner and a restart.

After the fresh install i removed the sdk for android 8.1 and installed only 8.0. after this i did a ionic build and i get a firewall request for java. I activated all zones and now its building again. Perhaps some information could help to deal with this problem.

Greetings
Marcus


#3

Hi Marcus

Thank you for your reply.

I think I will uninstall everything to with Android Studio (including SDK’s and the lot) and also uninstall Ionic and re-install absolutely everything to see what happens then. I just need a spare few hours to do it all!

Cheers.