JNI unable to find classes in androidx

100 views
Skip to first unread message

Jihyun Jeon

unread,
Jul 25, 2024, 7:58:27 PMJul 25
to android-ndk
Hello,
I'm trying to use an exoplayer in a c++ file. However, whenever I try to call env->findclass with any androidx classes (i.e. androidx/media3/common/mediaitem, androidx/media3/exoplayer/Exoplayer, androidx/navigation/fragment/FragmentNavigator) I get an java.lang.ClassNotFoundException exception.

My build.gradle has the following dependencies:

dependencies {

  // Package/application AndroidManifest.xml properties, plus headers and libraries
  // exposed to CMake
  implementation 'org.khronos.openxr:openxr_loader_for_android:1.0.34'


  implementation fileTree(dir: 'libs', include: ['*.jar'])
  implementation 'androidx.appcompat:appcompat:1.3.0'
  implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

  implementation "androidx.navigation:navigation-fragment:2.3.5"
  implementation "androidx.navigation:navigation-ui:2.3.5"

  implementation 'com.google.android.material:material:1.3.0'
  implementation "androidx.viewpager2:viewpager2:1.0.0"

  implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'

  implementation "androidx.media3:media3-exoplayer:1.3.1"
  implementation "androidx.media3:media3-exoplayer-dash:1.3.1"
  implementation "androidx.media3:media3-ui:1.3.1"
  implementation "androidx.media3:media3-common:1.3.1"
  implementation "androidx.media3:media3-session:1.3.1"
}

Thank you.
Reply all
Reply to author
Forward
0 new messages