Forums » C++ Framework » Issues when port cocos2d-x iphone game to android »
| Yang Huang | Issues when port cocos2d-x iphone game to android | ||||
|---|---|---|---|---|---|
|
Added by Yang Huang almost 2 years ago
Hi all, Can any body give me some ideas? Thank you! |
||||
| Minggo Zhang | RE: Issues when port cocos2d-x iphone game to android | ||||
|
Added by Minggo Zhang almost 2 years ago
I think you should test it on real phone. |
||||
| Yang Huang | RE: Issues when port cocos2d-x iphone game to android | ||||
|
Added by Yang Huang almost 2 years ago
Thank you Minggo. I have replace the mp3 file with smaller audio file, and there is no (E/AudioCache( 33): Heap size overflow! req size: 1052672, max size: 1048576). But the app still crash. Can anybody help? Thank you! |
||||
| Zhe Wang | RE: Issues when port cocos2d-x iphone game to android | ||||
|
Added by Zhe Wang almost 2 years ago
Hi, Yang, Can you paste a screenshot of the popup msgbox? I guess what you meet is CCFileUtils::getDataFormFile failure. It's normally caused by the invalid path of resource. Please check if the new audio file is packed into apk ball. Keep it simple and stupid. |
||||
| Minggo Zhang | RE: Issues when port cocos2d-x iphone game to android | ||||
|
Added by Minggo Zhang almost 2 years ago
In android, the audio file should be put in Resource/. |
||||
| Yang Huang | RE: Issues when port cocos2d-x iphone game to android | ||||
|
Added by Yang Huang almost 2 years ago
Thank you Minggo and Walzer! Thank you. |
||||
| wetcotton h | RE: Issues when port cocos2d-x iphone game to android | ||||
|
Added by wetcotton h about 1 year ago
I encounter the same problem when port cocos2d-x iphone game to android now , and my log is as follow:
This is tested in my real phone. My background music is 62s long. I use SDK .10 and NDK r6b. All my OGG audio files is 1.62MB, as I know, the OGG is the smallest format for audio, so I don't know how to minish my audio file. Can any body give me some ideas? Thank you! |
||||
| Arnie Schwarzvogel | RE: Issues when port cocos2d-x iphone game to android | ||||
|
Added by Arnie Schwarzvogel 5 months ago
Me too porting the iOS cocos2d game: I have one sound constantly played as background and want to play another not small mp3 (1 mb, 60 s) at the same time. First it says "sample not ready" and then "Heap Size overflow". I've found that it is not recommended to play big files as effects on android. Is there may be any solution now? Did someone tried for example extend SimpleAudiEngine to allow play another sample using MediaPlayer? |
||||
| Arnie Schwarzvogel | RE: Issues when port cocos2d-x iphone game to android | ||||
|
Added by Arnie Schwarzvogel 5 months ago
Hello again. As a possible solution I tried to extend Cocos2dxMusic.java with the second set of methods -like preloadBackgroundMusic() etc. I also extended the JNI interface of a SimpleSoundEngine. But on first invokation I get "not static method with name="preloadBackgroundMusic2" in class org/cocos2dx/lib/Cocos2dxHelper". What I am still missing? |
(1-8/8)