Search Unity

Unity Gree error.

Discussion in 'Scripting' started by gunga, Jun 6, 2012.

  1. gunga

    gunga

    Joined:
    Jan 2, 2012
    Posts:
    170
    Anyone Tried Gree for Android?

    I've followed the PDF instructions but when i go to build my game I get this error:

    Code (csharp):
    1. System.IO.IOException: Failed to Move File / Directory from 'Assets/Editor/GREE/Android/c2dm/bin/classes.jar' to 'Assets/Plugins/Android/greeplatformforunity_c2dm.jar'.
    2.   at (wrapper managed-to-native) UnityEditor.FileUtil:MoveFileOrDirectory (string,string)
    3.   at GreeAndroidC2DMReceiverBuilder.Build () [0x0023f] in C:\Users\derkoi\Desktop\Unity Projects\Tests\Gree Test\Assets\Editor\GREE\GreeAndroidC2DMReceiverBuilder.cs:166
    4. UnityEngine.Debug:LogError(Object)
    5. GreeAndroidC2DMReceiverBuilder:Build() (at Assets/Editor/GREE/GreeAndroidC2DMReceiverBuilder.cs:168)
    6. AndroidBuilder:Build(Boolean, Boolean, String) (at Assets/Editor/GREE/AndroidBuilder.cs:35)
    7. ApplicationSettingsMenu:OnGUI() (at Assets/Editor/GREE/ApplicationSettingsMenu.cs:356)
    8. UnityEditor.DockArea:OnGUI()
    9.  
    Any ideas?
     
  2. msc4tech

    msc4tech

    Joined:
    Sep 8, 2011
    Posts:
    17
    same problem
     
  3. gunga

    gunga

    Joined:
    Jan 2, 2012
    Posts:
    170
    Ah so it's not just me?

    I emailed Gree support and they asked me to provide them with a log after double checking my paths to Ant Java.
     
  4. Deleted User

    Deleted User

    Guest

    Same issue here. The weird thing is that classes.jar is not even built, so there's nothing to move by Unity3d.

    Would be great if you will post Gree's support feedback.
     
  5. gunga

    gunga

    Joined:
    Jan 2, 2012
    Posts:
    170
    Just so you know I've send logs and stuff to Gree, they're still trying to sort it. I'll let you know any feedback I get.
     
  6. Akira675

    Akira675

    Joined:
    May 17, 2012
    Posts:
    14
    I had this, if you browse further up your logs it usually reveals the answer.

    Mine was a couple of things...
    The PATH was defaulting to an older version of JRE (c:\windows\system32) instead of the required JDK (c:\program files\java\jdk 7......) as system32 was the first location where java was 'found'.
    Secondly, Apache ANT (the required 'ant.bat' file) was out of date. If you get the latest version of eclipse it'll be the appropriate version, or update it yourself.
    Hope that helps.
     
  7. gunga

    gunga

    Joined:
    Jan 2, 2012
    Posts:
    170
    Thanks for that Akira.

    Could you please post your absolute paths to java ant, plus the versions you are using?
     
  8. Akira675

    Akira675

    Joined:
    May 17, 2012
    Posts:
    14
    You can get the latest version of Apache Ant with Eclipse Indigo. (I had been using an older version of eclipse) Otherwise you can get it here http://ant.apache.org/

    I pointed the "Ant Path" to "YOUR ECLIPSE FOLDER\plugins/org.apache.ant_1.8.2.v20120109-1030/bin/ant.bat." Any version around 1.8.x will work I believe.

    The version of JDK you should have is the latest. I haven't tried older ones as the PDF states that 7 is required.
    http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html

    You will then have to add ";C:\Program Files\Java\jdk1.7.0_04\bin" to your path.

    In Windows 7:
    Start Menu -> Type "environment" in the search box.
    Open "Edit environment variables for your account"
    Append the existing PATH variable, or create a new one.
     
  9. msc4tech

    msc4tech

    Joined:
    Sep 8, 2011
    Posts:
    17
    i've all installed correctly but don't work :(
     
  10. Akira675

    Akira675

    Joined:
    May 17, 2012
    Posts:
    14
    What does your log say when you try to build MSC? You should get the error at the top of this thread, which unhelpfully actually just means you've failed to build. (It can't copy the file because it was never created.) Locate that error, then click on each log entry above that, one of those will hold the clues. Most likely related to java or ant.
     
  11. gunga

    gunga

    Joined:
    Jan 2, 2012
    Posts:
    170
    Hmmm apparently it only supports Unity Pro. :(
     
  12. Akira675

    Akira675

    Joined:
    May 17, 2012
    Posts:
    14
    I can confirm it working with Unity Indie.
    Run the build from the GREE menu. Cancel the part where you select the APK location (or let it fail). You only have to do this once, as its to build the GREE jar files and create the AndroidManifest.XML, after this you can just keep building from Unity as normal.

    (I then had to manually merge a few things (Mobclix and AdMob settings) into the new generated AndroidManifest, but this was a once off.
     
  13. gunga

    gunga

    Joined:
    Jan 2, 2012
    Posts:
    170
    Thanks Akira, I'll try later. Building models at the moment.
     
  14. gunga

    gunga

    Joined:
    Jan 2, 2012
    Posts:
    170
    Got it! It was my home path, it was set to Microsoft windows live?!?

    Thanks for your help Akira. :)
     
    Last edited: Jun 13, 2012
  15. beriss

    beriss

    Joined:
    Oct 18, 2011
    Posts:
    9
    Hi, i have the same problem. I tried the solution based on your post but still I can't build my application. I'm not sure if I selected the correct path for "Java Path". I selected " C:\Program Files\Java\jdk1.7.0_04\bin\ java.exe". Which path should I select for "Java Path"?

    Thanks!
     
  16. Akira675

    Akira675

    Joined:
    May 17, 2012
    Posts:
    14
    When the GREE plugin tries to build the C2DM jar, it goes looking for Java, however as far as I'm aware, it doesn't actually use the path you specify in the GREE window's "Java Path" field. According to the .pdf, "Java Path" is used for the "absolute path for Java command used for execution encrypting tool," but it doesn't elaborate. You can actually leave this field empty and still build the plugin without errors.

    When your system goes looking for Java, its going to use the first one it finds. In all likelihood, you've got multiple copies installed, likely at "C:/Windows/System32/Java.exe" / "Windows/SysWOW64/Java.exe" and perhaps multiple JDK/JRE's. To solve the error, you need to make sure the first instance of Java it finds is the version you need, in this case JDK7. I can't remember the exact order it goes searching for Java in, but adding ";C:\Program Files\Java\jdk1.7.0_04\bin" to your PATH environment variable should point it the right way.

    Like so:
     
  17. beriss

    beriss

    Joined:
    Oct 18, 2011
    Posts:
    9
    We have solved the problem by commenting out the below codes from "GreeAndroidC2DMReceiverBuilder" Class

    Code (csharp):
    1.  
    2. // move
    3.         /*
    4.         try {
    5.             FileUtil.MoveFileOrDirectory(prjDir + "/bin/classes.jar", jarFile);
    6.             FileUtil.DeleteFileOrDirectory(jarFile);
    7.         } catch (IOException e) {
    8.             UnityEngine.Debug.LogError(e);
    9.             EditorUtility.ClearProgressBar();
    10.             EditorUtility.DisplayDialog("Build C2DMReceiver", "Build Failed - Moving JAR archive file.", "ok");
    11.             return false;
    12.         }*/
    13.  
    Then we've found the "classes.jar" file from "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androiddevelopmentplayer\bin" and copied it manually to "C:\Users\pc\Desktop\GreeTest\Assets\Editor\GREE\Android" and renamed it to "greeplatformforunity_c2dm" this is exactly what the above code tries to do.

    That's it, now we can build our application and GREE just works without a single problem.
     
  18. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    How am I suppose to find the path on Mac? Any idea?

     
  19. gunga

    gunga

    Joined:
    Jan 2, 2012
    Posts:
    170
    Try searching on a mac for the files. It might work.
     
  20. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    I did already, but it doesn't give me anything relevant....
     
  21. cpasjuste

    cpasjuste

    Joined:
    Apr 2, 2012
    Posts:
    154
    Woot thanks akira, cant wait tomorow to test.
     
  22. anilgautam

    anilgautam

    Joined:
    Jul 23, 2012
    Posts:
    8
    I am Getting Error for GREE integration in Unity 3d .When I am trying to build the project it is showing following errors
    1- Moving File failed. Assets/editor/gree/android/c2dm/bin/classes.jar to
    assets/plugin/android/greeplatformforunity_c2dm.jar
    When I manually move the file classes .jar to this location .Then It ask for path and when building apk. It shows following error
    2. Building DEX Failed! Failed to compile java code to DEX. See the console for details.
    I search for all the forums and unity community for this they all provide me only solution to move file update java . I have latest and compatable version of java already installed on my windows.
    Kindly Help.
     
    Last edited: Aug 7, 2012
  23. Dalmia

    Dalmia

    Joined:
    Sep 7, 2012
    Posts:
    7
    When launching dasboard, the app is force closing after few seconds.This issues is not in google nexus devices. But reported its HTC Desire,HTC evo devices ..I have refer "https://docs.developer.gree.net/en/globaltechnicalspecs/sdkforunity/sdk-for-unity-developerguide20120831-en.pdf".
     
  24. Arc_Blight

    Arc_Blight

    Joined:
    Nov 29, 2012
    Posts:
    8
    I'm also trying to build a project with GREE, but I get this following error when I build:

    BUILD FAILED
    (path to project)\build.xml:46:sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var

    and there pops out another error afterwards

    Build Activity
    Failed to build activity classes with ant

    Does anyone have a solution for this problem?
    Thank you!