Search Unity

gradle goals not executed in unity

Discussion in 'Scripting' started by DoomDude99, Aug 18, 2019.

  1. DoomDude99

    DoomDude99

    Joined:
    May 11, 2019
    Posts:
    87
    I'm trying to build an app for multiple ABIs and use the following gradle file:

    mainTemplate.gradle:
    Code (CSharp):
    1. // GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
    2.  
    3. buildscript {
    4.     repositories {
    5.         google()
    6.         jcenter()
    7.     }
    8.  
    9.     dependencies {
    10.         classpath 'com.android.tools.build:gradle:3.2.0'
    11. **BUILD_SCRIPT_DEPS**}
    12. }
    13.  
    14. allprojects {
    15.     repositories {
    16.         google()
    17.         jcenter()
    18.         flatDir {
    19.             dirs 'libs'
    20.         }
    21.     }
    22. }
    23.  
    24. apply plugin: 'com.android.library'
    25. **APPLY_PLUGINS**
    26.  
    27. dependencies {
    28.     implementation fileTree(dir: 'libs', include: ['*.jar'])
    29.     implementation 'com.google.firebase:firebase-ads:17.1.2'
    30.     implementation 'com.android.billingclient:billing:1.2.1'
    31. **DEPS**}
    32.  
    33. android {
    34.     // <================== This goal is not being executed. Why?
    35.     splits {
    36.         abi {
    37.             enable true
    38.             reset()
    39.             include "armeabi", "armeabi-v7a", "arm64-v8a", "mips", "mips64", "x86", "x86_64"
    40.             universalApk true
    41.         }
    42.     }
    43.  
    44.     compileSdkVersion **APIVERSION**
    45.     buildToolsVersion '**BUILDTOOLS**'
    46.  
    47.     compileOptions {
    48.         sourceCompatibility JavaVersion.VERSION_1_8
    49.         targetCompatibility JavaVersion.VERSION_1_8
    50.     }
    51.  
    52.     defaultConfig {
    53. consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
    54.         minSdkVersion **MINSDKVERSION**
    55.         targetSdkVersion **TARGETSDKVERSION**
    56.      
    57.         ndk {
    58.             abiFilters **ABIFILTERS**
    59.         }
    60.         versionCode **VERSIONCODE**
    61.         versionName '**VERSIONNAME**'
    62.     }
    63.  
    64.     lintOptions {
    65.         abortOnError false
    66.     }
    67.  
    68.     aaptOptions {
    69.         noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]
    70.     }**SIGN**
    71.  
    72.     buildTypes {
    73.         debug {
    74.             minifyEnabled **MINIFY_DEBUG**
    75.             useProguard **PROGUARD_DEBUG**
    76.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
    77.             jniDebuggable true
    78.         }
    79.         release {
    80.             minifyEnabled **MINIFY_RELEASE**
    81.             useProguard **PROGUARD_RELEASE**
    82.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
    83.         }
    84.     }**PACKAGING_OPTIONS**
    85. **BUILT_APK_LOCATION**
    86.  
    87. }**REPOSITORIES****SOURCE_BUILD_SETUP**
    88.  


    I need to run the goal:

    Code (CSharp):
    1.     splits {
    2.         abi {
    3.             enable true
    4.             reset()
    5.             include "armeabi", "armeabi-v7a", "arm64-v8a", "mips", "mips64", "x86", "x86_64"
    6.             universalApk true
    7.         }
    8.     }
    but I'm only getting an .aab file with the following .apks file:

    Code (CSharp):
    1.  
    2. android-dev-build
    3. android-dev-build.aab
    4. android-dev-build.zip
    5.  
    where directory android-dev-build/ contains:

    Code (CSharp):
    1. $ ls android-dev-build/*
    2. android-dev-build/toc.pb
    3.  
    4. android-dev-build/splits:
    5. base-armeabi_v7a.apk  base-armeabi_v7a_2.apk  base-master.apk  base-master_2.apk
    6.  
    7. android-dev-build/standalones:
    8. standalone-armeabi_v7a.apk
    9.  
    How can I make unity execute the splits goal?