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.
- Crash on EditorOnlyPlayerSettings::GetDefaultTextureCompressionFormat when switching or opening a specific project with Android or IOS Platform
- [Mobile] Player silently crashes on a mobile device when using a lot of "Camera" GameObjects (40 and more) in the Scene
- Scene is modified after exiting Play Mode when Graphics Compositor is enabled in HD RP
- Shortcuts inconsistently trigger when they have a conflict with the same Command
- On Script import/reimport MonoImporter does not generate consistent results due to updating Custom packages