Android Studio emulator problem

Android Studio emulator problem
0

#16

Yes, in gradle.propierties I’ve this: PROP_APP_ABI=armeabi:x86
Android Studio 3.0.1
Cocos2d-x-3.16


#17

I think you should change gradle.properties to PROP_APP_ABI=armeabi x86. Don’t need : between armeabi and x86.


#18

Nop, it’s ok the syntax. Maybe you confunse it with the Application.mk configuration. In that file I can put:
APP_ABI := armeabi x86

But that’s not the problem.


#19

Try GLES 3 in emulator (advanced)settings?


#20

This?
Captura

I tested both GLES but nothing…


#21

Our entire 4th year class are having emulator issues. Our lecturer is still having issues after months. I use a real phone, doesn’t have any issues. Best advice is save yourself the suffering and just use a android phone attached to i presume your android studio. Works with no issues for me and everyone in class always


#22

I can’t see GLES 3 option there. Try to update emulator using sdk manager then check it again.


#23


This config works for me.


#24

@hgokturk are you using Android Studio 3.0.1 ?
Where’s located “Extended controls” window? Please tell me step by step.
Remember, I’m using high Sierra, not windows.


#25

Yes it’s Android Studio 3. Settings of emulator.


#26

I just want to report that I’m seeing the same issue when running cpptests under the emulator.

Initially just black screen with the 0x501 errors. After I added mediump to COCOS2D_SHADER_UNIFORMS in CCGLProgram.cpp following domp’s advice, the tests actually run, however the same errors are still printed to the Gradle Console.

High Sierra 10.13.3
Android Studio 3.0.1
cocos2d-x-3.16

x86 target


#27

Android emulator is very problematic lately.


#28

I still didn’t resolve the problem. If anyone find a solution, post here :wink:


#29

Our lecturer recently fixed it for our class. He was trying for months. I can share what he told us do, assuming you have all other things working.
He added couple lines in this file where ever it is in the cocos library and it sorts issues

Something got do wth opengl or android emulator rendering thing or something GLES I think

CCGLProgram.cpp (35.5 KB)

I think this is the file that he added a couple lines code in somewhere and then emulator worked . no idea where it goes. i can ask him if anyone wants me to in email. Let me know


#30

The file works for me. It is located in cocos2d/cocos/renderer folder. There are differences around line 486.

The original file:

#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
    headersDef = (type == GL_VERTEX_SHADER ? "precision mediump float;\n precision mediump int;\n" : "precision mediump float;\n precision mediump int;\n");
#elif (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC)
    headersDef = (type == GL_VERTEX_SHADER ? "precision highp float;\n precision highp int;\n" : "precision mediump float;\n precision mediump int;\n");
#endif

And the new file:

#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
        headersDef = (type == GL_VERTEX_SHADER ? "precision mediump float;\n precision mediump int;\n" : "precision mediump float;\n precision mediump int;\n");
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
        headersDef = "#version 100\n precision mediump float;\n precision mediump int;\n";
#elif (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC)
        headersDef = (type == GL_VERTEX_SHADER ? "precision highp float;\n precision highp int;\n" : "precision mediump float;\n precision mediump int;\n");
#endif

@slackmoehrle, I think you should consider integrating this change in the project. Now my game runs just fine in the Android Studio emulator with default settings. It is really helpful for me since I can now test a multiplayer session between my phone and the emulator. I do not need my wife’s phone anymore :smile:


#31

The file works for me too, but sometimes I continue with problems. Example when I replace scenes or try to open google play game services. Really it’s the final solution? maybe it should be evaluated by cocos team.


#32

I am replacing scenes and using Google Play Games Services in my game too, and everything is working in the emulator. Is your game working well on devices?


#33

Yep, in the device works. Anyway, i will try with another emulator.


#34

Is there any updated version of CCGLProgram.cpp for cocos 2.2.6?


#35

Thanks for @yinjimmy for updating Cocos2dx 2.2.6 CCGLProgram.cpp code here