Ionic Package: Could not find gradle wrapper within Android SDK ... error

I’m getting the error below after submitting my app to Ionic for a remote build: ionic package build --profile my-profile

I do not receive an error if I build local: ionic cordova build android

This looks like an issue with the remote build server. Is there anything I can do to resolve it?

ANDROID_HOME=/opt/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /opt/android-sdk/tools/templates/gradle/wrapper

I am using Ionic version 3.5.0 on Windows Server 2016.

This was built 15 times already, but…

Post your ionic info output please. Probably you are not on the newest cordova-android.

When you say “this was built 15 times already”, did you mean this has been “asked 15 times already” ? I realize there is a lot of chatter around this issue, and I did read many (possibly all) of the posts, but they all appeared to be related to local builds, and not to hosted builds.

Here is my ionic info. My OS is definitely Server 2016, even though the output states it is Windows 10. Thank you for taking a look.

global packages:

@ionic/cli-utils : 1.5.0
Cordova CLI      : 7.0.1
Ionic CLI        : 3.5.0

local packages:

@ionic/app-scripts              : 2.0.1
@ionic/cli-plugin-cordova       : 1.4.1
@ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms               : android 6.2.3
Ionic Framework                 : ionic-angular 3.5.0

System:

Node       : v6.11.0
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 3.10.10

Yep, I was so “pissed” that I even mistyped. Sorry.

1 Like

Interesting, this is looking fine for you.

Create a new project with ionic start blank blank please, add it to your apps.ionic.io account, add the Android platform and try to build with the same command please (which I think is missing ‘android’ in our first post, right?). See if you get the same error.

(If it works on the new project, remove and re-add the android platform on your original project and try again)

I returned to this issue today, and I tried the original commands without changing anything, to be sure that the original problem still occurs; the build completed without errors. I assume something was updated on the build server to resolve the issue. To my knowledge, I didn’t make any changes on my side to resolve the issue. Thanks again for taking a look.

1 Like