GLBasic forum

Main forum => GLBasic - en => Topic started by: Marmor on 2013-Aug-04

Title: OUYA Compiling Help
Post by: Marmor on 2013-Aug-04
hmm after all downloads and new installed sdk and ndk and new files for the android folders i get so many errors , iam confused !

i have read all the forum threads but cant solved the problems.
i use 11.414 .
so please can anyone show me a step by step tutorial for developing for the ouya ?
sry.
Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-04
Did you use this download in the bonus section (require a 100+ post) or Gernot reupload its some else url?
http://www.glbasic.com/forum/index.php?topic=9341.0

That file contain the whole android folder with anything needed for api-14 and api-16 development (include connection to the android extras). Howover templateproj folder was NOT included in the above file.

Now im have now just included the whole templateproj folder with all android files in the correct place, so you should been able to replace the templateproj folder with this one (of course BACKUP before doing deleting the old one). Property you might have missing the ODK file, which is included now.

Also if you still have errors, you should delete the whole project folder in the Android distrubtion dir. Sometimes mixes old and new files can cause errors.

Also for some reason v1.2 dident currectly updated as v1.4, but its does that now. The URL is the same and is now 8mb.
Title: Re: OUYA Compiling Help
Post by: Marmor on 2013-Aug-04
my errors :

_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.9.921 SN:20d39e3d - 3D, NET
Wordcount:338 commands
compile+link:
running Android build-script...
BUILD STAGE 1: Compile and pack RELEASE
Q:\Compiler\platform\Android\bin\..\android-sdk-windows
Updated and renamed default.properties to project.properties
Updated local.properties
Added file C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\build.xml
Added file C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\proguard-project.txt
   [subant] No sub-builds to iterate on
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivityold.java:36: error: duplicate class: org.libsdl.app.CopyAssetsThread
    [javac] class CopyAssetsThread extends Thread
    [javac] ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivityold.java:150: error: class SDLActivity is public, should be declared in a file named SDLActivity.java
    [javac] public class SDLActivity extends Activity {
    [javac]        ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivityold.java:848: error: duplicate class: org.libsdl.app.SDLMain
    [javac] class SDLMain implements Runnable {
    [javac] ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivityold.java:864: error: duplicate class: org.libsdl.app.SDLSurface
    [javac] class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
    [javac] ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java:42: error: package tv.ouya.console.api does not exist
    [javac] import tv.ouya.console.api.OuyaController;
    [javac]                           ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\GameControllers.java:3: error: package tv.ouya.console.api does not exist
    [javac] import tv.ouya.console.api.OuyaController;
    [javac]                           ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java:338: error: cannot find symbol
    [javac]       if(GamePad.isOuya) { OuyaController.init(getContext()); }
    [javac]                            ^
    [javac]   symbol:   variable OuyaController
    [javac]   location: class SDLActivity
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java:591: error: cannot find symbol
    [javac]       if (GamePad.isOuya)   { GamePad.setPlayerID(OuyaController.getPlayerNumByDeviceId(controllerID), name);   }
    [javac]                                                   ^
    [javac]   symbol:   variable OuyaController
    [javac]   location: class SDLActivity
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java:631: error: cannot find symbol
    [javac]       {   if (GamePad.isOuya)   { GamePad.setPlayerID(OuyaController.getPlayerNumByDeviceId(controllerID), name);   }
    [javac]                                                       ^
    [javac]   symbol:   variable OuyaController
    [javac]   location: class SDLActivity
    [javac] Note: C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 9 errors

BUILD FAILED
Q:\Compiler\platform\Android\android-sdk-windows\tools\ant\build.xml:713: The following error occurred while executing this line:
Q:\Compiler\platform\Android\android-sdk-windows\tools\ant\build.xml:727: Compile failed; see the compiler error output for details.

Total time: 2 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG
   [subant] No sub-builds to iterate on
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivityold.java:36: error: duplicate class: org.libsdl.app.CopyAssetsThread
    [javac] class CopyAssetsThread extends Thread
    [javac] ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivityold.java:150: error: class SDLActivity is public, should be declared in a file named SDLActivity.java
    [javac] public class SDLActivity extends Activity {
    [javac]        ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivityold.java:848: error: duplicate class: org.libsdl.app.SDLMain
    [javac] class SDLMain implements Runnable {
    [javac] ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivityold.java:864: error: duplicate class: org.libsdl.app.SDLSurface
    [javac] class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
    [javac] ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java:42: error: package tv.ouya.console.api does not exist
    [javac] import tv.ouya.console.api.OuyaController;
    [javac]                           ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\GameControllers.java:3: error: package tv.ouya.console.api does not exist
    [javac] import tv.ouya.console.api.OuyaController;
    [javac]                           ^
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java:338: error: cannot find symbol
    [javac]       if(GamePad.isOuya) { OuyaController.init(getContext()); }
    [javac]                            ^
    [javac]   symbol:   variable OuyaController
    [javac]   location: class SDLActivity
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java:591: error: cannot find symbol
    [javac]       if (GamePad.isOuya)   { GamePad.setPlayerID(OuyaController.getPlayerNumByDeviceId(controllerID), name);   }
    [javac]                                                   ^
    [javac]   symbol:   variable OuyaController
    [javac]   location: class SDLActivity
    [javac] C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java:631: error: cannot find symbol
    [javac]       {   if (GamePad.isOuya)   { GamePad.setPlayerID(OuyaController.getPlayerNumByDeviceId(controllerID), name);   }
    [javac]                                                       ^
    [javac]   symbol:   variable OuyaController
    [javac]   location: class SDLActivity
    [javac] Note: C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\src\com\glbasic\test\SDLActivity.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 9 errors

BUILD FAILED
Q:\Compiler\platform\Android\android-sdk-windows\tools\ant\build.xml:713: The following error occurred while executing this line:
Q:\Compiler\platform\Android\android-sdk-windows\tools\ant\build.xml:727: Compile failed; see the compiler error output for details.

Total time: 2 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 11.0 sec. Time: 22:02
Build: 1 succeeded.

Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-04
first at all, you need to remove ALL files from Compiler\platform\Android\templateproj as well game\distribute\Android (except eventuelly AndroidManifest.xml and assets folder). You have mixed old and new java files contains on those folders, which confuction the java files.

You can also never have same classes in two Java files, which will confuction the Java compiler, which just compile any java files its find (SDLActivity.java and SDLActivityold.java example). Instead do a zip as backup the source folder instead, so you only have the java files you need.

Then try to reunzip the templateproj folder again which ONLY the files its included with no old.java files included.

PS. Only Stage 1 errors is needed. Stage 2 errors is the same.
Title: Re: OUYA Compiling Help
Post by: Marmor on 2013-Aug-04
i ll try this !

thx and regards
Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-04
our sdk and ndk update seen fine. api-16 use some  deprecated API, but you should not worry about them at all. Those only happens in api-16, not api-14 and down.
Title: Re: OUYA Compiling Help
Post by: Marmor on 2013-Aug-04
unfortunately i got this


_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.9.921 SN:20d39e3d - 3D, NET
Wordcount:338 commands
compile+link:
running Android build-script...
BUILD STAGE 1: Compile and pack RELEASE
Q:\Compiler\platform\Android\bin\..\android-sdk-windows
Updated project.properties
Updated local.properties
Updated file C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\build.xml
Updated file C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\proguard-project.txt
Updated and renamed default.properties to project.properties
Updated local.properties
Added file C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\bin\build.xml
Added file C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android\bin\proguard-project.txt
   [subant] No sub-builds to iterate on

BUILD FAILED
Q:\Compiler\platform\Android\android-sdk-windows\tools\ant\build.xml:650: The following error occurred while executing this line:
Q:\Compiler\platform\Android\android-sdk-windows\tools\ant\build.xml:691: null returned: 1

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG
   [subant] No sub-builds to iterate on

BUILD FAILED
Q:\Compiler\platform\Android\android-sdk-windows\tools\ant\build.xml:650: The following error occurred while executing this line:
Q:\Compiler\platform\Android\android-sdk-windows\tools\ant\build.xml:691: null returned: 1

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\GLBANDROIDEXTRAS\AndroidExtras_1.2beta\AndroidSample\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 9.7 sec. Time: 22:35
Build: 1 succeeded.

Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-04
Looks like a issue in androidmanifest.xml. Delete that from distribute folder and try again, or output the file here. If still, then the folder. Ofte it's a error in that file.
Title: Re: So, OUYA. Will YA?
Post by: Marmor on 2013-Aug-04
Code (xml) Select
<?xml version="1.0" encoding="UTF-8"?>
-<manifest android:versionName="0.001" android:versionCode="1" android:installLocation="preferExternal" package="com.yourcompany.androidsample" xmlns:android="http://schemas.android.com/apk/res/android"> <uses-sdk android:targetSdkVersion="14" android:minSdkVersion="8"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.BATTERY_STATS"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- ANDROID EXTRAS: Comment this next permission if you do not need GPS functionality -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- ANDROID EXTRAS: Comment this next permission if you do not need iCade functionality (you should remove content in detectiCade() in SDLActivity too) -->
<uses-permission android:name="android.permission.BLUETOOTH"/> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:resizeable="false"/> -<application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:debuggable="false" android:icon="@drawable/icon" android:label="@string/app_name"> -<activity android:name="org.libsdl.app.SDLActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout" android:screenOrientation="portrait"> -<intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> <category android:name="tv.ouya.intent.category.GAME"/> </intent-filter> </activity> </application> </manifest>
Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-05
Please edit your post and use code formatting for. I'm not home yet, so looking on this error tomorrow. Manifest files do glbasic not overwrite in the distribute folder, so you might try delete the manifest file in one of the sub folder (not sure which one), and try that one from 1.0 in the main distribute/android folder in the example. For ouya it's require few changed to the file, but not for compile test.
Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-05
Ps. Admin, I'm thinks this ouya based compile help should have splitted to own thread to avoid clutter? (Marmor, nothing wrong, just easier to track this issue). Started top of page 10

[DONE] :) Ian
Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-05
Thanks Ian, hope it's ok, Marmor.

When I'm went home, I'm look if its a bug in manifest file. Im did not test with that manifest, but with my own. It's did past that one when getting java errors, so a previous manifest did do work.
Title: Re: OUYA Compiling Help
Post by: Marmor on 2013-Aug-05
No problem with moving to this thread.
Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-05
Itsa a really stupid error, which im fix soon.

All you should need is add a icon.png (that one from glbasic folder is fine), and put that folder AndroidSample.gbas is. Now its should now compile. Its was simply a icon file missing (so glbasic could not find it).

Other changes, you could o:
- Change resoulution to 9999x9998 in Project Options as well (to make sure its works with both 720p and 1080p).

- On android:screenOrientation="portrait" in manifest is should been eiter "sensor" or "landscape". Im gonna thinks 99.99% of users (if not all), not have thier tv rotated on portrait.

- Dont forget to use the getOrientation command, so you dont get a rotated picture. This is very important. If you dont, you property get a 90 degree rotated wrong.

PS. Im update the file soon.
Title: Re: OUYA Compiling Help
Post by: Marmor on 2013-Aug-05
i have a icon.png in the folder  :noggin: :giveup:
Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-06
Is was missing here, got a build error, when im tried and did fixed it. The manifest you have is also not 100% correct.

Can you test and compile whatever a another project, than the sample one? I'm want to known its a error in templateproj or in the sample project.

If its compile a succes there, the some file or error is in sample project. If fails, it's a error in templateproj folder.
Title: Re: OUYA Compiling Help
Post by: Marmor on 2013-Aug-06
Ok
Title: Re: OUYA Compiling Help
Post by: spacefractal on 2013-Aug-06
im are going to zip the whole android folder, which compiled success full here (only the Android folder of course in Compiler\platform\Android). That folder will include anything, include sdk, ndk and also now with AndroidExtras v1.4.

Im have tested witch stock project and worked ok. so hope fully that download works.

The download will been in the Bonus section.