Problem running MOAI app on Android - Black screen.

Discussion about using Moai SDK - post questions, issues, and ideas here.

Moderators: naturally, seebs, ezraanderson

Problem running MOAI app on Android - Black screen.

Postby Ascorbius » Tue Mar 26, 2013 6:44 am

I've seen one other thread for this, but it didn't cover my problem - and it was quite old.

I've successfully built the Android Host from source - following the excellent instructions at http://www.gamefromscratch.com/post/201 ... nment.aspx and after several hours, I managed to get my game to build in Eclipse and deploy an apk to my Samsung Galaxy Tab gt_p1000 running 2.2

My project is set to 2.2

When it runs, I just get a black screen. However the console and the LogCat aren't showing anything going wrong.
When I install the apk on a 2.3.3 phone, it also fails with a black screen.


This seems to me to be a typical Schoolboy Gotcha which every developer using Moai for Android must have encountered. Are there any simple things which could be causing this?

The game runs perfectly on Windows and MacOSX hosts.
There are no Build errors.
The Galaxy Tab is connected via USB cable for deployment.
The phone is only connected via USB for copying of APK and subsequent install and run - still black screen.

I am seeing an issue with setClearColor - attempt to call field 'setClearColor' (a nil value)

Is it possible that the MOAIGfxDevice is not initialized? if so, what would cause that?

I have ensured that my manifest contains
Code: Select all
  1. <uses-feature android:glEsVersion="0x00020000"></uses-feature>




Any guidance or hints would be appreciated.
User avatar
Ascorbius
 
Posts: 34
Joined: Mon Feb 11, 2013 2:52 pm

Re: Problem running MOAI app on Android - Black screen.

Postby tommo.zhou » Tue Mar 26, 2013 8:36 am

User avatar
tommo.zhou
 
Posts: 124
Joined: Thu Sep 29, 2011 12:28 am

Re: Problem running MOAI app on Android - Black screen.

Postby Ascorbius » Tue Mar 26, 2013 1:32 pm

Thanks tommo, replacing my calls to MOAIGfxDevice:setClearColor( 1,1,1,1 ) with MOAIGfxDevice.getFrameBuffer():setClearColor(1,1,1,1) fixed the black screen.
User avatar
Ascorbius
 
Posts: 34
Joined: Mon Feb 11, 2013 2:52 pm

Re: Problem running MOAI app on Android - Black screen.

Postby Ascorbius » Tue Mar 26, 2013 3:24 pm

..and to note for anyone else, that's all the problem was. Afterwards, the Android app deployed and ran without issue. Surprisingly well too.
User avatar
Ascorbius
 
Posts: 34
Joined: Mon Feb 11, 2013 2:52 pm

Re: Problem running MOAI app on Android - Black screen.

Postby BacioiuC » Mon Apr 01, 2013 10:43 pm

Any ideas what else could be causing this? I did as suggested and the app still displays the black screen.

Edit: Device is a Nexus 4, running Android 4.2.2.
User avatar
BacioiuC
 
Posts: 131
Joined: Thu Mar 28, 2013 7:12 am

Re: Problem running MOAI app on Android - Black screen.

Postby elsin8 » Mon Nov 06, 2017 11:47 pm

Once downloaded, open the archive and extract the folder inside to somewhere on your drive. In my case the folder was called android-ndk-r8b and I extracted it to c:\. After it is extracted, rename it to android-ndk. There are 17,000+ files in that archive, so expect it to take a while to extract.



Later in the process, Moai will need to know the location of the NDK, specifically ndk-build. The easiest way to make this file discoverable is to add it to your path environment variable, this can be configured via the command line. Get the latest version of app vshare app. Get it from this guide to install this app.
elsin8
 
Posts: 1
Joined: Mon Nov 06, 2017 11:44 pm


Return to Moai SDK

Who is online

Users browsing this forum: Exabot [Bot] and 0 guests

cron

x