Hexagon Geospatial


Need help in setting and configuring Mobile MapWorks or just looking for general information you can’t find anywhere else. The Mobile discussion board is where you can look for answers, ask those questions and help others by sharing your knowledge. Help build a strong Mobile Community and join in on the discussions.
Showing results for 
Search instead for 
Do you mean 
Occasional Contributor
Posts: 12
Registered: ‎05-23-2017
Accepted Solution

Gradle error when adding Android platform to project

I'm trying to create my first MobileSDK app based on MMW Advantage template.


The ultimate goal is to be able to support JSON based data structures in special attributes, to hold "repetitive" information (in my case, inspection details collected in field). For the legacy MMW app, I accomplished that by using JS hooks, which convert/parse data to/from JSON and render dynamically the form elements accordingly. In the database there's just a text field which holds the JSON content and is published in the WFS service:




I'm assuming I'm forced to develop my own MobileSDK app in order to accomplish the same thing with MMW Advantage, as (AFAIK) it doesn't support hooks. I need this because the customer wants to view this demonstration in smartphones, not tablets.


When following the Getting Started guide, I'm facing the following error when adding the Android platform to my project:


$ grunt android


Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: C:\Users\aacvieir\AppData\Local\Android\sdk\tools\templates\gradle\wrapper




(Indeed there is no \templates\grade\wrapper folder in my \Android\sdk\tools folder, but I don't know what I've missed).


Has anyone experienced this problem before? Am I missing any step regarding the system setup?


Thank you,



Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: Gradle error when adding Android platform to project



I haven't experienced such behavior, but I setup my dev environment long time ago.

It seems that there have been some changes in how the Android dev environment is setup.

Other developers faced similar problems, try this: Could not find Gradle wrapper and let me know if it works.


Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: Gradle error when adding Android platform to project

The problem is with the Android SDK 25. We will fix it in the next SDK release.


Temporary solution:


You may try updating the cordova android platform

In you project directory, in the Gruntfile find the section



                    command: "platform"

                    action: "add"

                    platforms: ["android@6.1.2"]


change 6.1.2 to 6.2.3

Occasional Contributor
Posts: 12
Registered: ‎05-23-2017

Re: Gradle error when adding Android platform to project

Indeed I had Android SDK 25 installed, but even after uninstalling it and installing SDK 23, the error remained.


After changing the Gruntfile according your instructions, it completed successfully, but I could see in the logs that it is always considering Target SDK as 25; it detected the missing version, and automatically downloaded and installed it.


In order to avoid any incompatibility issues, later I opened the project on Android Studio and compiled again forcing the modules' compilation target SDK to 23.


Now I can run the compiled app with no issues. Thank you!

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.