@MobAmuse It worked immediately for me when I did a new version of the GiderosPlayer - but made the id the same as my app - 'com.sinistersoft.bacteria' (the id registered with Ouya for the app's key.der file).
I tried again with the regular player and the same problem as you - it locks for a long time at purchasing'. Randomly staying stuck forever or going to a next stage then getting failed.
Also with the same id as the one registered for the key.der file made the other stuff (receipts, etc) not crash out or return strange result codes. They didn't return actual data though.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Er I'm running the latest OUYAPlayer.apk from labs on my OUYA so how do I make it the same ID as my app i.e. 'com.mobileamusements.TropicalTreasures2Deluxe' ?
ouya:addEventListener(Event.USER_REQUEST_FAILED, function(e) print("USER_REQUEST_FAILED", e.error) end) ouya:requestReceipts() -- this should return the receipt for a purchase, returns blank for me!
ouya:requestProducts({"BacteriaUnlimitedPlay"}) -- here put the identifier for one of your IAPs, it should return the name and the price. returns blank for me!
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Export your app, give it the proper package name. Do all the plugin mods to make it work on the Ouya. Then you delete the assets folder from the eclipse project files.
A project with a deleted assets folder becomes a player.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Yep, it is. Luckily for me I'm doing this whilst helping teachers using my reports program, otherwise I'd just be sat twiddling my thumbs.
Anyhow, I made the app final - saw it had magically (almost) started working - so I then just deleted the assets folder to make a player and do more tests.
Having the correct package name Id for the correct key.der file is the key to getting rid of strange errors and the purchase delay I think.
The receipt/product list stuff must be a simple error in the plugin code and the black screen after purchase or cancel is anyones guess!
To get them back you just export the assets from the Gideros editor.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@SinisterSoft if I manually invoke event and pass data to it I receive event with all data, that is how I determined that plugin is working correctly.
Is it possible to debug app on Ouya so you could see LogCat output? If yes I can send you a debug version of GOuya.java with lots of Logs (one file which you can easily replace in your modified project), so you could launch it and paste the log cat here, we could determine where it goes wrong.
But about black screen I have only very crazy ideas what might be happening, still need to do some thinking/digging
Nope I'm stuck and can't seem to build a 'working' player for ouya with my app ID - it just bombs out. I've probably missed something but this is like pulling teeth now to be honest.
For now I've given up as got a lot on at the moment. I think I'll put my next Ouya release with IAP in it on the back burner for a bit meanwhile.
Since anyone who will want to use Ouya IAP in this state will have to create their own Ouya players, let me record a video on how to do that It actually takes less than 5 minutes
@ar2rsawseen I can plugin a usb and send run it on the Ouya (from eclipse) if that's what you mean? If so then send me the file. Do you need my email addr?
Making the player is easy (just delete the asset folder), adding the extra bits for the Ouya is the tricky bit and if you make a mistake it will bomb out.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
OK that video worked (I missed out a whole section of code before) and now the purchase went thru fine. I checked it at the OUYA control panel end and it was there date stamped all ok. I then deleted the purchase for further testing. The only problem now is I get a black screen on purchase of course.
@SinisterSoft well based on logs you provided it returns your purchase information in receipt (1 purchase) so it also finished purchase but just can't return back to game.
I have one crazy assumption (currently glsurface is added directly to the root view, usually android apps have some relative/framelayout etc added as wrapping view, maybe in this sort of mistake it somehow damages/removes gideros glsurface from view tree).
Here are the steps to add some layout before glsurface: I've attached main.xml to this post, copy it to your /res/layout folder inside exported project.
Inside your main activity: Comment out //setContentView(mGLView); And add this code instead: setContentView(R.layout.main); //get main layout final FrameLayout layout = (FrameLayout)findViewById(R.id.layout_main); // Add the Gideros view to main layout layout.addView(mGLView);
you will probably have to import com.youdomain.yourapp.R <-replace it with you app package with .R in the end
Clean project (Top menu -> Project-> Clean -> check your project -> Ok) and run as you would run it on Ouya in the way it works
@MobAmuse My purchase went through too on my game - checked in the control panel - but the purchase receipt system isn't working, does the receipt stuff work for you (see code I posted before)?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
No the receipt system appears not to be working. Actually does it even matter? can I not just purchase the app then store a flag that I bought it already so next boot of the app I check that flag and don't allow repurchase because already bought it earlier. Because I've not done IAP before, I'm trying to figure out in my brain what is the actual point of the receipt in that instance.
The products is the IAP identifier. You need at least one.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Got rid of the R cannot be resolved by moving 'import com.sinistersoft.bacteria.R;' to be the first import.
Still got FrameLayout cannot be resolved to a type.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
I got rid of the FrameLayout error by deleting the word 'final'. Will this be a problem?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@SinisterSoft hold on, maybe found the cause of the bug, will publish new Ouya update hopefully tonight, probably not completely related to layout (fingers crossed).
Sometimes the program will crash unless I comment out the receipts and products requests. Are you returning something that's not quite right - like a pointer to the data rather than the data (or similar?).
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Comments
I tried again with the regular player and the same problem as you - it locks for a long time at purchasing'. Randomly staying stuck forever or going to a next stage then getting failed.
Also with the same id as the one registered for the key.der file made the other stuff (receipts, etc) not crash out or return strange result codes. They didn't return actual data though.
https://deluxepixel.com
Likes: SinisterSoft
function print_r (t, indent, done)
done = done or {}
indent = indent or ''
local nextIndent -- Storage for next indentation value
for key, value in pairs (t) do
if type (value) == "table" and not done [value] then
nextIndent = nextIndent or
(indent .. string.rep(' ',string.len(tostring (key))+2))
-- Shortcut conditional allocation
done [value] = true
print (indent .. "[" .. tostring (key) .. "] => Table {");
print (nextIndent .. "{");
print_r (value, nextIndent .. string.rep(' ',2), done)
print (nextIndent .. "}");
else
print (indent .. "[" .. tostring (key) .. "] => " .. tostring (value).."")
end
end
end
ouya:addEventListener(Event.RECEIPT_REQUEST_SUCCESS, function(e)
print("RECEIPT_REQUEST_SUCCESS")
print_r(e.receipts)
end)
ouya:addEventListener(Event.PURCHASE_REQUEST_SUCCESS, function(e)
print("PURCHASE_REQUEST_SUCCESS", e.productId)
end)
ouya:addEventListener(Event.PRODUCT_REQUEST_FAILED, function(e)
print("PRODUCT_REQUEST_FAILED", e.error)
end)
ouya:addEventListener(Event.PURCHASE_REQUEST_FAILED, function(e)
print("PURCHASE_REQUEST_FAILED", e.error)
end)
ouya:addEventListener(Event.RECEIPT_REQUEST_FAILED, function(e)
print("RECEIPT_REQUEST_FAILED", e.error)
end)
ouya:addEventListener(Event.USER_REQUEST_FAILED, function(e)
print("USER_REQUEST_FAILED", e.error)
end)
ouya:requestReceipts() -- this should return the receipt for a purchase, returns blank for me!
ouya:addEventListener(Event.USER_REQUEST_SUCCESS, function(e)
print("USER_REQUEST_SUCCESS", e.userId)
end)
ouya:requestUserId() -- this should return the user_id of the current user - works for me!
ouya:addEventListener(Event.PRODUCT_REQUEST_SUCCESS, function(e)
print("PRODUCT_REQUEST_SUCCESS")
print_r(e.products)
end)
ouya:requestProducts({"BacteriaUnlimitedPlay"}) -- here put the identifier for one of your IAPs, it should return the name and the price. returns blank for me!
https://deluxepixel.com
Export your app, give it the proper package name. Do all the plugin mods to make it work on the Ouya. Then you delete the assets folder from the eclipse project files.
A project with a deleted assets folder becomes a player.
https://deluxepixel.com
Anyhow, I made the app final - saw it had magically (almost) started working - so I then just deleted the assets folder to make a player and do more tests.
Having the correct package name Id for the correct key.der file is the key to getting rid of strange errors and the purchase delay I think.
The receipt/product list stuff must be a simple error in the plugin code and the black screen after purchase or cancel is anyones guess!
To get them back you just export the assets from the Gideros editor.
Likes: ar2rsawseen
https://deluxepixel.com
Is it possible to debug app on Ouya so you could see LogCat output? If yes I can send you a debug version of GOuya.java with lots of Logs (one file which you can easily replace in your modified project), so you could launch it and paste the log cat here, we could determine where it goes wrong.
But about black screen I have only very crazy ideas what might be happening, still need to do some thinking/digging
For now I've given up as got a lot on at the moment. I think I'll put my next Ouya release with IAP in it on the back burner for a bit meanwhile.
Good luck!
It actually takes less than 5 minutes
Likes: MobAmuse
Making the player is easy (just delete the asset folder), adding the extra bits for the Ouya is the tricky bit and if you make a mistake it will bomb out.
https://deluxepixel.com
Video tutorial will be ready in a minute
How to create Gideros Ouya Player in 5 minutes
Likes: zoolax, SinisterSoft, MobAmuse, fxone, jdbc
https://deluxepixel.com
I have one crazy assumption (currently glsurface is added directly to the root view, usually android apps have some relative/framelayout etc added as wrapping view, maybe in this sort of mistake it somehow damages/removes gideros glsurface from view tree).
Here are the steps to add some layout before glsurface:
I've attached main.xml to this post, copy it to your /res/layout folder inside exported project.
Inside your main activity:
Comment out //setContentView(mGLView);
And add this code instead:
setContentView(R.layout.main);
//get main layout
final FrameLayout layout = (FrameLayout)findViewById(R.id.layout_main);
// Add the Gideros view to main layout
layout.addView(mGLView);
you will probably have to import com.youdomain.yourapp.R <-replace it with you app package with .R in the end
Clean project (Top menu -> Project-> Clean -> check your project -> Ok) and run as you would run it on Ouya in the way it works
The black screen will be a problem.
Likes: MobAmuse
https://deluxepixel.com
I'm done for today on this got to walk the dog who is very, very bored
Likes: SinisterSoft
And black screen when returning back to the game, thats all right?
requestReceipts does not appear to do/return anything.
Get black screen either doing cancel on purchase or after making a purchase.
Purchase working fine now tho otherwise.
I have not done the black screen mod myself at this point.
Cheers for now.
https://deluxepixel.com
https://deluxepixel.com
Still got FrameLayout cannot be resolved to a type.
https://deluxepixel.com
https://deluxepixel.com
but final should not be a problem
Likes: SinisterSoft
Likes: SinisterSoft, MobAmuse
https://deluxepixel.com