-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Android build: Execution failed for task ':app:mergeExtDexDebug'. #21494
Comments
I was able to build successfully on WSL with NDK 27 and the latest code from I did see some StackOverflow answers to similar questions where the problem was resolved by reinstalling Android Studio so maybe there's a system config issue affecting your builds. |
Thanks @skottmckay. I'll try installing the latest version of Android Studio. Would it be possible to share the full |
Also, I should have mentioned I'm using macOS Sonoma 14.1.2 (23B92) and Android Studio Iguana | 2023.2.1 Patch 2. |
I updated Android Studio to Koala (2024.1.1 Patch 1), and ran the following command:
And now I'm getting a different error:
I'm not sure if this is related -- if not, can start a new issue. |
I cut-and-pasted your command and adjusted the path to my Android SDK. What NDK are you using? I noted the one in your command was the RC and the actual release is out. Not sure that's relevant though. I've never seen an error about reallocarray and afaik the JNI code hasn't changed lately. There seems to be a mismatch between what was found during configuration and what's available at runtime. cmake found a reallocarray function but the compiler didn't /Users/kapsyproductivity/projects/onnxruntime/java/src/main/native/OrtJniUtil.h:110:10: error: call to undeclared function 'reallocarray'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] Based on the android source it should come from malloc.h for libc which seems like it should be consistently available given how basic it is. |
@skottmckay Sorry for the late reply. I just realized that in your initial messsage you said NDK 27 and not SDK 27. My bad.
The reallocarray error disappears but unfortunately the original The entire build output is here: ort_java_build_error_7_30_1359.log |
Just looking into this issue more, I'm wondering if this warning is a factor?
Current version:
|
@skottmckay Sorry for directly mentioning you, but we were wondering if you had any further advice on this issue? We're quite stuck here, having tried the following suggested answers:
We're able to build the .so file and run that, but we require the AAR for production. We want to build from source, instead of using a release, to make use of this fix: #21286 |
There's an AAR in the native nuget package: https://aiinfra.visualstudio.com/PublicPackages/_artifacts/feed/ORT-Nightly/NuGet/Microsoft.ML.OnnxRuntime/overview/1.19.0-dev-20240805-1630-ee2fe87e2d The nupkg file is just a zip file, and the AAR is in runtimes/android/native/onnxruntime.aar Next release should be this month. Not sure what else we could change. I can't repro the issue locally and our CI builds have no issues. |
@skottmckay Thank you very much! With that AAR I was at least able to try out our models without the NNAPI error we were getting before. Appreciate your help. I will continue trying to get the build going as it would be great to debug, try out latest releases etc. |
This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details. |
Describe the issue
I get this error when running the following command:
Relevant log output is attached to "Error/output" section.
Have tried suggested Stack Overflow fix for this error with no change to output.
Worth noting that this build command also results in the same error:
Urgency
Reasonably urgent.
Target platform
Android
Build script
build_aar_package.py
Error / output
ort_java_build_error.log
Visual Studio Version
No response
GCC / Compiler Version
No response
The text was updated successfully, but these errors were encountered: