Hi cocos,
I had build cocos creator v2.3.3 success without sdkbox
but, so i add sdkbox then then build error
--------- beginning of crash
2020-05-08 11:51:49.193 12495-12530/org.cocos2d.demo A/libc: /Applications/CocosCreator/Creator/2.3.3/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/scripting/js-bindings/jswrapper/Value.cpp:539: se::Object *se::Value::toObject() const: assertion “isObject()” failed
please help me
thank
I facing the same problem a few days ago (Cocos Creator 2.3.3 & SdkBox Ads 2.6.0.1).
And I already solve it
You need replace function getPluginValue with code below on: {GameProject}\build\jsb-default or jsb-link\frameworks\runtime-src\Classes\SDKBoxJSHelper.cpp
se::Value getPluginValue(se::Object* obj, const std::string& name) {
std::vector<std::string> vect;
sdkbox::split(name, ".", vect);
se::Object* root[vect.size() + 1];
se::Value ret[vect.size() + 1];
int i = 0;
root[i] = obj;
for (auto n : vect) {
root[i]->getProperty(n.c_str(), &ret[i]);
root[i + 1] = ret[i].toObject();
i++;
}
return ret[i - 1];
}
1 Like