Problem on merge assets folder inside an android library project

Unity 5.2.2f1, Win7 64bits.

As the document said, unity will merge the android library projects in “Assets/Plugins/Android/”.

I make a simple unity project contains a simple android library project.
The structure is like this:

Assets

  • AndroidCallback.cs
  • Scene.unity
  • Plugins
    ±---- Android
    ±-------- androidplugintest
    ±------------ AndroidManifest.xml
    ±------------ project.properties
    ±------------ assets
    ±---------------- folder
    ±-------------------- a.txt
    ±------------ bin
    ±---------------- androidtestplugin.jar

The scene contains a “Text” and a “Button”.
When tap the button, it will call a java function (com.example.AndroidCallback.Utility.Test, implements in androidtestplugin.jar).
The function will use “AssetManager” to open the file “a.txt” with the path “folder/a.txt”, and then send the file contents to the text control in the scene.

But if you build and run the project, you will receive a FileNotFound exception.

Use rootexplorer (a file manager for android) to view the exported apk file, I found that text file is named as “folder\a.txt” (not a folder and a file) inside assets folder. (see the second attachment)
I think it is why the AssetManager fails.

Does I make some mistake or it is just a bug?
(The first attachment contains all projects)

2354558–159543–New Unity Project.zip (73.9 KB)

According to the official Android documentation: Projects overview  |  Android Studio  |  Android Developers

Library modules cannot include raw assets

The tools do not support the use of raw asset files (saved in the assets/ directory) in a library module. Any asset resources used by an application must be stored in the assets/ directory of the application module itself. However, resource files saved in the res/ directory are supported.

I think that means that you cannot include anything in your library under assets/ since that is not supported.

BTW: apparently this is true only for Ant builds (which Unity uses IIRC), for the newer Gradle based build system, that should be supported…

Thanks, I will put it outside the library folder.