0

Google does not officially support compiling Android on Mac. but I read that it is possible.

The command m has an error

How can I fix the error?

the error:

"Could not find a supported mac sdk: [\"10.10\" \"10.11\" \"10.12\" \"10.13\" \"10.14\" \"10.15\" \"11.0\" \"11.1\"]"

I understood that the problem is due to an incompatible sdk, in the guides I saw that you need to download a compatible sdk from https://github.com/phracker/MacOSX-SDKs/releases, but I can't find one for mac 13.3

update: I added my sdk number to the array, As in the post https://stackoverflow.com/a/53715111/9458132. And now there are errors:

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]

I tried to fix it in the code(Although of course this is not a recommended thing...) , in any case there is an error:

`ld: in /Volumes/aosp/source/prebuilts/rust/darwin-x86/1.51.0/lib/rustlib/x86_64-apple-darwin/lib/libunwind-6c9932b2c088cadd.rlib(lib.rmeta), archive member 'lib. rmeta' with length 30728 is not mach-o or llvm bitcode file '/Volumes/aosp/source/prebuilts/rust/darwin-x86/1.51.0/lib/rustlib/x86_64-apple-darwin/lib/libunwind-6c9932b2c088cadd. rlib'
           clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error

15:15:09 ninja failed with: exit status 1
  1. Why there is the error
  2. Is there a solution where they won't have to change the code (it turns out that because the sdk is not compatible, it also gets stuck afterwards..)

i am using mac 13.3 (ventura)

sdk version: 13.3 clang version: 16.0.1 thank's.

Mordechay
  • 21
  • 5

1 Answers1

1

Okay, so I was trying something similar, the solution to this answer is actually add your current macOS SDK to darwinSupportedSdkVersions in cc/config/x86_darwin_host.go like here, https://github.com/rajatgupta1998/build_soong/commit/845c27d520c601b71565d7754c6e2efb541414f4.

You can find the exact version number of the sdk installed on your system via this command: find /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs -iname "*.sdk"

Another answer which explains this too: https://stackoverflow.com/a/53715111/9458132

Update: For the sprintf deprecation issue, you can actually fix it by replacing with snprintf accordingly, since on Xcode 14+, sprintf is deprecated on mac. There are a few repos which require this patching.

Rajat Gupta
  • 419
  • 3
  • 10
  • error: `ld: in /Volumes/aosp/source/prebuilts/rust/darwin-x86/1.51.0/lib/rustlib/x86_64-apple-darwin/lib/libunwind-6c9932b2c088cadd.rlib(lib.rmeta), archive member 'lib. rmeta' with length 30728 is not mach-o or llvm bitcode file '/Volumes/aosp/source/prebuilts/rust/darwin-x86/1.51.0/lib/rustlib/x86_64-apple-darwin/lib/libunwind-6c9932b2c088cadd. rlib' clang-12: error: linker command failed with exit code 1 (use -v to see invocation) – Mordechay May 02 '23 at 12:47
  • 1
    Okay this seems a new one, I have not seen this on Android 13 or 11. What is the clang version and the sdk version you have installed? Can u share the versions in a comment here? Meanwhile I will be syncing AOSP 12 and trying this again. – Rajat Gupta May 02 '23 at 15:24
  • clang 16.0.1 sdk 13.3 [screenshot command](https://i.stack.imgur.com/ov7aU.png) – Mordechay May 03 '23 at 12:00
  • p.s. There is an option to downgrade Clang? (When I tried to change the SDK to an older version, I encountered errors caused by Clang. I think this is because I also need to use an older version of Clang.) – Mordechay May 03 '23 at 12:15
  • hello. @RajatGupta something new? Could you detail what you were able to compile and on which version of mac, sdk, clang? – Mordechay Aug 06 '23 at 11:13