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. Dismiss Notice

Unity3d 3.5 and Eclipse

Discussion in 'Android' started by xain908, Feb 17, 2012.

  1. xain908

    xain908

    Joined:
    May 20, 2011
    Posts:
    10
    Dear intelligent people of unity3d forums,

    What happened to 3.5? Before I was able to use the staging area as a library. But now, eclipse doesn't even recognize the staging area as a project. How can I integrate unity3d with eclipse now? If its impossible for 3.5, maybe I need to downgrade my Unity3d version.

    And can someone pleeease for the love of god give a step by step tutorial how to make a unity3d android plugin.

    I've been looking at this for days and this doesn't give me everything I need to build a plugin (http://unity3d.com/support/documentation/Manual/PluginsForAndroid.html). Their example even contains some files that is not included in their documentation. (Ex. libjavabridge.so, Android.mk, Application.mk, build_plugins.sh, NativeJavaBridge.cpp)

    PS. Sorry for the attitude, its been weeks now. I'm really having a hard time.

    Sincerely,
    Someone who has a headache trying to figure out unity3d, android, and android monetization
     
  2. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    Well its not their task to teach you how to program an Android native librabry (using the Android NDK), just how to use such an library with Unity.

    You must lern C/C++ and how to programm Android native libraries with NDK, so better check out Android developer website for that
     
  3. tommybear

    tommybear

    Joined:
    May 3, 2009
    Posts:
    33
    Yep something is definitely broken... I'm looking at this myself right now. I'll let you know if I figure it out.
     
  4. xain908

    xain908

    Joined:
    May 20, 2011
    Posts:
    10
    lol they updated the plugin page. let me see if its better now.
     
  5. okado

    okado

    Joined:
    Mar 30, 2012
    Posts:
    2
    Hi !
    Something is clearly broken with Eclipse integration in Unity3.5.
    But it's quite weird that your StagingArea isn't recognized as a project. The "normal" problem should be that the apk generated by Eclipse crash as soon as the UnityPlayer is launched.
    To solve it, you need to generate a new apk with the following command (thanks to Dustin Lee) :

    zipalign -v 4 old.apk new.apk

    You'll find zipalign in the "tools" directory of your android SDK.
    Hope it will help you, I've been looking for it for weeks too.
     
  6. TeotiGraphix

    TeotiGraphix

    Joined:
    Jan 11, 2011
    Posts:
    145
    This bug should be fixed in the next update release of Unity IE 3.5.1

    Mike
     
  7. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Now, you can do it..
     
    Last edited: Mar 31, 2012
  8. netlander

    netlander

    Joined:
    Nov 22, 2011
    Posts:
    28
    The problem is still there in Unity 3.5.2f2. That's not acceptable from the part of Unity considering that Android is a viable platform.

    And if you don't want to support Android just say so and make it clear so the Android development community can go to another game engine like Marmalade or Unreal.

    Thank you.
    Paul
     
  9. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    If your StagingArea is not recognized as an Eclipse Project, just add this two files to the staging area, then eclipse should treat it as a project.

    filename: .classpath:
    HTML:
    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
    	<classpathentry kind="src" path="src"/>
    	<classpathentry kind="src" path="gen"/>
    	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
    	<classpathentry kind="output" path="bin/classes"/>
    </classpath>
    
    filename: .project
    HTML:
    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
    	<name>YourProjectNameHere - Unity Library</name>
    	<comment></comment>
    	<projects>
    	</projects>
    	<buildSpec>
    		<buildCommand>
    			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    		<buildCommand>
    			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    		<buildCommand>
    			<name>org.eclipse.jdt.core.javabuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    		<buildCommand>
    			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    	</buildSpec>
    	<natures>
    		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
    		<nature>org.eclipse.jdt.core.javanature</nature>
    	</natures>
    </projectDescription>
    
     
  10. madhur

    madhur

    Joined:
    May 16, 2012
    Posts:
    86
    @Tseng -

    Need little more clarification about the above two files.

    Exactly where should I put those two files. Within the staging area folder or within any sub directory?

    And how should these 2 files be named and what is the extension for these files?

    Does this solve the unity 3.5 eclipse integration issue?

    Thanks :)
     
  11. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    In the StagingArea folder and the file names are already listed above:
    .classpath
    .project

    with . in front of it (may be very tricky to create this files in windows, as the explorer doesn't allow to create your file names which start with a dot).

    It should solve it. I copied them from one of my older "Unity Library" projects when I was adding a new one to eclipse