Unity project as a dependency in Gradle

I am trying to import a unity3d project into my android project as a module. Everything is fine, gradle synchronization completed without errors, but when I add a unity project as a dependency on my project and run gradle sync, then it says:

Error:Dependency myapplication:unityproject:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: /Users/michal/Documents/Projects/myapplication/unityproject/build/outputs/apk/unityproject-release-unsigned.apk 

I tried google but no luck ... Thanks so much for any advice ... I use Android Studio (if that helps)

I can create and run a stand-alone unique3d project on a mobile device, the only problem is that I'm trying to add it as a module (dependency) to another project

+8
android android-studio android-gradle gradle unity3d
source share
3 answers

In Android Studio, you cannot depend on the Android application module (which has an APK as output). You can depend only on Java libraries (which compile with the JAR) or Android library modules (which compile in the AAR).

+5
source share

In your gradle.build library, change the line apply plugin: com.android.application to apply plugin: com.android.library and delete setApplicationId

+10
source share

I am an android noob, but I was able to import a simple Unity application into Android Studio by installing “Google Android Project” in the export dialog.

Deets: * Unity 4.6.1 * Android Studio 1.0 (note that if you download AS "1.0", you still need to do a software update a couple of times to really get it)

+1
source share

All Articles