6

After changing my top level build.gradle to use the Android Plugin for Gradle 3.0.0-beta3 along with Gradle 4.1, AirWatch can't read the info (like versionCode and versionName) from the APK.

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta3'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

ext {
    roomVersion = '1.0.0-alpha9'
    supportLibVersion = '26.0.1'
}

Is this a known issue? Any workaround?

juliano.net
  • 7,982
  • 13
  • 70
  • 164
  • This seems to be a known issue in the AW realm. It seems they have it on the roadmap but no defined date to put it in. Some are hoping 9.2.3 – Brian S Jan 25 '18 at 20:15

3 Answers3

8

Airwatch has an issue with the new AAPT2 tool which seems to compile the Manifest.xml file in a compressed form in contrast to AAPT. AAPT2 became the standard with Android Studio 3 but you can get back easily to AAPT by putting the line

android.enableAapt2=false

in the gradle.properties file of your project. Solved at least in our project the problem.

Nantoka
  • 4,174
  • 1
  • 33
  • 36
1

I don't have enough reputation to comment, but I just wanted to ask, if you have found out anything new about this topic, since our clients use AirWatch and we have run into a similar problem after updating gradle.

Specifically after updating from Android Studio 2 to Android Studio 3 and thus changing all gradle stuff coming with it.

Antonio Dell
  • 497
  • 5
  • 17
  • 1
    I didn't find anything, but changing my project to use the previous version of Gradle even with Android Studio 3 made AirWatch recognize our APK. – juliano.net Sep 13 '17 at 18:38
  • Interesting. I took a different approach and just used Android Studio 2 to compile it. Had to change some gradle stuff, but I think that should fix it. When I have the result from the client I'll post another comment. – Antonio Dell Sep 14 '17 at 10:07
0

As of this writing, Airwatch has a limitation where it will not update the app compiled with Android gradle plugin 3.0.

There are 2 work arounds. 1. Build the apk using the gradle plugin 2.3.3 or 2. Upload the apk built using gradle plugin 3.0 as a separate app on the console. Define App/ID version code manually and deploy.

bond
  • 11,236
  • 7
  • 48
  • 62