Unity-Technologies / uaal-example

Other
736 stars 234 forks source link

Option to build unityLibrary as an AAR #41

Open NickRussell95 opened 3 years ago

NickRussell95 commented 3 years ago

We have an AR Android app that embeds the exported unityLibrary using AR Foundation. For our Unity developers the build process works great. However not all of our Android developers are set up to use Unity which is required to be installed in order to build the android app.

Is it possible to add a post-build script to Unity which builds the unityLibrary into an aar which can then be imported into the native Android app. This way Android developers can easily just clone the repo without having to first install the proper version of Unity just to build the section of the app that they do not develop.

adavies25 commented 3 years ago

I'm dealing with this right now. I tried creating an massive AAR of the unityLibrary to distribute in my company. It sort of worked except I noticed using ARFoundation in the unityLibrary/libs directory are several other AAR support files for ARCore, etc. and I learned you can't combine AAR files because there could be resource conflicts. You can however create a local maven repository on disk that references those AARs as dependencies. Seems more trouble than it's worth so I'm just going to zip up the unityLIbrary directory and use that.