-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Add support for cross compiling on Windows for Android #24700
Comments
the first question would be, did you set ANDROID_NDK_ROOT and your PATH environment variables properly, as per the NOTES-ANDROID.md instructions? From the above, I don't see a reference to doing so |
Apologies, ANDROID_NDK_ROOT=C:\Users\51010384\AppData\Local\Android\Sdk\ndk\27.0.11902837 |
so you're msl installation seems to be off, in that you don't have llvm-ar installed (it is perhaps just named ar, unsure). I am guessing your Configure command failed because prefix is misspelled:
should be
|
I have checked with the correct command as well, it is still showing the same error i.e
if msl is what causing the issues, how to make on. what should I do in that case? |
|no NDK arm-linux-androideabi-gcc on $PATH |at (eval 12) line 143. It looks like the config target you selected is looking for gcc as a compiler, but your PATH is pointing to the binaries for clang. If you want to use gcc you need to adjust your Path variable to point to the gcc tool chain for android If you want to use clang...I'm on my phone so I can't look it up, but I believe there is an android -arm-clang target you need to select so the compiler command gets selected properly |
The NDK I have downloaded i.e r26 till r23, all are having clang in their toolchain. I was looking for gcc but I wasn't able to find it. I have downloaded the windows zip for ndk from r26 to r23. |
It supposed to detect that automatically, favoring clang over gcc as the latter is being phased out by android. Which makes me wonder why the proper clang prefix isn't getting found. I suppose the next step would be to start adding some print statements in the Configurations/15-android.conf file aourd the comment:
To determine why the proper clang compiler prefix isn't getting chosen |
the above config dump you are seeing are coming when I am using wsl. When using wsl it was able to find the clang abi file but I am getting another file not found error when trying to make the file.
I am not sure how to get these files or may be I am unable to set the files in their correct location. I am using the windows directory path
but it is looking for /app to search for the files. do I have to make some changes in saving the files in different location? Any workaround I can do to fix this issue? |
I have tried applying your suggestion by adding below print statements
I have found that the path it is checking for clang it is finding it as invalid in windows, I am getting logs as :
what sort of changes I make in regx to make it work for windows so that it find my clang directly as valid? |
Cross-compiling for Android on Windows is not supported currently. We would welcome pull requests that would add the support. |
I am trying to build the static library for the android-arm platform from my windows 11 pc.
I have set the respective environment variables in windows from the NOTE-Android.md:-
I have ran the below command and came into issue:
`
I have done research on this issue before and found few of this as active issue, some are suggesting to use the linux but my project is built on windows and I require this library to work in android. I am using Microsoft visual studio 2022, using developer powershell by microsoft visual studio and running code in win32, but I need my current project in android application so I have to have a static file.
I have tried using wsl, but it is giving error
`
below is the configdata.pm --dump when using wsl:
Command line (with current working directory = .):
Perl information:
Enabled features:
Disabled features:
Config target attributes:
Recorded environment:
Makevars:
NOTE: These variables only represent the configuration view. The build file
template may have processed these variables further, please have a look at the
build file for more exact data:
Makefile
build file:
build file templates:
Can you please share any resource or something else I could you to fix this error and can run the same using windows machine for get static archive of android-arm.
The text was updated successfully, but these errors were encountered: