Hi everyone.
I got some error when Load Remote Bundle on iOS platform. This is my code
const uri = "https://<mywebsite.com>/<platform>/<bundle_name>";
assetManager.loadBundle(uri, null, (err: Error, bundle : AssetManager.Bundle) =>{
console.log("error load bundle",err);
bundle.loadScene("MySceneName", (err, scene)=>{
console.log("error load scene", err);
director.runScene(scene);
});
});
the code was running well in Android Device. but when I tried to run on iOS I got this error message
11:34:09 [DEBUG]: JS: error load bundle null
2023-08-22 11:34:09.454058+0700 SampleLoadBundle-mobile[2496:397100] open on /var/mobile/Containers/Data/Application/869CFED8-9554-495C-AE96-C0E0E57D0245/Documents/gamecaches/<mybundle_name>/16926787931462.json: No such file or directory
11:34:09 [ERROR]: JS: Download file failed: path: https://<mywebsite.com>/<platform>/<bundle_name>/import/02/02c9ae476.json message: The file “CFNetworkDownload_8oU62u.tmp” doesn’t exist., -2
I don’t know what happen. can you help me to solve this problem. may be there are some configuration or permission setting on Xcode project that I need to edit so I can load remote bundle successfully on iPhone Device.
I think the problem is about downloading process restriction in iOS platform when load remote bundle but I don’t know how to solve this problem because I don’t have experience in iOS Development (for your information, my remote bundle size is about 900kb)
this is the file structure of my bundle (build using cocos creator 3.8) :
bundle_name :
import/somefile
native/somefile
index.js
cc.config.json
I run the project using :
- Cocos Creator 3.8 (build ios platform) remote bundle and the project itself built by cocos creator 3.8 (built using same version)
- XCode 14.3.1
- Run on iPhone 12 Real Device (iOS 16.6) failed to load remote bundle
- Run on iPhone 14 Pro emulator (still failed to load remote bundle)
- Set Minimum Deployment Setting on XCode to ios 12.0 (same error)
- Set Minimum Deployment Setting on XCode to ios 16.0 (same error)