TfLite.initialize failure - android.os.RemoteException: Error loading TFLite GPU delegate module Caused by: lh: No acceptable module com.google.android.gms.tflite_gpu_dynamite found. Local version is 0 and remote version is 0.
Hello!

It looks like the GPU delegate is not available on the device you are running on. This can happen due to several reasons, and in this case it might be transient, but in general we recommend to [check for availability of the GPU delegate ](https://www.tensorflow.org/lite/android/play_services#checking_device_compatibility) and only request the GPU delegate when it is supported. I've added the check, and the result is `true`

However now when I call `InterpreterApi.create(...)` I'm getting another error. 

```
No implementation found for void com.google.android.gms.tflite.gpu.GpuDelegateNative.nativeDoNothing() ...
java.lang.IllegalStateException: Error creating GPU delegate at org.tensorflow.lite.gpu.GpuDelegateFactory.create(GpuDelegateFactory.java:189)...
Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method)...
Caused by: java.lang.UnsatisfiedLinkError: Failed to load native GpuDelegate methods. Check that the correct native libraries are present, and, if using a custom native library, have been properly loaded via System.loadLibrary(): java.lang.UnsatisfiedLinkError: No implementation found for void ...
Caused by: [CIRCULAR REFERENCE: java.lang.UnsatisfiedLinkError: No implementation found for void com.google.android.gms.tflite.gpu.GpuDelegateNative.nativeDoNothing() (tried Java_com_google_android_gms_tflite_gpu_GpuDelegateNative_nativeDoNothing and Java_com_google_android_gms_tflite_gpu_GpuDelegateNative_nativeDoNothing__)
```

Full log: [crashlog-gpudelegate.txt](https://github.com/tensorflow/tensorflow/files/11471906/crashlog-gpudelegate.txt)

I have verified that calling `TfLite.initialize(...)` is successful before calling `InterpreterApi.create(...)` It looks like the version of the `com.google.android.gms:play-services-tflite-java` dependency (16.0.0) is too old for the `com.google.android.gms:play-services-tflite-gpu` version (16.2.0). Normally we add POM-level dependencies to automatically update dependencies to the required version, but it looks like we missed that in this instance.

In the meantime, updating your `com.google.android.gms:play-services-tflite-java` dependency to the latest version (16.1.0) should hopefully fix this issue. @sheepmaster thank you for your reply

However I am not using `com.google.android.gms:play-services-tflite-java` (at least not directly)

My full dependencies are here:

```
dependencies {
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'

    // App compat and UI things
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.android.material:material:1.4.0'

    implementation "androidx.concurrent:concurrent-futures-ktx:1.1.0"
    testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'

    // CameraX
    def camerax_version = '1.3.0-SNAPSHOT'
    implementation "androidx.camera:camera-core:${camerax_version}"
    implementation "androidx.camera:camera-camera2:${camerax_version}"
    implementation "androidx.camera:camera-lifecycle:${camerax_version}"
    implementation "androidx.camera:camera-view:${camerax_version}"
    implementation "androidx.camera:camera-video:${camerax_version}"


    // Tensorflow lite dependencies
    implementation 'org.tensorflow:tensorflow-lite-task-vision-play-services:0.4.2'
    implementation 'com.google.android.gms:play-services-tflite-gpu:16.2.0'

    testImplementation 'org.robolectric:robolectric:4.4'
    testImplementation 'junit:junit:4.13.2'
}
``` OK, in that case just add a line
```
implementation 'com.google.android.gms:play-services-tflite-java:16.1.0'
```
to the `Tensorflow lite dependencies`  section :) 

(OTOH, you _might_ not need the `org.tensorflow:tensorflow-lite-task-vision-play-services` dependency if you are using `InterpreterApi`). Ahh yes that seemed to be the issue. I had the Task dependencies instead of [Interpreter API dependencies](https://www.tensorflow.org/lite/android/play_services#1_add_project_dependencies_2) 👍 Thank you for your help! Hi @jplipata 

Glad the issue is resolved for you. Feel free to close the issue.

Thanks. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. 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/60544">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/60544">No</a>

My implementation was working before adding GPU delegate (following instructions [here](https://www.tensorflow.org/lite/android/play_services#gpu_with_interpreter_apis)). After following those instructions I get this error when initializing TfLite

TfLite.initialize failure

```
android.os.RemoteException: Error loading TFLite GPU delegate module
  at pi.a(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:0)
  at com.google.android.gms.tflite.dynamite.TfLiteDynamiteLoaderImpl.b(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:8)
  at com.google.android.gms.tflite.dynamite.TfLiteDynamiteLoaderImpl.getInternalNativeInitializationHandleWithParams(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:0)
  at oi.w(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:5)
  at bs.onTransact(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:4)
  at android.os.Binder.transact(Binder.java:1200)
  at com.google.android.gms.internal.tflite.zza.zzb(com.google.android.gms:play-services-tflite-impl@@16.0.0:2)
  at com.google.android.gms.tflite.dynamite.zza.zze(com.google.android.gms:play-services-tflite-impl@@16.0.0:4)
  at com.google.android.gms.internal.tflite.zzr.zzc(com.google.android.gms:play-services-tflite-impl@@16.0.0:11)
  at com.google.android.gms.internal.tflite.zzp.zza(com.google.android.gms:play-services-tflite-impl@@16.0.0:7)
  at com.google.android.gms.internal.tflite.zzn.then(Unknown Source:6)
  at com.google.android.gms.tasks.zzo.run(com.google.android.gms:play-services-tasks@@18.0.2:1)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
  at java.lang.Thread.run(Thread.java:1012)
Caused by: lh: No acceptable module com.google.android.gms.tflite_gpu_dynamite found. Local version is 0 and remote version is 0.
  at ll.c(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:88)
  at com.google.android.gms.tflite.dynamite.TfLiteDynamiteLoaderImpl.b(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:4)
  at com.google.android.gms.tflite.dynamite.TfLiteDynamiteLoaderImpl.getInternalNativeInitializationHandleWithParams(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:0) 
  at oi.w(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:5) 
  at bs.onTransact(:com.google.android.gms.policy_tflite_dynamite_dynamite@231406201@231406200065.522547357.522547357:4) 
  at android.os.Binder.transact(Binder.java:1200) 
  at com.google.android.gms.internal.tflite.zza.zzb(com.google.android.gms:play-services-tflite-impl@@16.0.0:2) 
  at com.google.android.gms.tflite.dynamite.zza.zze(com.google.android.gms:play-services-tflite-impl@@16.0.0:4) 
  at com.google.android.gms.internal.tflite.zzr.zzc(com.google.android.gms:play-services-tflite-impl@@16.0.0:11) 
  at com.google.android.gms.internal.tflite.zzp.zza(com.google.android.gms:play-services-tflite-impl@@16.0.0:7) 
  at com.google.android.gms.internal.tflite.zzn.then(Unknown Source:6) 
  at com.google.android.gms.tasks.zzo.run(com.google.android.gms:play-services-tasks@@18.0.2:1) 
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
  at java.lang.Thread.run(Thread.java:1012) 
---------------------------- PROCESS ENDED (24111) for package com.android.example.camerax.tflite ---------
```


**System information**
- Android Device information: samsung/o1quew/o1q:13/TP1A.220624.014/G991U1UEU6EWD1:user/release-keys
- TensorFlow Lite in Play Services SDK version (found in `build.gradle`): 
  - org.tensorflow:tensorflow-lite-task-vision-play-services:0.4.2 
  - com.google.android.gms:play-services-tflite-gpu:16.2.0
- Google Play Services version
  (`Settings` > `Apps` > `Google Play Services` > `App details`): 23.16.13

**Standalone code to reproduce the issue**



```
implementation 'org.tensorflow:tensorflow-lite-task-vision-play-services:0.4.2'
implementation 'com.google.android.gms:play-services-tflite-gpu:16.2.0'
```

Activity class
```
override fun onCreate... {
 val initializeTask: Task<Void> by lazy {
            TfLite.initialize(
                this,
                TfLiteInitializationOptions.builder()
                    .setEnableGpuDelegateSupport(true)
                    .build()
            )
        }
}
```

