Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Android: Facing build time error

Discussion in 'Assets and Asset Store' started by eagleTiger, Jun 29, 2021.

  1. eagleTiger

    eagleTiger

    Joined:
    Apr 20, 2017
    Posts:
    14
    Hi,
    I'm using Unity 2020.2.1f1 on Mac (macOS Catalina 10.15.6) and the selected platform is Android. The following same issues are arising in my two different projects which I'm trying to modify now.

    Major modules of both projects are:
    - Google Firebase
    - Google Sign In
    - Sign In with Apple (2nd project don't have it)
    - UniWebView4 (added at the end, before everything was working)

    Issues I get while building the apk are:

    Code (CSharp):
    1. Starting a Gradle Daemon (subsequent builds will be faster) Configure project :launcher WARNING: The option 'android.enableR8' is deprecated and should not be used anymore. It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.


    Code (CSharp):
    1. Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':launcher:checkReleaseDuplicateClasses'.


    Code (CSharp):
    1. CommandInvokationFailure: Gradle build failed. /Applications/Unity/Hub/Editor/2021.1.13f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2021.1.13f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
    2.  
    3. stderr[ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    4.  
    5. FAILURE: Build failed with an exception.
    6.  
    7. What went wrong: Execution failed for task ':launcher:checkReleaseDuplicateClasses'. 1 exception was raised by workers: java.lang.RuntimeException: Duplicate class android.support.v4.app.RemoteActionCompatParcelizer found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and jetified-androidx.core.core-1.2.0-runtime.jar (:androidx.core.core-1.2.0:)








    If all following settings of UniWebView are unchecked then build is created, but the browser doesn't work

    Before importing UniWebView it was working fine in both projects. While the developer of UniWebView4 says it has no issue

    Solutions already tried are:
    - Deleted the Library, Logs, obj folders and opened the project again
    - Updated the Android SDK
    - Linked to JDK 8 outside the recommended folder under installed Unity version
    - Deleted Unity 2020.2.1f and reinstalled it
    - Uncheck Jetifier in UniWebView4, as already enabled in PlayServices
    - Tried this script
     

    Attached Files:

    Last edited: Jul 8, 2021
  2. lesha2529

    lesha2529

    Joined:
    May 15, 2018
    Posts:
    2
    @eagleTiger
    Hello, have you found a solution?
    I have exactly the same problem
     
  3. Gamer4x

    Gamer4x

    Joined:
    Jul 1, 2021
    Posts:
    1
  4. lesha2529

    lesha2529

    Joined:
    May 15, 2018
    Posts:
    2
  5. jbs_unity

    jbs_unity

    Joined:
    May 15, 2019
    Posts:
    1
    Hey guys, still no one found a solution for this?