Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

No implementation found for GvrAudioEngine.nativeEnableStereoSpeakerMode(long, boolean) #625

Open
sarathsi opened this issue Mar 21, 2019 · 1 comment

Comments

@sarathsi
Copy link

gvrsdk: com.google.vr:sdk-audio:1.190.0

2019-03-21 15:48:28.154 16582-16582/? E/sceneviewsampl: No implementation found for void com.google.vr.sdk.audio.GvrAudioEngine.nativeEnableStereoSpeakerMode(long, boolean) (tried Java_com_google_vr_sdk_audio_GvrAudioEngine_nativeEnableStereoSpeakerMode and Java_com_google_vr_sdk_audio_GvrAudioEngine_nativeEnableStereoSpeakerMode__JZ)
2019-03-21 15:48:28.155 16582-16582/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.huawei.hbs.arsceneviewsample, PID: 16582
java.lang.UnsatisfiedLinkError: No implementation found for void com.google.vr.sdk.audio.GvrAudioEngine.nativeEnableStereoSpeakerMode(long, boolean) (tried Java_com_google_vr_sdk_audio_GvrAudioEngine_nativeEnableStereoSpeakerMode and Java_com_google_vr_sdk_audio_GvrAudioEngine_nativeEnableStereoSpeakerMode__JZ)
at com.google.vr.sdk.audio.GvrAudioEngine.nativeEnableStereoSpeakerMode(Native Method)
at com.google.vr.sdk.audio.GvrAudioEngine.enableSpeakerStereoMode(SourceFile:52)

@sigmaxipi
Copy link

This is a bug in the JNI interface due to a typo. The JNI code says

JNI_EXPORT void JNI_WRAPPER(EnableSpeakerStereoMode)(JNIEnv* env, jobject obj,
                                                     jlong j_ptr,
                                                     jboolean enable) {
  const VrAudioSystem* const vr_audio_system = NativePtrFromJPtr(j_ptr);
  DCHECK(vr_audio_system);
  vr_audio_system->vr_audio->EnableStereoSpeakerMode(enable);
}

but the Java code says private native void nativeEnableStereoSpeakerMode(long vrAudioSystemRef, boolean enable);

As a temporary workaround, you could create a JNI function called Java_com_google_vr_sdk_audio_GvrAudioEngine_nativeEnableStereoSpeakerMode which calls Java_com_google_vr_sdk_audio_GvrAudioEngine_nativeEnableSpeakerStereoMode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants