Cocos2d JS 3.17 Android Black Screen

Cocos2d JS 3.17 Android Black Screen
0

#1

Hello Everyone!
I create new project JS, then i build and run project Android by Android Studio, but my devices display black screen.

cocos2d: 3.17
Android Studio: 3.2.1
PROP_COMPILE_SDK_VERSION=27
PROP_MIN_SDK_VERSION=14
PROP_TARGET_SDK_VERSION=27
PROP_BUILD_TOOLS_VERSION=28.0.3

Some log:
Choreographer: Skipped 11 frames! The application may be doing too much work on its main thread.
WindowManager: Failed looking up window
cocos2d-x debug info: cocos2d: fullPathForFilename: No file found at script/jsb_prepare.js. Possible missing file.
cocos2d-x debug info: cocos2d: fullPathForFilename: No file found at script/jsb_prepare.jsc. Possible missing file.
cocos2d-x debug info: cocos2d: fullPathForFilename: No file found at script/jsb_prepare.js. Possible missing file.
ScriptingCore.cpp: ScriptingCore:: compileScript fail:script/jsb_prepare.js
cocos2d-x debug info: JS: (string):1:TypeError: cc.Class is undefined

Thanks!


#2

Hi

Did you make any changes in the project?
Please try on cocos 3.17.1


#3

Hi all!
I have same problem with cocos2d JS 3.17.1
android studio 3.2.1
anyone has suggestion?
Thanks!


#4

Use classpath ; ‘com.android.tools.build:gradle:3.1.4’ . in gradle setting dependency
and
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip . in gradle-wrapper-properties

when you use above property your “buildToolsVersion” will be set to ‘27.0.3’

This fixed issue for me

3.2.1 version has some issues


#5

Run your project in browser and inspect the project if any error in the web build it gives blank screen in ios and android.


#6

Thanks Yathiraj_karkera!
I got it!
But when i import sdkbox to my project and build:

Bug Log:
AGPBI: {“kind”:“error”,“text”:“Program type already present: com.sdkbox.plugin.SDKBoxIABBillingClient$3”,“sources”:[{}],“tool”:“D8”}
:MyGame:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
:MyGame:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:MyGame:transformDexArchiveWithExternalLibsDexMergerForDebug’.

Can You help me find bug?
Thank you very much!


#7

I fixed it with modify sth in build.gradle like this picture


Another copy {} lines, you can fix similarly.
Reason: in gradle 4.6 – merge Assets folder change to merged_assets folder


X86 support build