Search Unity

Build Fails with specific Android Build Tools

Discussion in 'Unity Build Automation' started by xzodia, Feb 25, 2019.

  1. xzodia

    xzodia

    Joined:
    Jan 24, 2013
    Posts:
    50
    I've been struggling for several days now to get unity cloud build to work with my custom gradle file. I submitted a support ticket but they weren't able to help.
    Does anyone here have any ideas?

    AFAIK I need to use Build Tools 27.0.3 and gradle 2.3.0 or it wont build.

    I just get this error with no explanation:
    Code (csharp):
    1. EXCEPTION: FileNotFoundException: Temp/gradleOut/build/outputs/apk/release/gradleOut-release.apk does not exist
    Code (csharp):
    1. // GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
    2.  
    3. buildscript {
    4.     repositories {
    5.         jcenter()
    6.     }
    7.  
    8.     dependencies {
    9.         classpath 'com.android.tools.build:gradle:2.3.0'
    10.     }
    11. }
    12.  
    13. allprojects {
    14.     repositories {
    15.           flatDir {
    16.         dirs 'libs'
    17.       }
    18.  
    19.         maven {
    20.             url 'https://wearnotch.com/maven/notch/'
    21.             credentials {
    22.                 username '***'
    23.                 password '***'
    24.             }
    25.         }
    26.  
    27.         google()
    28.         mavenCentral()
    29.     }
    30. }
    31.  
    32. apply plugin: 'com.android.application'
    33.  
    34. dependencies {
    35.     compile fileTree(dir: 'libs', include: ['*.jar'])
    36.  
    37.     compile 'com.notch.sdk:sdk-android:1.1.330'
    38. **DEPS**}
    39.  
    40. android {
    41.     compileSdkVersion **APIVERSION**
    42.     buildToolsVersion '27.0.3'//'**BUILDTOOLS**'
    43.  
    44.     defaultConfig {
    45.         targetSdkVersion **TARGETSDKVERSION**
    46.         applicationId '**APPLICATIONID**'
    47.  
    48.        
    49.         jackOptions {
    50.             enabled true
    51.         }
    52.     }
    53.  
    54.    
    55.     packagingOptions {
    56.         exclude 'lib/x86_64/libnotchcore.so'
    57.         exclude 'lib/x86_64/libnotchcore-android.so'
    58.         exclude 'lib/arm64-v8a/libnotchcore.so'
    59.         exclude 'lib/arm64-v8a/libnotchcore-android.so'
    60.         exclude 'lib/arm64-v8a/libarpresto_api.so'
    61.         exclude 'lib/arm64-v8a/libarcore_unity_api.so'
    62.         exclude 'lib/arm64-v8a/libarcore_sdk_jni.so'
    63.         exclude 'lib/arm64-v8a/libarcore_sdk_c.so'
    64.     }
    65.  
    66.     compileOptions {
    67.         sourceCompatibility JavaVersion.VERSION_1_8
    68.         targetCompatibility JavaVersion.VERSION_1_8
    69.     }
    70.  
    71.     lintOptions {
    72.         abortOnError false
    73.     }
    74.  
    75.     aaptOptions {
    76.         noCompress '.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**
    77.     }
    78.  
    79. **SIGN**
    80.     buildTypes {
    81.           debug {
    82.              minifyEnabled **MINIFY_DEBUG**
    83.              useProguard **PROGUARD_DEBUG**
    84.              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
    85.               jniDebuggable true
    86.           }
    87.           release {
    88.              minifyEnabled **MINIFY_RELEASE**
    89.              useProguard **PROGUARD_RELEASE**
    90.               proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
    91.               **SIGNCONFIG**
    92.           }
    93.     }
    94.  
    95. }
    96.  
     
  2. ollieblanks

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    460
    Hey @xzodia, sorry to hear that you have been experiencing this issue with your Android builds.

    From looking at your support ticket and build history, it appears that you have managed to resolve this. Would you mind sharing your experience here for any future visitors that experience the same issue?
     
  3. xzodia

    xzodia

    Joined:
    Jan 24, 2013
    Posts:
    50
    Hi @ollieblanks sure.

    I managed to resolve this issue by setting the specific version of Unity. In my case 2017.3.0f3 rather than choosing 2017 Latest.
    This is potentially a good solution to other unexpected build failures, as I seem to recall fixing another project with the same solution.
     
    victorw and ollieblanks like this.