I thought I had found a nice simple solution to the ouya ndk problem. Though I can make it work on any of the android platform jar's I can not make it work with the ouya jar. I do not know why.
If anyone can work it out I would appreciate the help.
If an ouya dev could make some comments about what migh be different about the jar that would be good.
Edit: tried some other jar's(not entended for android) and they work fine.
So I opened are the jar deleted all classes. Pasted back just the OuyaController class. When I tried to import that jar in it worked. So I tried it randomly tried to add some classes back in.
I have not done any-more investigation. It may be that the ones that do not work have very complicated method signatures. As the current ones that work are really simple just returning or passing integers
It is amazing that it can work with any android platform jar which is all of the android sdk yet not this the ouya classes.
I had the same problems with the java2cpp tool as you describe... however within a totally different context.
I finally discovered how to use it the way it is expected to be used. (by building the java2cpp.exe program from the sources, I eventually could trace into the problem via the debugger... and although my build is not yet fully functional I could get enough information to circumvent the issue)
The hidden secret is that you should include all related types within the (eventual/aggregated) JAR of which you want to generate the C++ code by means of the java2cpp tool.
So here is the procedure that eventually works.
Make somewhere on your Windows machine an empty directory; let's call it OUYA-ODK-aggregation.
Then, into this directory, put the following JARs (please note I use android-17 platform JARs) (origin of the below JARs is the ANDROID SDK and the OUYA SDK):
+ android.jar
+ commons-lang-2.6.jar
+ guava-r09.jar
+ jackson-core-asl-1.8.4.jar
+ jackson-mapper-asl-1.8.4.jar
+ ouya-sdk.jar
+ uiautomator.jar
(it could be that there is more in the above than strictly needed... don't care)
The next step is to make an aggregated JAR of the above. To do so, you need the java jar.exe tool which is part of a standard java installation.
Below are the instructions (i.e. copy/paste of my cmd.exe terminal window):
The final "jar xf ../aggregated.jar" step is there to verify all is ok.
Now, start the java2cpp.exe program, select the aggregated.jar, and generate the C++ code... and enjoy. My generated C++ output folder eventually has 249 folders, 3.256 files, 38.8 MB.
Hopes this works at your site as it works here on my site.
Before doing the "jar cf aggregated.jar android assets com dalvik java javax junit META-INF org res tv" aggregation step in the above, make sure to remove all *.class files out of the OUYA-ODK-aggregation directorytree that end in *$1.class, *$2.class etc... *$15.class...
Those are useless to java2cpp, and in fact cause generation of C++ code that won't compile.
Mygenerated C++ output folder eventually has 249 folders, 3.256 files, 37.5 MB.
Comments
When I tried to import that jar in it worked.
So I tried it randomly tried to add some classes back in.
So far these ones make it crash
These ones work
OuyaEncreptionHelper
OuyaErrorCodes
OuyaInent
I have not done any-more investigation.
It may be that the ones that do not work have very complicated method signatures.
As the current ones that work are really simple just returning or passing integers
It is amazing that it can work with any android platform jar which is all of the android sdk yet not this the ouya classes.