Skip to content

System/Collections must not appear in JNI method signatures #1104

Open
@jonpryor

Description

@jonpryor

Android framework version

net8.0-android, net9.0-android, Other

Affected platform version

All

Description

The string LSystem/Collections must not appear within JNI Method Signatures, because that is not the beginning of a valid Java type.

The current offender:

id_addMediaItems_ILSystem_Collections_Generic_IList_1_ = JNIEnv.GetMethodID (class_ref, "addMediaItems", "(ILSystem/Collections/Generic/IList<global::AndroidX.Media3.Common.MediaItem>;)V");

The fact that such methods are mentioned in a Transforms.xml is also not encouraging:

androidx/media3/common/Player.addMediaItems(ILSystem/Collections/Generic/IList`1;)V
androidx/media3/common/Player.addMediaItems(LSystem/Collections/Generic/IList`1;)V
androidx/media3/common/Player.setMediaItems(LSystem/Collections/Generic/IList`1;)V
androidx/media3/common/Player.setMediaItems(LSystem/Collections/Generic/IList`1;Z)V
androidx/media3/common/Player.setMediaItems(LSystem/Collections/Generic/IList`1;IJ)V
androidx/media3/common/Player.setMediaItems(LSystem/Collections/Generic/IList`1;IJ)V
androidx/media3/common/Player.replaceMediaItems(IILSystem/Collections/Generic/IList`1;)V
androidx/media3/exoplayer/ExoPlayer.replaceMediaItems(IILjava/util/List;)V

JNI method signatures must only reference Java types. Failure to do so means the Java method cannot be resolved at runtime, which will result in exceptions at runtime:

@ne0rrmatrix: It looks like in Media3 SetMediaItems and AddMediaItems is not working.

 Java.Lang.NoSuchMethodError: 'no non-static method "Landroidx/media3/exoplayer/ExoPlayerImpl;.setMediaItems(LSystem/Collections/Generic/IList<global::AndroidX.Media3.Common.MediaItem>;)V"'

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions