Search Issue Tracker
Fixed in 2022.3.8f1
Fixed in 2022.3.X, 2023.1.X, 2023.2.X, 2023.2.0a6
Votes
0
Found in
2020.3.41f1
2021.3.15f1
2022.1.24f1
2022.2.0f1
2023.1.0a20
2023.2.0a1
Issue ID
UUM-20217
Regression
No
Android IL2CPP build fails when the project contains native plugins that use NDK APIs that are available in the project's minimum API level but not available in API 22
Steps to reproduce:
1. Open the attached user's project "AndroidNdkApiLevel26.zip"
2. Make sure that Android is selected as the platform
3. Make sure that IL2CPP scripting backend and minimum API level is 26 or higher are selected
4. Build the Android Player
5. Observe the error in the Console
Expected results: build doesn't fail
Actual results: android IL2CPP build fails when the project contains native plugins that use NDK APIs that are available in the project's minimum API level but not available in API 22
Reproducible on: 2020.3.41f1, 2021.3.15f1, 2021.3.27f1, 2022.1.24f1, 2022.2.a10
Not reproducible on: 2022.2.a11, 2022.2.0f1, 2022.3.4f1, 2023.1.0a23, 2023.1.3f1, 2023.2.0a19
Notes:
-There are additional IL2CPP linker flags set in ProjectSettings.asset, do not remove them. They are needed to link against the NDK libraries
-When building a Unity project for Android with IL2CPP as the scripting backend, the API level passed to the C compiler and linker is fixed at 22, even if the project's minimum API level is higher. This causes the build to fail when the project contains native plugins that use NDK APIs that are available in the project's minimum API level but not available in API 22
-Error that gets outputted:
Building Library\Bee\artifacts\Android\d8kzr\v1kj_tivePlugin.o failed with output:
D:\Cases\AndroidNdkApiLevel26\AndroidNdkApiLevel26\Library\Bee\artifacts\Android\il2cppOutput\cpp\NativePlugin.cpp(5,5): error: use of undeclared identifier 'AImageReader_newWithUsage'
AImageReader_newWithUsage(
^
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note (fix version 2023.2):
Fixed by upgrade of ndk tools from ndkr21b to ndkr23b
Resolution Note (fix version 2023.1):
Fixed by upgrade of ndk tools from ndkr21b to ndkr23b
Resolution Note (fix version 2022.3):
Fixed by upgrade of ndk from ndkr21b to ndkr23b.