Replies: 4 comments
-
Maybe you can try copy the resources to somewhere else first to confirm the exclude is not working? |
Beta Was this translation helpful? Give feedback.
-
@qoozta Thanks for the suggestion, because simply testing a separate asset folder indicated that it was in fact doing the asset copy somewhere else, and actually doing it twice as a result of that copy task. I tracked it down to here in
The task that is set below in that same file was copying them a second time, which now makes no sense at all:
Also, that task has redundant code, such as the: That doesn't do anything, since that directory is never used for assets, so it's deleting a directory that doesn't exist. Now, if we comment out the For my specific case, commenting it out Regarding your suggestion to using the assetPack option, I'll look into it, since it seems beneficial, as long as it doesn't require any significant custom code to support it versus other platforms (such as iOS etc). |
Beta Was this translation helpful? Give feedback.
-
Maybe your project gradle file is from Cocos2d-x 3.0 (NDK build) and not fully migrated to CMake build, axmol cpp-tests use the same copy task, however it will point the asset.srcDir to "assets", so it should work. |
Beta Was this translation helpful? Give feedback.
-
It's definitely completely integrated with cmake, and has been since cocos2d-x 3.17, with no trace of NDK build in the gradle files. It seems that there is a big difference between the cpp-tests 'gradle.build' and the cpp template 'gradle.build' files, particularly in the sections related to sourceSet and the copy task: https://github.com/axmolengine/axmol/blob/dev/tests/cpp-tests/proj.android/app/build.gradle In cpp-tests, |
Beta Was this translation helpful? Give feedback.
-
Let's say the game resource folder contains the following files:
file1.png
file2.mp3
file3.pem
On build, "file3.pem" should not be copied to the output folder, just prior to the APK being created.
The documentation I've seen online indicates that I have to do add
exclude
lines in this section:In
proj.andoid/app/build.gralde
The problem is that the ".pem" files are still copies across to the output folder, and are embedded in the APK. Is there something I'm missing in the script? The ".gz" files aren't actually excluded either, because the build process automatically extracts the contents into the output, which is why the ".gz" files do not appear in the output folder.
Now, if I comment out that copy task, the resources are still somehow copied during the build process, and I can't seem to track down where this is happening. Does anyone have any idea on where this occurs in the build scripts?
The only other way I've managed to get it to exclude files is with the following:
I would prefer not to use the
aaptOptions
method since there doesn't seem to be a way to restrict it to release builds, so it activates in debug builds too.Beta Was this translation helpful? Give feedback.
All reactions