Failed to integrate SDKBOX plugin with cocos creator 2.4

Hey Guys,

I am trying to build my project with the SDKBOX plugin in cocos creator 2.4, but it failed with some fatal error.

Error log,

#FATAL: [Errno 2] No such file or directory: '…/…/CocosCreator/BahamasQuestionsMaster/build/jsb-default/res/sdkbox_config.json’
** Installation failed :frowning: **

There is no such directory (“res”) created while building a project. I have tried to build a new blank project as well, but the same result.

Could anyone provide some help?
Thanks in advance!

you can create a empty json file ( path/to/BahamasQuestionsMaster/build/jsb-default/res/sdkbox_config.json) like follow

sdkbox_config.json

{}

and then import again.

@htlxyz Thanks for the response.

Yes, I have tries the way you describe, It build successfully with SDKBOX plugins and “sdkbox_config.json” is created inside “res” directory.
Now while running exported iOS build in simulator it shows me some errors again,

Error Log,
SDKBOX_CORE :Failed to find local config file in bundle and bundle/res.

So it could not find “sdkbox_config.json” file from “jsb-default/res” path.
Can you please help me with this?

Thanks again!

this is beacuse, SDKBox can’t find sdkbox_config.json file in res folder. please make sure sdkbox_config.json have been package into app.

we will fix this in next release.

now you can do like follow:

  1. create jsb-default/res folder
  2. modify jsb-default/frameworks/runtime-src/proj.android-studio/app/build.gradle
android.applicationVariants.all { variant ->
    ...
    variant.mergeAssets.doLast {

        copy {
            from "${sourceDir}/assets"
            into "${outputDir}/assets"
        }

        // new add
        copy {
            from "${sourceDir}/res"
            into "${outputDir}/res"
        }

        copy {
            from "${sourceDir}/src"
            into "${outputDir}/src"
        }

        ...
    }
}
  1. xcode project, BuildPhases -> Copy Bundle Resources
    drag res folder to Copy Bundle Resources
1 Like

I think it should be automatically packaged into the app while building a project, shouldn’t it?

In the older version of the creator, It creates a “res” directory and place “sdkbox_config.json” by itself. but in 2.4, I did create a “res” directory manually.

So is it the problem that it could not find the “sdkbox_config.json” file? If yes, where should I place to make it run successfully?

@htlxyz Thanks man, It worked!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.