java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably comp

1,009 views
Skip to first unread message

Radek Bartoň

unread,
Mar 18, 2013, 4:13:06 PM3/18/13
to pl...@googlegroups.com
Hello.

When game assets are in separate maven module as was introduced in 1.6, sounds cannot be loaded on Android platform with following exception:

java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed

but if I create symlink to android/assets/<dpi-prefix>/sounds/ (and remove dependency on assets module) they are loaded fine. Other resources like images are also loaded fine even with assets module dependency.

Sounds are in assets/src/main/resources/assets/<dpi-prefix>/sounds/ and I double-checked that they are contained in final APK correctly. This is assets module pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project
  xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.example.project</groupId>
    <artifactId>project</artifactId>
    <version>1.0</version>
  </parent>

  <artifactId>project-assets</artifactId>
  <name>ProjectGame Assets</name>
</project>


Michael Bayne

unread,
Mar 18, 2013, 4:17:58 PM3/18/13
to pl...@googlegroups.com

On Mon, Mar 18, 2013 at 1:13 PM, Radek Bartoň <blac...@gmail.com> wrote:
but if I create symlink to android/assets/<dpi-prefix>/sounds/ (and remove dependency on assets module) they are loaded fine. Other resources like images are also loaded fine even with assets module dependency.

You have to remove the assets module dependency and add the symlink. I'm pretty sure the instructions in the migration guide were explicit about that.

If you put them in the core/src/main/resources/assets directory they will be copied into the jar file, but the Android tools that create the APK will not correctly recognize them as assets and it will compress them, which will prevent them from working.


Radek Bartoň

unread,
Mar 18, 2013, 4:20:48 PM3/18/13
to pl...@googlegroups.com
Ok, I tought that symlink was pre-1.6 way and now it should be module dependecy. My fault, sorry.

2013/3/18 Michael Bayne <m...@samskivert.com>

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "PlayN" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/playn/jM2ox_5PtV0/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to playn+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages