TfLite: undefined symbol TfLiteGpuDelegateV2Create in android 
Hi @suyash-narain, I'm trying to understand how you integrated TFLite into your application. Did you build a shared library from source and included in your project? If so do you happen to have the build command you used? I'm assuming you're using JNI. Alternatively if you can export your project, I believe that will answer my questions as well. Thanks for your help. Hi @pkgoogle, how can i export my project onto github issues? or should i point you to the github link from where the project is sourced?
its sourced from  https://github.com/nyadla-sys/whisper.tflite/tree/main/whisper_android Hi @suyash-narain, you should be able to export it in Android Studio, then upload the zip file: 
![image](https://github.com/tensorflow/tensorflow/assets/132095473/5fbf9686-6c2d-4e91-9e71-a723b82f423b)
If not you can upload it to an external source such as gdrive and ensure I can download it (i.e make it public). i think i figured out the reason behind the error. the model is not compatible with the delegate and hence it fails to even create the same on android studio.
the thing i cannot understand is, if a model is CPU compatible but not compatible with the delegate, why can't the model be simply fallback on CPU instead of giving 'error invoking delegate' error? @suyash-narain https://www.tensorflow.org/lite/performance/gpu#troubleshooting_gpu_support seems to state that it should just fallback to running parts of the model on CPU (despite it being slower). So this should be a bug... do you mind uploading your project so that we may reproduce? (Often times people change more than they think, that affects our current understanding of the issue.) https://drive.google.com/file/d/1EQ4_ieaV_7SFZBLR9aM9yDvBY_pUXN_3/view?usp=sharing
here is the zip file for the project I tried updating the tflite versions to see if that helped, it did not, I was able to reproduce with the uploaded zip file:

```
    implementation 'org.tensorflow:tensorflow-lite:+'
    implementation 'org.tensorflow:tensorflow-lite-support:+'
```

Hi, @impjdi, can you please take a look? Thanks. @suyash-narain 

I did resolve this error by linking tflite for gpu in cmake file.

You can download this from https://github.com/ValYouW/tflite-dist/releases
//tensorflow/lite:libtensorflowlite.so //this is already available in your tree
tensorflow/lite/delegates/gpu:libtensorflowlite_gpu_gl.so // this needs to be pushed at cpp/tf-lite-api/generated-libs/armeabi-v7a


Upodate the whisper_android/app/src/main/cpp/CMakeLists.txt as below

if (ANDROID)
    add_library(audioEngine SHARED TFLiteEngine.cpp TFLiteEngineJNI.cpp)
    target_include_directories(audioEngine PRIVATE ${INCLUDE_DIRS})
    # Add 'tflite' library (imported)
    message("new")
    add_library(tflite SHARED IMPORTED)
    set_target_properties(tflite PROPERTIES IMPORTED_LOCATION
            ${CMAKE_CURRENT_LIST_DIR}/tf-lite-api/generated-libs/${ANDROID_ABI}/libtensorflowlite.so)
    **add_library(tflite_gpu_delegate  SHARED IMPORTED)
    set_target_properties(tflite_gpu_delegate  PROPERTIES IMPORTED_LOCATION
            ${CMAKE_CURRENT_LIST_DIR}/tf-lite-api/generated-libs/${ANDROID_ABI}/libtensorflowlite_gpu_delegate.so)
    target_link_libraries(audioEngine tflite tflite_gpu_delegate)**
endif ()

I can successfully build for gpu delegate. However, it still breaks when doing inference. Hi @Meet-synaptics 

thank you for your reply. Using the prebuilt libtensorflowlite_gpu_delegate.so file, the app does get compile, but it fails on the android aarch64 target i am trying to execute it on. 
somehow it doesn't build for arm64-v8a but only builds for armeabi-v7a.

do you have any suggestions on how to build it for arm64-v8a?

thanks
### Issue type

Support

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

2.15

### Custom code

Yes

### OS platform and distribution

Mac Big Sur

### Mobile device

aarch64 device

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Hi,

I have a whisper-tflite model and android app as well sourced from https://github.com/nyadla-sys/whisper.tflite/tree/main/whisper_android which works well on CPU of an aarch64 target similar to raspberry pi.

I wanted to add support for GPU delegate and NNAPI delegate in the app source code in android studio. 
To note, the app is unsupported on GPU/NNAPI (or some ops are unsupported on GPU/NNAPI). And according to my understanding, if a model op is unsupported on GPU/NNAPI, it will fallback onto CPU. So general understanding is the model should fallback and execute on CPU

When I add support for GPU delegate using the below code snippet sourced from https://www.tensorflow.org/lite/android/delegates/gpu_native#enable_gpu_acceleration, 
```
// Set up interpreter
auto model = FlatBufferModel::BuildFromFile(model_path);
if (!model) return false;
ops::builtin::BuiltinOpResolver op_resolver;
std::unique_ptr<Interpreter> interpreter;
InterpreterBuilder(*model, op_resolver)(&interpreter);

// NEW: Prepare GPU delegate.
auto* delegate = TfLiteGpuDelegateV2Create(/*default options=*/nullptr);
if (interpreter->ModifyGraphWithDelegate(delegate) != kTfLiteOk) return false;

// Run inference.
WriteToInputTensor(interpreter->typed_input_tensor<float>(0));
if (interpreter->Invoke() != kTfLiteOk) return false;
ReadFromOutputTensor(interpreter->typed_output_tensor<float>(0));

// NEW: Clean up.
TfLiteGpuDelegateV2Delete(delegate);
```
I get android build error saying 

**ld: error: undefined symbol: TfLiteGpuDelegateV2Create**

I have added the relevant header file to my C++ code and my gradle build file sources the cmakelists.txt file from the c++ source code directory to build the app.

My understanding is I will get the 'undefined symbol' error if the model is unsupported on the delegate. Is my understanding correct? 
If the error is truly because of unsupported model, shouldn't the app still get compiled and simply run on CPU with fallback instead of erroring out at build time?

I get same error if I try to add NNAPI support as well. 
Why is fallback to CPU from delegate not working during android build stage since whisper-tflite model works well with CPU

thanks

### Standalone code to reproduce the issue

```shell
// code snippet for GPU delegate addition

const TfLiteDelegateOptionsV2 options = TfLiteGpuDelegateOptionsV2Default();
TfLiteDelegate* delegate = TfLiteGpuDelegateV2Create(&options);

if (tflite::Interpreter->ModifyGraphWithDelegate(delegate) != kTfLiteOk) return "";
tflite::Interpreter->SetNumThreads(4);
if (tflite::Interpreter->Invoke() != kTfLiteOk) return "";
```


### Relevant log output

_No response_