system.pathForFile returns nil after I rebuild my apk

Hi guys,

So I decompiled my apk and recompile, sign, zipalign it (properly i hope). Why? Cause I like to remove things that I don’t want and had to edit the manifest.xml manually for certain purpose.

There’s one slight problem with it, after I did it, there’s a part of my code that no longer works and after I tracked it down I found this error log :
 

08-21 04:25:13.566 I/Corona  (9907): loading XML :anim/hero/lib_hero.xml

08-21 04:25:13.793 W/System.err(9907):     at com.ansca.corona.FileServices.copyFile(FileServices.java:778)

08-21 04:25:13.793 W/System.err(9907):     at com.ansca.corona.FileServices.externalizeAssetFile(FileServices.java:592)

08-21 04:25:13.793 W/System.err(9907):     at com.ansca.corona.FileServices.externalizeAssetFile(FileServices.java:553)

08-21 04:25:13.793 W/System.err(9907):     at com.ansca.corona.NativeToJavaBridge.callExternalizeResource(NativeToJavaBridge.java:821)

08-21 04:25:13.801 W/System.err(9907):     at com.ansca.corona.JavaToNativeShim.nativeRender(Native Method)

08-21 04:25:13.801 W/System.err(9907):     at com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:138)

08-21 04:25:13.809 W/System.err(9907):     at com.ansca.corona.Controller.onDrawFrame(Controller.java:231)

08-21 04:25:13.809 W/System.err(9907):     at com.ansca.corona.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:400)

08-21 04:25:13.809 W/System.err(9907):     at com.ansca.corona.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1622)

08-21 04:25:13.816 W/System.err(9907):     at com.ansca.corona.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

08-21 04:25:13.816 I/Corona  (9907): Try to read common resource file

08-21 04:25:13.824 I/Corona  (9907): Runtime error

08-21 04:25:13.824 I/Corona  (9907): bad argument #1 to ‘open’ (string expected, got nil)

These errors occur upon calling system.pathForFile for this certain file : anim/hero/lib_hero.xml. The result of that call is nill.

If I run the apk straight out of Corona build then everything’s fine.

What did I do wrong? I don’t think it’s because any of my apk edits. I tried simple decompile-recompile also causing this error.

HALP !!!

Hi @yanuar,

If the .apk runs fine “as is” built from Corona, that is about the limit of support we can provide on this specific issue. Tinkering with the compiled .apk, below the hood post-build, is done at your own risk. I hope this sounds logical enough. :slight_smile:

Take care,

Brent Sorrentino

Wow, I know alot of developers edit their apks trying to add things that corona hasn’t supported at the moment.

You guys really need to work on your PR though…

 

 

Hi @yanuar,

What I meant was, you state “I don’t think it’s because any of my apk edits.” But then you decompile, makes changes, and recompile, which causes it to no longer work. So, logically, it’s something related to your apk edits, or perhaps how you’re recompiling it. I’m not trying to be condescending, I’m simply stating that this is a special instance that goes beyond typical forum-based support.

Best regards,

Brent Sorrentino

I’m not expecting much from forum members or staffs, I know mostly what I’m doing with editing the apk.
There’s a reason why I do that, rather than asking for Corona to add updates to include all my wishlist… hey maybe I can do you a favor by hacking myself a solution. 

I’m putting the dump just to see if there’s anyone  can spot what could be the problem. If they don’t then simply leave it as it be… I don’t mind. If you track my forum posts list, you’ll see I have a few posts left unanswered.

Logically, that’ll be a better move than saying what’s basically “Nope, you hack it… we don’t care”. Condescending or not it’s not up to me but there’ll be other developers reading this thread and it’s up to their judgement.
 

Hi @yanuar,

If the .apk runs fine “as is” built from Corona, that is about the limit of support we can provide on this specific issue. Tinkering with the compiled .apk, below the hood post-build, is done at your own risk. I hope this sounds logical enough. :slight_smile:

Take care,

Brent Sorrentino

Wow, I know alot of developers edit their apks trying to add things that corona hasn’t supported at the moment.

You guys really need to work on your PR though…

 

 

Hi @yanuar,

What I meant was, you state “I don’t think it’s because any of my apk edits.” But then you decompile, makes changes, and recompile, which causes it to no longer work. So, logically, it’s something related to your apk edits, or perhaps how you’re recompiling it. I’m not trying to be condescending, I’m simply stating that this is a special instance that goes beyond typical forum-based support.

Best regards,

Brent Sorrentino

I’m not expecting much from forum members or staffs, I know mostly what I’m doing with editing the apk.
There’s a reason why I do that, rather than asking for Corona to add updates to include all my wishlist… hey maybe I can do you a favor by hacking myself a solution. 

I’m putting the dump just to see if there’s anyone  can spot what could be the problem. If they don’t then simply leave it as it be… I don’t mind. If you track my forum posts list, you’ll see I have a few posts left unanswered.

Logically, that’ll be a better move than saying what’s basically “Nope, you hack it… we don’t care”. Condescending or not it’s not up to me but there’ll be other developers reading this thread and it’s up to their judgement.