EnergYzer
EnergYzer

Reputation: 101

Apportable porting from Cocos2d project error

I'm now trying to port one of my Cocos2d 1.x project using Apportable, getting following error on compile stage:

     apk = env.BuildAPK(os.path.join(env['VARIANT_DIR'], env['APPLICATION_NAME'], config['APPLICATION_NAME'] + '.apk'), lib, assets + env['LIBRARY_ASSETS'])
  File "/Users/*user*/.apportable/SDK/lib/scons/engine/SCons/Environment.py", line 223, in __call__
    return self.method(*nargs, **kwargs)
  File "/Users/*user*/.apportable/SDK/site_scons/android/sdk.py", line 1123, in APKBuilder
    packaged = ResourcesFinalize(env, target=res_apk_path, source=source, assets=assets)
  File "/Users/*user*/.apportable/SDK/site_scons/android/sdk.py", line 922, in ResourcesFinalize
    all_assets = RemapAssetList(env, assets)
  File "/Users/*user*/.apportable/SDK/site_scons/android/sdk.py", line 847, in RemapAssetList
    (remap, target) = Remap(env, asset, target)
  File "/Users/*user*/.apportable/SDK/site_scons/android/sdk.py", line 723, in Remap
    (base, ext) = os.path.splitext(str(source))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0421' in position 58: ordinal not in range(128)

Is it SDK problem or my source code is there solution to fix it?

Upvotes: 1

Views: 739

Answers (1)

Paul Beusterien
Paul Beusterien

Reputation: 29582

As LearnCocos2D guessed, Apportable does not currently handle resource files with non-ASCII names.

If you want to leave the IOS project untouched, you can copy or link the resource file to an ASCII name and update configuration.json accordingly:

For example, on the remove_params section:

        "assets": [
              "Resources/Audio/@#$%\u2122!.wav",
               .....

And in the add_params section:

        "assets": [
               "apportable/Resources/sonOfA.wav",  // link to Resources/Audio/@#$%\u2122!.wav"

Also, we're now updating the Apportable platform to handle non-ASCII characters correctly, so if you're reading this more than a week or two in the future, the question will be moot.

Upvotes: 1

Related Questions