- Export Unity as Gradle project, under build settings > Other settings change from Mono to IL2CPP and select ARMv7 and ARMv64.
- Create a new project in android studio and update settings.gradle with
include ':unityLibrary'
project(':unityLibrary').projectDir = new File("unityLibrary")
where project dir is path to the unityLibrary folder.
- In project level build.gradle under all projects include
flatDir { dirs "${project(':unityLibrary').projectDir}/libs" }
❗ Failing to do so will not compile Unity Package libraries such as AR Core Unity etc.
- In app level gradle under depedencies add
implementation project(':unityLibrary')
5. In strings.xml add string value
<string name="game_view_content_description">Game view</string>
❗ Failing to do so will throuw error on launching unity activity such as Res.layout not found.