Android Black Screen On App Launch

Cocos 3.15
Android Studio 2.3.3

Hello, so I have created a test project to aid me while I practice socket io. The problem is that my screen always comes up black with the fps in the bottom left corner.

I have no errors and the Android log monitor only says.

06-15 11:24:19.424 8095-8095/com.dorusindust.nettest I/art: Late-enabling -Xcheck:jni
06-15 11:24:19.464 8095-8095/com.dorusindust.nettest I/HyLog: I : openReadStream, /data/font/config/sfconfig.dat, case (2)
06-15 11:24:19.464 8095-8095/com.dorusindust.nettest D/HyLog: D: Wrong tag (927 : loadPreData() : frameworks/base/core/jni/android/graphics/TypefaceHyFontManager.cpp)
06-15 11:24:19.464 8095-8095/com.dorusindust.nettest I/HyLog: I : openReadStream, /data/font/config/sfconfig.dat, case (2)
06-15 11:24:19.676 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:19.835 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:19.906 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:19.968 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_2_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:20.034 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:20.100 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_4_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:20.164 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_5_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:20.228 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:20.316 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:20.379 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:20.450 8095-8095/com.dorusindust.nettest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/com.dorusindust.nettest-1/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.dorusindust.nettest-1@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
06-15 11:24:20.465 8095-8095/com.dorusindust.nettest I/InstantRun: starting instant run server: is main process
06-15 11:24:20.608 8095-8095/com.dorusindust.nettest D/PhoneWindowEx: Ex2. SystemProperties.get result >> #ff000000
06-15 11:24:20.655 8095-8095/com.dorusindust.nettest D/JniHelper: JniHelper::setJavaVM(0xf51fc000), pthread_self() = -145831116
06-15 11:24:20.655 8095-8095/com.dorusindust.nettest D/main: cocos_android_app_init
06-15 11:24:20.667 8095-8095/com.dorusindust.nettest D/Cocos2dxHelper: isSupportLowLatency:false
06-15 11:24:20.670 8095-8095/com.dorusindust.nettest I/AudioManagerEx: AudioManagerEx created
06-15 11:24:20.672 8095-8173/com.dorusindust.nettest V/AudioSystem: ioConfigChanged() new output opened 2 samplingRate 48000, format 0x5 channel mask 0x3 frameCount 960 deviceId 1
06-15 11:24:20.673 8095-8131/com.dorusindust.nettest V/AudioSystem: ioConfigChanged() new output opened 6 samplingRate 48000, format 0x5 channel mask 0x3 frameCount 1152 deviceId 5
06-15 11:24:20.673 8095-8131/com.dorusindust.nettest V/AudioSystem: ioConfigChanged() new output opened 4 samplingRate 48000, format 0x1 channel mask 0x3 frameCount 960 deviceId 2
06-15 11:24:20.673 8095-8095/com.dorusindust.nettest D/Cocos2dxHelper: sampleRate: 48000, framesPerBuffer: 240
06-15 11:24:20.674 8095-8095/com.dorusindust.nettest D/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp: nativeSetAudioDeviceInfo: sampleRate: 48000, bufferSizeInFrames: 240
06-15 11:24:20.684 8095-8106/com.dorusindust.nettest V/AudioSystem: ioConfigChanged() new input opened 2011 samplingRate 16000, format 0x1 channel mask 0x10 frameCount 320 deviceId 7
06-15 11:24:20.716 8095-8095/com.dorusindust.nettest V/SoundPool: SoundPool constructor: maxChannels=5, attr.usage=1, attr.flags=0x0, attr.tags=
06-15 11:24:20.718 8095-8325/com.dorusindust.nettest V/SoundPoolThread: beginThread
06-15 11:24:20.718 8095-8325/com.dorusindust.nettest V/SoundPoolThread: run
06-15 11:24:20.896 8095-8095/com.dorusindust.nettest D/Cocos2dxActivity: model=LG-H810
06-15 11:24:20.896 8095-8095/com.dorusindust.nettest D/Cocos2dxActivity: product=p1_att_us
06-15 11:24:20.896 8095-8095/com.dorusindust.nettest D/Cocos2dxActivity: isEmulator=false
06-15 11:24:20.959 8095-8095/com.dorusindust.nettest D/Cocos2dxActivity: onResume()
06-15 11:24:21.134 8095-8343/com.dorusindust.nettest I/Adreno: QUALCOMM build : f6ce942, I8a1ccf9ecb
Build Date : 11/12/15
OpenGL ES Shader Compiler Version: XE031.06.00.02
Local Branch : mybranch16299514
Remote Branch : quic/LA.BF64.1.2.2_rb4.7
Remote Branch : NONE
Reconstruct Branch : NOTHING
06-15 11:24:21.186 8095-8095/com.dorusindust.nettest D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true
06-15 11:24:21.187 8095-8095/com.dorusindust.nettest W/SplitWindow: update focus…
06-15 11:24:21.221 8095-8343/com.dorusindust.nettest D/cocos2d-x debug info: {
gl.supports_OES_packed_depth_stencil: true
gl.supports_vertex_array_object: true
gl.supports_BGRA8888: false
gl.supports_ATITC: true
gl.supports_S3TC: false
cocos2d.x.version: cocos2d-x-3.15
gl.supports_discard_framebuffer: true
cocos2d.x.compiled_with_profiler: false
gl.supports_PVRTC: false
cocos2d.x.build_type: DEBUG
gl.renderer: Adreno ™ 418
gl.supports_OES_depth24: true
gl.supports_ETC1: true
gl.supports_OES_map_buffer: false
cocos2d.x.compiled_with_gl_state_cache: true
gl.version: OpenGL ES 3.1 V@139.0 (GIT@I8a1ccf9ecb)
gl.supports_NPOT: true
gl.max_texture_units: 96
gl.vendor: Qualcomm
gl.max_texture_size: 16384
}
06-15 11:24:21.256 8095-8095/com.dorusindust.nettest V/ViewRootImpl: Contents drawing finished : com.dorusindust.nettest/org.cocos2dx.cpp.AppActivity
06-15 11:24:21.261 8095-8095/com.dorusindust.nettest I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@8943860 time:49025378
06-15 11:24:22.437 8095-8343/com.dorusindust.nettest D/cocos2d-x debug info: create rendererRecreatedListener for GLProgramState
06-15 11:24:22.515 8095-8343/com.dorusindust.nettest D/cocos2d-x debug info: create rendererRecreatedListener for GLProgramState
06-15 11:24:22.516 8095-8343/com.dorusindust.nettest D/cocos2d-x debug info: cocos2d: QuadCommand: resizing index size from [-1] to [2560]
06-15 11:24:22.518 8095-8343/com.dorusindust.nettest V/SoundPool: autoResume()
06-15 11:24:43.946 8095-8095/com.dorusindust.nettest I/ViewRootImpl: ViewRoot’s Touch Event : ACTION_DOWN
06-15 11:24:44.004 8095-8095/com.dorusindust.nettest I/ViewRootImpl: ViewRoot’s Touch Event : ACTION_UP
06-15 11:24:44.029 8095-8095/com.dorusindust.nettest I/ViewRootImpl: ViewRoot’s Touch Event : ACTION_DOWN
06-15 11:24:44.146 8095-8095/com.dorusindust.nettest I/ViewRootImpl: ViewRoot’s Touch Event : ACTION_UP
06-15 11:24:44.223 8095-8095/com.dorusindust.nettest I/ViewRootImpl: ViewRoot’s Touch Event : ACTION_DOWN
06-15 11:24:44.877 8095-8095/com.dorusindust.nettest I/ViewRootImpl: ViewRoot’s Touch Event : ACTION_UP
06-15 11:24:46.735 8095-8095/com.dorusindust.nettest D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=false
06-15 11:24:46.735 8095-8095/com.dorusindust.nettest W/SplitWindow: update focus…
06-15 11:24:46.777 8095-8095/com.dorusindust.nettest D/Cocos2dxActivity: onPause()
06-15 11:24:46.786 8095-8343/com.dorusindust.nettest V/SoundPool: autoPause(

and it ends after this the app does not crash nor give an error it just maintains the empty screen with the fps.

HelloWorld Scene.cpp

#include <network/SocketIO.h>
#include “HelloWorldScene.h”
#include “SimpleAudioEngine.h”

USING_NS_CC;
USING_NS_CC_EXT;
using namespace cocos2d::network;

Scene* HelloWorld::createScene()
{
// ‘scene’ is an autorelease object
auto scene = Scene::create();

// ‘layer’ is an autorelease object
auto layer = HelloWorld::create();

// add layer as a child to scene
scene->addChild(layer);

// return the scene
return scene;
}

// on “init” you need to initialize your instance
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Scene::init() )
{
return false;
}

auto visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();

/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
//    you may modify it.

cocos2d::Sprite* _mySprite = cocos2d::Sprite::create("HelloWorld.png");

_mySprite->setPosition(Vec2(1280, 720));


// add a "close" icon to exit the progress. it's an autorelease object
auto closeItem = MenuItemImage::create(
        "CloseNormal.png",
        "CloseSelected.png",
        CC_CALLBACK_1(HelloWorld::menuCloseCallback, this));

closeItem->setPosition(cocos2d::Vec2(visibleSize.width/2, visibleSize.height/2));

// create menu, it's an autorelease object
auto menu = Menu::create(closeItem, NULL);
menu->setPosition(Vec2::ZERO);
this->addChild(menu, 1);

/////////////////////////////
// 3. add your codes below...

// add a label shows "Hello World"
// create and initialize a label

auto label = Label::createWithTTF("Hello World", "fonts/Marker Felt.ttf", 24);

// position the label on the center of the screen
label->setPosition(cocos2d::Vec2(visibleSize.width/2, visibleSize.height/2));

// add the label as a child to this layer
this->addChild(label, 1);

// add "HelloWorld" splash screen"
auto sprite = Sprite::create("HelloWorld.png");

// position the sprite on the center of the screen
sprite->setPosition(cocos2d::Vec2(visibleSize.width/2, visibleSize.height/2));

// add the sprite as a child to this layer
this->addChild(sprite, 0);

return true;

}

void HelloWorld::connect(cocos2d::network::SIOClient *client, const std::string& data){

client = SocketIO::connect("ws://tools.itharbors.com:4200", *this);

}

void HelloWorld::testevent(SIOClient *client, const std::string& data) {

client= SocketIO::connect("ws://tools.itharbors.com:4200", *this);

client->setTag("Test Client");

client->on("testevent", CC_CALLBACK_2(HelloWorld::testevent, this));

client->on("connect", CC_CALLBACK_2(HelloWorld::connect, this));

//_sioClientStatus->setString(s.str().c_str());

}

void HelloWorld::menuCloseCallback(Ref* pSender) {
//Close the cocos2d-x game scene and quit the application
Director::getInstance()->end();

#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif

/*To navigate back to native iOS screen(if present) without quitting the application  ,do not use Director::getInstance()->end() and exit(0) as given above,instead trigger a custom event created in RootViewController.mm as below*/

//EventCustom customEndEvent("game_scene_close_event");
//_eventDispatcher->dispatchEvent(&customEndEvent);

}

Any Ideas/Recommendations would be helpful

1 Like

Just reported the similar problem.
Hope somebody could solve it.