Compiling with Unity Basic

ManlyStumpManlyStump Posts: 8Member
Can somebody please give me a run-down on how to compile a project (such as one of the Unity OUYA examples) with the basic version of Unity? I've imported all the unity packages from the ODK and loaded the ShowController sample scene, but I can't use the buttons on the OUYA panel because it says plugins require a Unity Pro license.

Comments

  • DreamwriterDreamwriter Posts: 768Member
    Dont use the top button to compile, you pretty much want to press the bottom three buttons in order from bottom to top, then do a normal Unity build.
  • ManlyStumpManlyStump Posts: 8Member
    Ah ok, thanks. I take it you mean "Compile NDK" then "Compile Plugin" and finally "Compile Java", yes? I just tried "Compile NDK" and got the error:

    C:/Android/android-ndk-r8c/build/gmsl/__gmsl:512: *** non-numeric second argument to `wordlist' function: "

    I traced the relevant line from the file and it says:

    int_encode = $(__gmsl_tr1)$(wordlist 1,$1,$(__gmsl_input_int))

    But I haven't touched anything in the NDK at all, so why would that not compile?
  • ManlyStumpManlyStump Posts: 8Member
    Sorry, I should have Googled that. Now I'm getting an error from "Compile Java" where it says my bundle identifier is not a recognised class name. I've looked at the docs and it says the bundle identifier should match in the AndroidManifest file. Is that the issue? I tell which field in the AndroidManifest it should match to?
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    You need to set the bundle id in the ouya panel and then hit the sync button and it will make your OuyaApplication.java and Android manifest match.

    All the buttons, except for Build&Run will work on basic. For that step you just use the menu File->Build & Run.
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • ManlyStumpManlyStump Posts: 8Member
    Forgive me, what "sync" button? I'm also getting "package android.hardware.input does not exist" and "package android.hardware.input.InputManager does not exist" errors from the "Compile Java" command.

    Another error, "[Running Process] filename=C:/Program Files/Java/jdk1.7.0_21/bin/jar.exe arguments=cvfM OuyaUnityApplication.jar ouya/
    UnityEngine.Debug:Log(Object)" is causing "ouya : no such file or directory"
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    You want to use JDK 1.6 (32-bit).

    The sync button is in the OuyaPanel on the OUYA tab.
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
  • ManlyStumpManlyStump Posts: 8Member
    edited May 2013
    Right, I've done some investigation. After running "Compile Plugin" I get this result:

    [Results] elapsedTime: 0.1240071 errors: 
    output: Compiled from "IOuyaActivity.java"
    public class tv.ouya.sdk.IOuyaActivity extends android.app.Activity{
    protected android.os.Bundle m_savedInstanceState;
      Signature: Landroid/os/Bundle;
    public tv.ouya.sdk.IOuyaActivity();
      Signature: ()V
    protected void onCreate(android.os.Bundle);
      Signature: (Landroid/os/Bundle;)V
    public android.os.Bundle GetSavedInstanceState();
      Signature: ()Landroid/os/Bundle;
    public void SetSavedInstanceState(android.os.Bundle);
      Signature: (Landroid/os/Bundle;)V
    }

    which I took from the lack of errors to suggest it had worked. However the step of "Compile Java" which is looking for a Classes subfolder that doesn't exist. Does this mean it's not doing the "Compile Plugin" stage at all?
    Post edited by ManlyStump on
  • ManlyStumpManlyStump Posts: 8Member
    Right, I've made quite a bit of progress by myself now, but I've hit a brick wall. It seems to be working up till the call to javap.exe from within the "Compile Java" function, which is outputting:

    "ERROR:Could not find ouya.test.controllertest.OuyaUnityApplication". My Bundle ID is "ouya.test.controllertest", my package line in OuyaUnityApplication.java reads "package ouya.test.controllertest;" and my AndroidManifest.xml has the package of "ouya.test.controllertest.OuyaUnityApplication".

    Obviously this step is in there for a good reason, but I decided to build and run my apk on my Ouya (having run the rest of the "Compile Java" procedure manually using Command Prompt, but when I run the application on my Ouya it flashes up and closes again without any error message. Is there any way to get it to tell you what causes things like that? Does the Ouya have a log written anywhere?
  • DreamwriterDreamwriter Posts: 768Member

    There's an internal log, you can get at it using an Android tool "ADB".  From a command line do this:

    adb logcat

    and you'll see a full log of what's happening, including Unity Debug.Logs.  Use adb logcat -c to clear it.  The logcat is realtime, too, so you can do adb logcat and then run your game and watch the log.

    Note that your problem sure sounds like somewhere in one of your files your package name isn't matching.

  • ManlyStumpManlyStump Posts: 8Member
    I take it that requires plugging my Ouya into my PC and having the Ouya on one monitor with the PC on another, yes? I've not actually done that so far, I've been building the apk and copying it onto my Ouya afterwards.

    Well, I said the value value of my package name everywhere I think it needs to be set; are there any others I've missed?
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    Hopefully this will help, with one correction, now you get the latest from github.


    And the part on dependencies:

    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • ManlyStumpManlyStump Posts: 8Member
    OK thanks for that. I'm going to try and get into these videos, learn how to use GitHub, and start from scratch with a new project!

    I appreciate all your help and patience, tgraupmann and Dreamwriter!
Sign In or Register to comment.