Android Plugin with AppCompat Theme

Hi everyone,

I encountered a problem which I am unable to solve til now. So any input is greatly appreciated.

I’m trying to build a plugin that uses an AppCompat style and I keep getting the error “Failed to re-package resources”

The error seems to come from an error within my .aar file when Unity compiles it. It has the error:

error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.

Anyone has any solution to this? Thanks in advance!

For your info, I am using the latest Unity and I also imported Cardboard SDK to the Unity project.

Hi guys,

I managed to get it working (like finally)!!

Well anyway, the above problem arise because Unity does not include appcompat library when it builds. I read about this in the unity blog. That is because of several reasons but mainly because of the APK size.

So if your plugin needs appcompat library, you need to add the library manually.

ps. If you only add appcompat library, it might cause another error saying “Rejecting re-init on previously-failed class java.lang.Class”
If this happens, try adding the support-v4 library too and hopefully it will be okay. (At least this works for me!)

I’m having the same problem and the solution seems to be no longer valid plus it is unclear as the comments point it out. I re-posted the (kind of) same problem on Stack Overflow: android - Unity says resource style/Theme.AppCompat.Light.NoActionBar not found - Stack Overflow. You can comment on either places with more clarification about what to copy where with the latest tools.