Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Solved]HELP!!!! Execution failed for task ':processReleaseResources'

Discussion in 'Editor & General Support' started by jayderyu, Sep 7, 2019.

  1. jayderyu

    jayderyu

    Joined:
    Dec 28, 2015
    Posts:
    17
    I'm having an issue building and need some help. My gradle skills a lack luster. This is failing on my local machine, but I will need to eventually get this running on Cloud build.

    The game I'm working on is upgrading from Unity 2017 p4, to 2018.4 LTS. This step went without much of a problem. However, we also needed to update Facebook to the most recent SDK and this is what's causing the issue. I deleted the old FB and install the new SDK let FB and the Jar Resolver handle all the jars/aars which and now this is the result.

    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_221\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2018.4.8f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':processReleaseResources'.
    > Android resource linking failed
    C:\Users\jayde\.gradle\caches\transforms-2\files-2.1\ded34c17809e6a829271917aae09ca11\res\values-v26\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

    C:\Users\jayde\.gradle\caches\transforms-2\files-2.1\ded34c17809e6a829271917aae09ca11\res\values-v26\values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.

    C:\Users\jayde\.gradle\caches\transforms-2\files-2.1\ded34c17809e6a829271917aae09ca11\res\values-v26\values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

    C:\Users\jayde\.gradle\caches\transforms-2\files-2.1\ded34c17809e6a829271917aae09ca11\res\values\values.xml:148:5-153:84: AAPT: error: resource android:attr/fontStyle not found.

    C:\Users\jayde\.gradle\caches\transforms-2\files-2.1\ded34c17809e6a829271917aae09ca11\res\values\values.xml:148:5-153:84: AAPT: error: resource android:attr/font not found.

    C:\Users\jayde\.gradle\caches\transforms-2\files-2.1\ded34c17809e6a829271917aae09ca11\res\values\values.xml:148:5-153:84: AAPT: error: resource android:attr/fontWeight not found.

    error: failed linking references.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 1m 22s
    ]
    stdout[

    > Configure project :
    WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
    It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
    WARNING: DSL element 'DexOptions.incremental' is obsolete and will be removed at the end of 2018.

    > Task :preBuild UP-TO-DATE
    > Task :Heyzap:preBuild UP-TO-DATE
    > Task :Heyzap:preReleaseBuild UP-TO-DATE
    > Task :Heyzap:checkReleaseManifest
    > Task :Heyzap:processReleaseManifest
    > Task :I2Localization:preBuild UP-TO-DATE
    > Task :I2Localization:preReleaseBuild UP-TO-DATE
    > Task :I2Localization:checkReleaseManifest
    > Task :I2Localization:processReleaseManifest
    > Task :MainLibProj:preBuild UP-TO-DATE
    > Task :MainLibProj:preReleaseBuild UP-TO-DATE
    > Task :MainLibProj:checkReleaseManifest
    > Task :MainLibProj:processReleaseManifest
    > Task :OneSignalConfig:preBuild UP-TO-DATE
    > Task :OneSignalConfig:preReleaseBuild UP-TO-DATE
    > Task :OneSignalConfig:checkReleaseManifest
    > Task :OneSignalConfig:processReleaseManifest
    > Task :unity-android-resources:preBuild UP-TO-DATE
    > Task :unity-android-resources:preReleaseBuild UP-TO-DATE
    > Task :unity-android-resources:checkReleaseManifest
    > Task :unity-android-resources:processReleaseManifest
    > Task :preReleaseBuild
    > Task :Heyzap:compileReleaseAidl NO-SOURCE
    > Task :I2Localization:compileReleaseAidl NO-SOURCE
    > Task :MainLibProj:compileReleaseAidl NO-SOURCE
    > Task :OneSignalConfig:compileReleaseAidl NO-SOURCE
    > Task :unity-android-resources:compileReleaseAidl NO-SOURCE
    > Task :compileReleaseAidl NO-SOURCE
    > Task :Heyzap:packageReleaseRenderscript NO-SOURCE
    > Task :I2Localization:packageReleaseRenderscript NO-SOURCE
    > Task :MainLibProj:packageReleaseRenderscript NO-SOURCE
    > Task :OneSignalConfig:packageReleaseRenderscript NO-SOURCE
    > Task :unity-android-resources:packageReleaseRenderscript NO-SOURCE
    > Task :compileReleaseRenderscript NO-SOURCE
    > Task :checkReleaseManifest
    > Task :generateReleaseBuildConfig
    > Task :prepareLintJar
    > Task :generateReleaseSources
    > Task :Heyzap:compileReleaseRenderscript NO-SOURCE
    > Task :Heyzap:generateReleaseBuildConfig
    > Task :Heyzap:generateReleaseResValues
    > Task :Heyzap:generateReleaseResources
    > Task :Heyzap:packageReleaseResources
    > Task :Heyzap:generateReleaseRFile
    > Task :Heyzap:prepareLintJar
    > Task :Heyzap:generateReleaseSources
    > Task :Heyzap:javaPreCompileRelease
    > Task :Heyzap:compileReleaseJavaWithJavac
    > Task :Heyzap:bundleLibCompileRelease
    > Task :I2Localization:compileReleaseRenderscript NO-SOURCE
    > Task :I2Localization:generateReleaseBuildConfig
    > Task :I2Localization:generateReleaseResValues
    > Task :I2Localization:generateReleaseResources
    > Task :I2Localization:packageReleaseResources
    > Task :I2Localization:generateReleaseRFile
    > Task :I2Localization:prepareLintJar
    > Task :I2Localization:generateReleaseSources
    > Task :I2Localization:javaPreCompileRelease
    > Task :I2Localization:compileReleaseJavaWithJavac
    > Task :I2Localization:bundleLibCompileRelease
    > Task :MainLibProj:compileReleaseRenderscript NO-SOURCE
    > Task :MainLibProj:generateReleaseBuildConfig
    > Task :MainLibProj:generateReleaseResValues
    > Task :MainLibProj:generateReleaseResources
    > Task :MainLibProj:packageReleaseResources
    > Task :MainLibProj:generateReleaseRFile
    > Task :MainLibProj:prepareLintJar
    > Task :MainLibProj:generateReleaseSources
    > Task :MainLibProj:javaPreCompileRelease
    > Task :MainLibProj:compileReleaseJavaWithJavac
    > Task :MainLibProj:bundleLibCompileRelease
    > Task :OneSignalConfig:compileReleaseRenderscript NO-SOURCE
    > Task :OneSignalConfig:generateReleaseBuildConfig
    > Task :OneSignalConfig:generateReleaseResValues
    > Task :OneSignalConfig:generateReleaseResources
    > Task :OneSignalConfig:packageReleaseResources
    > Task :OneSignalConfig:generateReleaseRFile
    > Task :OneSignalConfig:prepareLintJar
    > Task :OneSignalConfig:generateReleaseSources
    > Task :OneSignalConfig:javaPreCompileRelease
    > Task :OneSignalConfig:compileReleaseJavaWithJavac
    > Task :OneSignalConfig:bundleLibCompileRelease
    > Task :unity-android-resources:compileReleaseRenderscript NO-SOURCE
    > Task :unity-android-resources:generateReleaseBuildConfig
    > Task :unity-android-resources:generateReleaseResValues
    > Task :unity-android-resources:generateReleaseResources
    > Task :unity-android-resources:packageReleaseResources
    > Task :unity-android-resources:generateReleaseRFile
    > Task :unity-android-resources:prepareLintJar
    > Task :unity-android-resources:generateReleaseSources
    > Task :unity-android-resources:javaPreCompileRelease
    > Task :unity-android-resources:compileReleaseJavaWithJavac
    > Task :unity-android-resources:bundleLibCompileRelease
    > Task :javaPreCompileRelease
    > Task :mainApkListPersistenceRelease
    > Task :generateReleaseResValues
    > Task :generateReleaseResources
    > Task :mergeReleaseResources
    > Task :createReleaseCompatibleScreenManifests
    > Task :processReleaseManifest
    > Task :processReleaseResources FAILED

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    61 actionable tasks: 61 executed
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    ------------------------------------------------------------------------------------------------
    the gradle file is updated from early unity 2017


    // GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

    buildscript {
    repositories {
    mavenCentral()
    google()
    jcenter()
    }

    dependencies {
    classpath 'com.android.tools.build:gradle:3.4.0'
    **BUILD_SCRIPT_DEPS**}
    }

    allprojects {
    repositories {
    mavenCentral()
    google()
    jcenter()
    flatDir {
    dirs 'libs'
    }
    }
    }

    apply plugin: 'com.android.application'
    **APPLY_PLUGINS**

    dependencies {
    compile 'com.android.support:multidex:1+'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    **DEPS**}

    android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
    minSdkVersion **MINSDKVERSION**
    targetSdkVersion **TARGETSDKVERSION**
    applicationId '**APPLICATIONID**'
    ndk {
    abiFilters **ABIFILTERS**
    }
    versionCode **VERSIONCODE**
    versionName '**VERSIONNAME**'

    // Enabling multidex support.
    multiDexEnabled true
    }

    lintOptions {
    abortOnError false
    }

    aaptOptions {
    noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]
    }**SIGN**

    dexOptions {
    javaMaxHeapSize "4g"
    incremental false
    }

    buildTypes {
    debug {
    //minifyEnabled **MINIFY_DEBUG**
    //useProguard **PROGUARD_DEBUG**
    //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
    jniDebuggable true

    minifyEnabled false
    shrinkResources false
    }
    release {
    //minifyEnabled **MINIFY_RELEASE**
    //useProguard **PROGUARD_RELEASE**
    //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
    minifyEnabled false
    shrinkResources false
    }
    }**PACKAGING_OPTIONS****SPLITS**
    **BUILT_APK_LOCATION**
    bundle {
    language {
    enableSplit = false
    }
    density {
    enableSplit = false
    }
    abi {
    enableSplit = true
    }
    }
    }**SPLITS_VERSION_CODE****REPOSITORIES****SOURCE_BUILD_SETUP**
     
  2. jayderyu

    jayderyu

    Joined:
    Dec 28, 2015
    Posts:
    17
    After smashing my face against a brickwall for a few hours and reading a lot about other gradle problems. I finally found a very simple solution.

    I changed the SDKTOOLS and Builttools to 26 in the gradle android manually instead of relying on Unit's settings.




    How I eventually found this out was noticing two key points.

    Key point 1
    A resource version
    C:\Users\jayde\.gradle\caches\transforms-2\files-2.1\ded34c17809e6a829271917aae09ca11\res\values-v26\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

    Key points 2
    In my mainTemplate.gradle I finally noticed that Unity has these compile and version tools. I was setting them too but in addition.
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    The change I made was to use old ones and set the manually rather than rely on Unity settings that I don't know where to set.
    compileSdkVersion 26
    buildToolsVersion '26.0.2'

    After making this change I was able to get an APK. Now in the near future I have to make sure this will still work with cloud build.
     
    GuruJeya14 and denizdenizdeniz like this.
  3. asger60

    asger60

    Joined:
    Mar 27, 2013
    Posts:
    40
    Hey, I'm having this problem as well.
    "I changed the SDKTOOLS and Builttools to 26 in the gradle android manually instead of relying on Unit's settings."

    Where did you do this? In Android Studio?
     
  4. jayderyu

    jayderyu

    Joined:
    Dec 28, 2015
    Posts:
    17
    I didn't change these in Android Studio. The two changes I made sure were there
    1) I changed them in the gradle template file found in Assets/Plugin/Android
    2) I installed the build 26 tools in the Android SDK installed
    However, again at the time I was not using Android Studio. The SDK install was the older version.

    This was an issue going from 2017 to 2018. We are in Unity 2019 now. Which I haven't had an issue with build tools. Often I found I can either configure the Unity settings or template gradle file to use the correct build information.
     
  5. poortasa

    poortasa

    Joined:
    Feb 4, 2021
    Posts:
    1
    Hi,
    I'm new to Unity and this solution may seem pretty basic.

    I am using Unity version 2020.3.16f1 (LTS)
    I faced numerous problems right after installation.
    I had to manually download components of SDK, NDK and OpenJDK for the Android Support to start working, because Unity hub did not actually install them and did a "pseudo" install without even creating the SDK, NDK, OpenJDK folders.
    (I then checked the modules.json file in the parent Unity folder and it seems that the Unity hub only installed "1" component from a list and I had to do the rest manually)

    In the meantime, it seems that I forgot to rename the folder inside /SDK/platforms , from android-10 to android-29 (this was a part of the manual installation)

    First time building the APK, I got no errors and just a few warnings from Gradle stating that it was "expecting" a folder named android-29 and not android-10

    However the task finished successfully! and the APK was built.

    I thought I would rename it to android-29 and these few warnings would disappear. But lo and behold, the Gradle errors came up and here I am!
    For me, seems like renaming the folder to android-10 still works; Also tried renaming it to android-26.

    I could not install the apk in an emulated device, but I still don't know how to properly work with that. Instead I could easily install the APK in my own phone (Galaxy Note 9 - Android 10) and the program seemingly runs without problems.
     
  6. Hashim-J

    Hashim-J

    Joined:
    Aug 10, 2021
    Posts:
    3
    Solved... Plus I was having three more errors like gradle daemon failed error and have consulted countless videos, unity forums after a lot of suffering I got my build ready to play. Thank GOD it worked, hopefully it will work for you guys to...)).

    Open your project in unity then go to Edit/Project Settings.../Player and then find identification (like in the image) solved problem.png
    Now finally tick that box (Override Default Package Name), go back hit Build and Booooom... Ready to play your APK.

    Well if this does not work for you so don't blame me because I don't even know how this works. Originally I was totally fed up, couldn't find any solution and started doing random changes in project then somehow got the success...)))
    If someone knows what this option does let me knew. Thanks.

    Unity version 2021.3.0f1
     
    Last edited: May 2, 2022
  7. Ege

    Ege

    Joined:
    Sep 16, 2019
    Posts:
    1
    Lol, idk how and why but this method worked for me too! Thank you so much!
     
    Hashim-J likes this.
  8. GoodAUB

    GoodAUB

    Joined:
    Apr 1, 2017
    Posts:
    9
    Hi everyone,

    I just found that the easiest workaround would be to change the Gradle version in your grade > wrapper > gradle-wrapper.properties file to something lower than 7.
    You can change in the distributionUrl the Gradle version from /gradle-7.1-bin.zip to /gradle-6.8-bin.zip and it should fix your issue.

    Best Regards,
     
    Athomield3D likes this.
  9. coolpuppykid

    coolpuppykid

    Joined:
    Mar 16, 2020
    Posts:
    2
    idk what you mean
     
  10. coolpuppykid

    coolpuppykid

    Joined:
    Mar 16, 2020
    Posts:
    2
    i found the solution i think if you have a keystore like me go to where it is make a new one with same path as the old one then set all it info the same as the old one
     
  11. Athomield3D

    Athomield3D

    Joined:
    Aug 29, 2012
    Posts:
    193
    Thanks everyone for your help. This is very important to say ; as of 2021.3 DO NOT USE Grade 7 or above ! If you did you have to delete the contents of Plugins/Android change gradle to 6.9 or less. I did not find the gradle-wrapper.properties file so I downloaded gradle manually and then set it in the preferences !
    Cheers
     
  12. Amjad18

    Amjad18

    Joined:
    Dec 17, 2020
    Posts:
    2
    where i can find gradel ?
     
  13. CraftedGaming

    CraftedGaming

    Joined:
    Jun 9, 2017
    Posts:
    35
  14. wechat_os_Qy01eDJfSV7CWSHuAPwDqgMCA

    wechat_os_Qy01eDJfSV7CWSHuAPwDqgMCA

    Joined:
    Aug 4, 2022
    Posts:
    8
    Had a similar problem: Execution failed for task ':launcher:processReleaseResources'.
    The solution that worked for me is to change the default package name from com.package.id to com.hello.xxxxswi
     
  15. hid_

    hid_

    Joined:
    Apr 5, 2021
    Posts:
    10
    In my case the issue was in Target Level API.
    By default API 34 was set.
    After changing it to API 33 gradle built my project.
    Probably the root cause is API 34 in beta at this moment.
    Hope this will help if you are strugging a whole day like I am.
     
    bettywhite, Alekxss, appllee and 3 others like this.
  16. Kingdox7

    Kingdox7

    Joined:
    Mar 30, 2020
    Posts:
    4
    THANKS
     
  17. Elestin

    Elestin

    Joined:
    Apr 8, 2015
    Posts:
    10
    Thanks, this solved my problem. I tried a lot of other things for hours none of them worked but this.
     
  18. maratSalih

    maratSalih

    Joined:
    May 4, 2023
    Posts:
    1
    thank a lot, it work!
     
  19. appllee

    appllee

    Joined:
    Jan 4, 2013
    Posts:
    3
    This saved my life
     
    Alekxss likes this.
  20. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    I got the play services code from github and put in the package from the git repository which was 0.11.0.1, my package is set to API 33, it built just fine before adding the play services code, now i am stuck with this same error as this thread.
     
  21. tauseefnasir501

    tauseefnasir501

    Joined:
    Apr 2, 2021
    Posts:
    7
    Thank You! you saved me hours