'Unity says resource style/Theme.AppCompat.Light.NoActionBar not found

I have a Unity project which, when compiled via Unity's Gradle build option, fails with

Output:  error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.xxx.sdk.unity:style/Theme.AppCompat.Light.NoActionBar) not found.
     error: failed linking references.

I can reproduce this same error by entering a terminal, and going into the Temp/gradleOut directory, then saying gradle :MySDK:verifyReleaseResources or gradle :MySDK:assemble. However, if I change it to gradle :assemble then it works fine (this is what Android Studio does when I open the same Temp/gradleOut directory and it builds and runs the app fine):

/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/gradle/bin/gradle :assemble

> Configure project : 

> Configure project :MySDK    

BUILD SUCCESSFUL in 17s

Is there a way to make Unity3d (2017.2.0f3 in my case as the latest version crashes on Linux) execute the same gradle task as Android Studio? So instead of trying to do :MySDK:whatever it would do :whatever?



Solution 1:[1]

Ciao, try adding .aar files in Assets/Plugins/Android folder. Something when you build your app for Android, look for that resource (are you using Facebook SDK for example ?) and when building android app Unity need to find that resources in android archives.

This is my configuration :

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ivan.rosina