Search Issue Tracker
Fixed in 2022.2.X
[Android] Hidden files in StreamingAssets folder are not included in builds for Android, but included for other platforms
1. Open the attached project "StreamingAssetsBug"
2. Build the project for Android
3. Change the extension of the created file from .apk to .zip
4. Unzip and open the unzipped folder
5. Open the "assets" folder
6. Make sure you are able to see hidden files
Expected result: Both hidden and not hidden files are in the assets folder
Actual result: Only not hidden files are in the assets folder
Reproducible with: 2019.4.33f1, 2020.3.24f1, 2021.1.28f1, 2021.2.5f1, 2022.1.0a16
To fix this issue, you can customize your gradle build.
( Please refer to "Customizing your Gradle build" section in this link https://docs.unity3d.com/2021.1/Documentation/Manual/android-gradle-overview.html)
1. Go to "Publishing Settings" section of "Player Settings" (menu: File> Build Settings > Player Settings)
2. Check "Custom Main Gradle Template" and check "Custom Launcher Gradle Template." (The picture in the link is outdated.)
3. Now you can see the path of your gradle build files like below.
4. Find "mainTemplate.gradle" in the path and open the file.
5. Change "aaptOptions.ignoreAssetsPattern" like below. (Find ":.*" in the middle of the pattern list and remove it)
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
6. Find "launcherTemplate.gradle" in the path and open the file and change aaptOptions.ignoreAssetsPattern like in the step 5.
Recap: Change aaptOptions.ignoreAssetsPattern in the custimized gradle files
One more thing, to understand patterns syntax, you can look at the bottom of this page(https://stackoverflow.com/questions/28934333/how-can-i-use-android-aaptoptions)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- High polling rate mice are causing performance issues
- [WebGL] Bad performance when playing in Safari
- Resolution is reset when the Player is restarted
- [Android] Object movement stutters on Android even with constant Time.deltaTime
- Assertions and errors appear while undoing prefab asset replacement