Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target_sdk_version seems to affect the NDK build version? #193

Closed
hrydgard opened this issue Nov 16, 2021 · 1 comment · Fixed by #197
Closed

target_sdk_version seems to affect the NDK build version? #193

hrydgard opened this issue Nov 16, 2021 · 1 comment · Fixed by #197

Comments

@hrydgard
Copy link
Contributor

Targetting a higher SDK version should only change the uses-sdk tag in the manifest, but setting it to say 31 to gain access to the latest features accessible from Java APIs, this happens:

Error: Path `"C:\\Android\\sdk\\ndk\\21.3.6528147\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\aarch64-linux-android31-clang.cmd"` 

To be more clear, the below causes the above, but should actually work, even with an older NDK:

[package.metadata.android.sdk]
min_sdk_version = 29
target_sdk_version = 31
max_sdk_version = 31
@MarijnS95
Copy link
Member

Yeah that's the correct assumption. Pretty much:

  • targetSdkVersion: Android uses this to understand what SDK level your app has been tested on (the "target"), and makes sure to apply certain compatibility when running on newer platforms;
  • compileSdkVersion: Defines what SDK to compile against, but this is not used in the NDK;
  • minSdkVersion: What the NDK uses to select a compiler, according to https://developer.android.com/ndk/guides/sdk-versions. Afaik this means no newer APIs can be used, not even conditionally (because of dynamic linking).

In other words, it's wrong for cargo-apk to use target_sdk_version to fill in that version in the compiler path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants