Highlighted

Error 3003 - file doesn't exist on Android (but it does!)

Participant ,
Mar 17, 2014

Copy link to clipboard

Copied

Hi there,

I'm doing something really simple - so there must be silly mistake somewhere here. I'm building my game with:

adt -package -target apk-debug -connect  -storetype pkcs12 -keystore "cert\mygame.p12" -storepass fd "dist\mygame-debug.apk" "application.xml" -C bin . -C "icons/android" .

With the swfs and required data files in the bin/ folder. That -C directive makes them work as root.

Then all I'm doing is:

var file:File = File.applicationDirectory.resolvePath("data.json");

var fin:FileStream = new FileStream();

fin.open(file, FileMode.READ);     // error 3003 triggered!!

The path is resolved to "app:/data.json" which is correct, since it lives in the apk in the same place the swf is.

So why am I getting error 3003? Any insight is greatly appreciated!

I'm building with Air 3.7.

Thanks!

TOPICS
Development

Views

470

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Error 3003 - file doesn't exist on Android (but it does!)

Participant ,
Mar 17, 2014

Copy link to clipboard

Copied

Hi there,

I'm doing something really simple - so there must be silly mistake somewhere here. I'm building my game with:

adt -package -target apk-debug -connect  -storetype pkcs12 -keystore "cert\mygame.p12" -storepass fd "dist\mygame-debug.apk" "application.xml" -C bin . -C "icons/android" .

With the swfs and required data files in the bin/ folder. That -C directive makes them work as root.

Then all I'm doing is:

var file:File = File.applicationDirectory.resolvePath("data.json");

var fin:FileStream = new FileStream();

fin.open(file, FileMode.READ);     // error 3003 triggered!!

The path is resolved to "app:/data.json" which is correct, since it lives in the apk in the same place the swf is.

So why am I getting error 3003? Any insight is greatly appreciated!

I'm building with Air 3.7.

Thanks!

TOPICS
Development

Views

471

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 17, 2014 0
Engaged ,
Mar 18, 2014

Copy link to clipboard

Copied

AIR 3.7 rings a bell - there was a path problem that was introduced between 3.6 and 3.7, but from memory it only related to SharedObjects.

Curious: What do you get if you insert

trace( 'File exists: '+file.exists );

After the first line?

My guess is that data.json does not exist at that location.  In this case a valid File object is still returned from resolvePath, but the file it references does not exist. 

I'm guessing it's in the bin directory and you are adding it via -C bin?  I'm not certain, but see if the file actually exists at app:/bin/data.json

var file:File = File.applicationDirectory.resolvePath("bin/data.json");

If that doesn't work, try using the -extdir command to include data.json in your package instead of -C?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 18, 2014 0