Skip to main content
Known Participant
July 16, 2011
Question

Create directory fails on Android

The code works on PC.  The directory is successfully created under My Documents.  But somehow it is not working on Android.

var workDirectory:File = File.documentsDirectory.resolvePath("testDir/tempDir");

if (!workDirectory.exists) {

     workDirectory.createDirectory();

}

I have already added this in the manifest:

<uses-permission android:name="android-permission.WRITE_EXTERNAL_STORAGE" />

The workDirectory.url is file:///mnt/sdcard/testDir/tempDir

The SD card is good.  I can create the directory manually on the Android tablet.

I am running AIR2.5 and Android 2.2.

Any help is appreciated.

Thanks in advance!

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

aimaobAuthor
Known Participant
July 16, 2011

I found out what the problem is.  It is a silly typo.

"android-permission" should be "android.permission"

Translate