Building libtensorflowlite_gpu_delegate.so with bazel raise an error.
It seems that the error caused by below code in `tensorflow/tensorflow/lite/delegates/gpu/BUILD`:
```
ios_static_framework(
    name = "tensorflow_lite_gpu_framework",
    hdrs = [
        "metal_delegate.h",
        "metal_delegate_internal.h",
    ],
    minimum_os_version = "11.4",
    deps = [":metal_delegate"],
)
``` 

When I disable this code, the problem is gone. But I think it need to be checked. I had a different but similar issue that builds for tflite but failed for GPU delegates

It is the final linkage step that raise an error stating `can't find -lnativewindow`..

I remember it worked before but then I pulled the latest commits and forgot where I was before. 

...  From the readme in `https://github.com/bazelbuild/rules_apple`, you need to upgrade `build_bazel_rules_apple` to 2.* for it to work with bazel 6.x. In this case any bazel command that loads `//tensorflow/lite/delegates/gpu/BUILD` would fail.

Tested the upgrade with the following changes and it seems to fix it.
```
tensorflow ❯ git diff
diff --git a/.bazelversion b/.bazelversion
index f53152b50eb..8648bac098e 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1,2 +1,2 @@
-5.3.0
-# NOTE: Update Bazel version in tensorflow/tools/ci_build/release/common.sh.oss
\ No newline at end of file
+6.0.0
+# NOTE: Update Bazel version in tensorflow/tools/ci_build/release/common.sh.oss
diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
index 7bccbe873e5..8418596017f 100644
--- a/tensorflow/workspace2.bzl
+++ b/tensorflow/workspace2.bzl
@@ -822,8 +822,10 @@ def _tf_repositories():
     # https://github.com/bazelbuild/rules_apple/releases
     tf_http_archive(
         name = "build_bazel_rules_apple",
-        sha256 = "36072d4f3614d309d6a703da0dfe48684ec4c65a89611aeb9590b45af7a3e592",
-        urls = tf_mirror_urls("https://github.com/bazelbuild/rules_apple/releases/download/1.0.1/rules_apple.1.0.1.tar.gz"),
+        # sha256 = "36072d4f3614d309d6a703da0dfe48684ec4c65a89611aeb9590b45af7a3e592",
+        # urls = tf_mirror_urls("https://github.com/bazelbuild/rules_apple/releases/download/1.0.1/rules_apple.1.0.1.tar.gz"),
+        sha256 = "3e2c7ae0ddd181c4053b6491dad1d01ae29011bc322ca87eea45957c76d3a0c3",
+        urls = tf_mirror_urls("https://github.com/bazelbuild/rules_apple/releases/download/2.1.0/rules_apple.2.1.0.tar.gz"),
     )

     # https://github.com/bazelbuild/rules_swift/releases
``` @sohaiberrabii, Thanks for the workaround. 
@jyh2378 , Our latest Bazel support in Tensorflow is `5.3.0`, until we publish the tested build configuration for the latest version, it is suggested to use 5.3.0.
For now you can consider the above workaround in your case, but it may break the actual behavior of framework.  This issue has been marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you. Closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks! Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59794">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59794">No</a>
 @shelperI had the same issue that builds for tflite but failed for GPU delegates

It is the final linkage step that raise an error stating can't find -lnativewindow..

If you solved this problem, can you tell me how? Hi @shelper I had the same issue that builds for tflite but failed for GPU delegates

It is the final linkage step that raise an error stating can't find -lnativewindow..

If you solved this problem, can you tell me how?

Thanks!
 Hi @shelper 
The following is my error report：
/usr/bin/ld: cannot find -lnativewindow
/usr/bin/ld: cannot find -lnativewindow
collect2: error: ld returned 1 exit status Hi @wqy123456, I encountered the same problem, did you solve it?
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

tf 2.11.0

### OS Platform and Distribution

Linux RHEL 8


### Python version

3.10.8

### Bazel version

6.0.0

### GCC/Compiler version

8.5.0

### Android NDK version

android-ndk-r21e

### Current Behaviour?

I tried to build tflite gpu library for android using bazel. There is no problem when building `libtensorflow.so`, but error is occurred when building `libtensorflowlite_gpu_delegate.so`.


### Standalone code to reproduce the issue
- build `libtensorflowlite_gpu_delegate.so`
```shell

bazel build --config android_arm -c opt //tensorflow/lite:libtensorflowlite.so
```
- build `libtensorflowlite_gpu_delegate.so`
```shell

bazel build --config android_arm -c opt //tensorflow/lite/delegates/gpu:libtensorflowlite_gpu_delegate.so
```


### Relevant log output

```
ERROR: Traceback (most recent call last):
        File "/home1/irteam/users/yeonghwa.jin/AR.MobileDL/tensorflow_src/tensorflow/lite/delegates/gpu/BUILD", line 153, column 21, in <toplevel>
                ios_static_framework(
        File "/home1/irteam/.cache/bazel/_bazel_irteam/326ce39c70196ccdfc072be4c665d440/external/build_bazel_rules_apple/apple/ios.bzl", line 62, column 11, in ios_static_framework
                native.apple_static_library(
Error: no native function or rule 'apple_static_library'
Available attributes: aar_import, action_listener, alias, android_binary, android_device, android_device_script_fixture, android_host_service_fixture, android_instrumentation_test, android_library, android_local_test, android_sdk, android_tools_defaults_jar, apple_cc_toolchain, available_xcodes, cc_binary, cc_host_toolchain_alias, cc_import, cc_libc_top_alias, cc_library, cc_proto_library, cc_shared_library, cc_shared_library_permissions, cc_test, cc_toolchain, cc_toolchain_alias, cc_toolchain_suite, config_feature_flag, config_setting, constraint_setting, constraint_value, environment, existing_rule, existing_rules, exports_files, extra_action, fdo_prefetch_hints, fdo_profile, filegroup, genquery, genrule, glob, j2objc_library, java_binary, java_import, java_library, java_lite_proto_library, java_package_configuration, java_plugin, java_plugins_flag_alias, java_proto_library, java_runtime, java_test, java_toolchain, label_flag, label_setting, objc_import, objc_library, package, package_group, package_name, platform, propeller_optimize, proto_lang_toolchain, proto_library, py_binary, py_library, py_runtime, py_test, repository_name, sh_binary, sh_library, sh_test, subpackages, test_suite, toolchain, toolchain_type, xcode_config, xcode_config_alias, xcode_version
ERROR: Skipping '//tensorflow/lite/delegates/gpu:libtensorflowlite_gpu_delegate.so': Error evaluating '//tensorflow/lite/delegates/gpu:libtensorflowlite_gpu_delegate.so': error loading package 'tensorflow/lite/delegates/gpu': Package 'tensorflow/lite/delegates/gpu' contains errors
WARNING: Target pattern parsing failed.
ERROR: Error evaluating '//tensorflow/lite/delegates/gpu:libtensorflowlite_gpu_delegate.so': error loading package 'tensorflow/lite/delegates/gpu': Package 'tensorflow/lite/delegates/gpu' contains errors
INFO: Elapsed time: 0.234s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)
```