Search Unity

Bug I'm trying to build for android

Discussion in 'Android' started by unity_48AF4A0BF04D20CFFA84, Dec 9, 2022.

  1. unity_48AF4A0BF04D20CFFA84

    unity_48AF4A0BF04D20CFFA84

    Joined:
    Dec 8, 2021
    Posts:
    2
    And I get errors, I just didn't try to do everything doesn't help
    upload_2022-12-9_18-53-54.png

    > Configure project :launcher
    WARNING: The option setting 'android.enableR8=false' is deprecated.
    It will be removed in version 5.0 of the Android Gradle plugin.
    You will no longer be able to disable R8

    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)



    FAILURE: Build failed with an exception.

    * What went wrong:
    Could not determine the dependencies of task ':launcher:lintVitalRelease'.
    > This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
    The following AndroidX dependencies are detected: androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.core:core:1.2.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.2.0, androidx.startup:startup-runtime:1.0.0, androidx.tracing:tracing:1.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0

    * 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 665ms
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)



    CommandInvokationFailure: Gradle build failed.
    C:\Program Files\Unity\Hub\Editor\2022.1.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.1.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    Could not determine the dependencies of task ':launcher:lintVitalRelease'.
    > This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
     

    Attached Files:

  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    Your error is:
    Code (CSharp):
    1. Could not determine the dependencies of task ':launcher:lintVitalRelease'.
    2. > This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
    Basically select gradle properties template in ProjectSettings and add android.useAndroidX = true.
     
  3. unity_48AF4A0BF04D20CFFA84

    unity_48AF4A0BF04D20CFFA84

    Joined:
    Dec 8, 2021
    Posts:
    2
    If I do this
    upload_2022-12-10_1-6-47.png
    and
    upload_2022-12-10_1-7-47.png
    I get:

    I do it:
    upload_2022-12-10_1-9-46.png
    I get:

    I click Resolve and get:

    if I click Ignore anywhere I get the same errors
     

    Attached Files:

  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    If I understand correctly, this dependency manager dialog comes from a plugin you've installed, thus I can't comment on why it's not working, you should contact the owner of that plugin, maybe updating to newer version can fix this.
     
  5. techleadne

    techleadne

    Joined:
    May 14, 2023
    Posts:
    1
    I got the same error when trying to integrate the ByteBrew SDK. I added the two lines mentioned above
    android.useAndroidX=true
    android.enableJetifier=true
    in my Assets/Plugins/Android/gradeTemplate.properties file and that fixed the issue for me
     

    Attached Files: