Android Studio - Trouble importing from Unity

Hi,

I am using Unity 4.3.1 and I am trying to integrate Crashlytics into my unity app. To that end, I am trying to get setup in Android Studio so I can use their plugin and follow the guide. So far, I have:

  • Installed JDK8
  • Installed Android Studio (0.4.6)
  • Updated my unity install to point to the SDK that comes installed with Android Studio.
  • Exported a build with “Google Android Project” ticked.

So far so good… The problem comes with me actually trying to use the exported build in Android Studio. I thought I would just be able to open or import the project that unity built for me. Do I need to create a new Android Studio project and copy files around? There are a lot of options when you create a new project, if anyone could provide some guidance, I’d be really grateful.

I found this: http://forum.unity3d.com/threads/219106-Using-Android-Studio-for-Unity3d?highlight=android+studio but I don’t think it’s relevant, I want to launch directly into my unity app (as if I had just built the .apk from Unity directly). I have zero experience with native android dev, so if anything from that post is relevant, could you please explain it as if to a newborn? :slight_smile:

I haven’t been able to find any docs on this feature either, I think it only came in with Unity 4.2 and was just a release note :frowning:

Would upgrading to Unity 4.3.4 help? I don’t see anything relevant in the release notes. I’m nearing the end of the project so would prefer to leave things as they are if I can (but will upgrade if I must!).

just a tip: if you upgrade Unity, ALWAYS make a backup of your game project first.

The project is fully source controlled though so it’s easy enough to roll back if upgrading did mess it up. Thanks for the tip though, might help someone else at some point.

Do you think I’ve posted this in the right forum? I’m tempted to try and move it into the general Unity forum to see if anyone there can help…

Hi nindim- any luck with this?

Same problem here!

Hi, I dig up this old post because I am strugle with the same problem : how to build an exported Google Android Project ?

I open it with Android Studio, I had to manually add librairies and stuff but error keep coming out.
Shouldn’t be straightforward ? Like export ; import with Android Studio ; build ?

If you are stuck on importing Unity’s Google Android Project export into Android Studio, this might be the problem.

Don’t use “Open” or “Import Settings” to open the project. You need to go to “New->Import Project” for it to work.

I just found this out a few days ago after beating my head against it.

2 Likes

Hah. Coincidentally, I just solved the same problem with my project before reading this post.
What was weird was I had it working on earlier tests, and it all of a sudden stopped working for me when I brought in some libraries. And I think some sort of muscle memory in me went to “Open” instead of “New > Import Settings”.

hey,any luck with this ? some problem here!have you any advice for me?