Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Android Studio - Trouble importing from Unity

Discussion in 'Android' started by nindim, Apr 7, 2014.

  1. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    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? :)

    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 :(

    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!).
     
  2. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    just a tip: if you upgrade Unity, ALWAYS make a backup of your game project first.
     
  3. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    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...
     
  4. nsejosh

    nsejosh

    Joined:
    Nov 16, 2012
    Posts:
    7
    Hi nindim- any luck with this?
     
  5. mccreadylemon

    mccreadylemon

    Joined:
    Aug 22, 2014
    Posts:
    1
    Same problem here!
     
  6. Orion_78

    Orion_78

    Joined:
    Feb 13, 2014
    Posts:
    66
    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 ?
     
  7. thonk

    thonk

    Joined:
    Nov 28, 2012
    Posts:
    6
    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.
     
    flyingbanana and aer0ace like this.
  8. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511
    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".
     
  9. Leo.wang

    Leo.wang

    Joined:
    Dec 31, 2015
    Posts:
    2
    hey,any luck with this ? some problem here!have you any advice for me?