You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a library which I'd like to make available on every possible platform: arm, arm64, x86, x86_64. However, during development I usually care about a single one. But gradle compiles everything, which takes some extra time.
One option is to manually disable the archs which I don't care about. I can do that by commenting out the undesired archs. Like so:
But that's inconvenient because (1) the gradle file is checked into the version control system and (2) I need to remember to change this if I change de development device (e.g. I transition from a physical device to an emulator).
I'm wondering if there's a recommended way during development to tell gradle to only compile the right arch for the device we are targeting when we launch the app using the "run" button. I think Android Studio handles this gracefully for regular JNI/C++ code using CMake in Android Studio.
The text was updated successfully, but these errors were encountered:
We've not built anything out of the box. Set up your Gradle dependencies differently to have the per-arch build jobs depend on the per-arch cargo tasks like cargoBuild${ARCH}. See #68 and similar tickets.
I'll keep this open to track doing better automatically, 'cuz it is possible -- just not easy right now.
ncalexan
changed the title
Newbie question: How to make Android Studio only compile the right arch automatically
Configure Gradle task dependencies to be architecture-specific
Aug 11, 2022
I'm building a library which I'd like to make available on every possible platform: arm, arm64, x86, x86_64. However, during development I usually care about a single one. But gradle compiles everything, which takes some extra time.
One option is to manually disable the archs which I don't care about. I can do that by commenting out the undesired archs. Like so:
But that's inconvenient because (1) the gradle file is checked into the version control system and (2) I need to remember to change this if I change de development device (e.g. I transition from a physical device to an emulator).
I'm wondering if there's a recommended way during development to tell gradle to only compile the right arch for the device we are targeting when we launch the app using the "run" button. I think Android Studio handles this gracefully for regular JNI/C++ code using CMake in Android Studio.
The text was updated successfully, but these errors were encountered: