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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

AAPT: error: resource android:attr/lStar not found.

Discussion in 'Android' started by studentvz, May 19, 2022.

  1. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Got stuck, does anyone have this error? Trying to build for Android 11.

    Unity 2019.4.39f1
    minSDK: 21
    targetSDK: 30

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

    stderr[
    Note: C:\Users\Admin\Documents\Unity Projects\Android\XXXXX\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':launcher:processReleaseResources'.
    > Android resource linking failed
    warn: removing resource com.XXX.XXXX:string/tt_request_permission_descript_external_storage without required default value.
    warn: removing resource com.XXX.XXXX:string/tt_request_permission_descript_location without required default value.
    warn: removing resource com.XXX.XXXX:string/tt_request_permission_descript_read_phone_state without required default value.
    C:\Users\Admin\.gradle\caches\transforms-2\files-2.1\fd03cc0dbb2402270569444d0b45bf49\res\values\values.xml:2362:5-2389:25: AAPT: error: resource android:attr/lStar not found.

    error: failed linking references.
     
  2. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
  3. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,855
    First try using Target API 3̶1̶/3̶2̶/33 and then later see if you need to downgrade any androidx libs which are using IStar attribute (which needs in api 3̶1̶/3̶2̶/33)

    Update:
    Those who don't get the issue fixed even after setting API 3̶1̶/3̶2̶/33, most likely you are on an older gradle version. For that would recommend to update your gradle version & android plugin gradle version. You can have a look here(check solution 1) on how to do that.
     
    Last edited: Jul 7, 2023
    wicea, met1903, EgoJacky and 3 others like this.
  4. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Some library was the issue, answer above solves it but I anyway have gone to Target 31. Waiting for crashes and bugs now. :rolleyes:
     
  5. OMOH26

    OMOH26

    Joined:
    Aug 16, 2022
    Posts:
    1
    It fixed my problem, thanks!!!
     
    Voxel-Busters likes this.
  6. hasanerzi

    hasanerzi

    Joined:
    May 11, 2022
    Posts:
    2
    worked for me, thanks ;)
     
    Voxel-Busters likes this.