Skip to content

ClassNotFound exception when calling nested static class with correct argument #1195

@asimyildiz

Description

@asimyildiz

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI:
  • Cross-platform modules:
  • Android Runtime: 4.2.0
  • iOS Runtime (if applicable):
  • Plugin(s):

Describe the bug

java.lang.ClassNotFoundException: com.tns.gen.com.google.android.exoplayer2.source.smoothstreaming.DefaultSsChunkSource$Factory
When connected with chrome debugger, everything is fine, if you put a breakpoint you will see that the class is there, also from console when you try to instantiate the class with wrong argument, you will see "Invalid number of arguments" message. But when you pass the correct argument, java.lang.ClassNotFoundException exception is fired.
My gradle config (sdk versions) :
compileSdkVersion = 26 defaultConfig { minSdkVersion = 24 targetSdkVersion = 24 }

To Reproduce

add dependency to exoplayer into gradle, and try to create object from the nested static class.
dependencies {
compile 'com.google.android.exoplayer:exoplayer:2.6.1'
}
new com.google.android.exoplayer2.source.smoothstreaming.DefaultSsChunkSource.Factory({})

Expected behavior
When passing the correct object as an argument, there shall be no java.lang.ClassNotFoundException

Sample project

Additional context

Here is the class from exoplayer library :
public class DefaultSsChunkSource implements SsChunkSource { public static final class Factory implements SsChunkSource.Factory {

also here is the interface details :
public interface SsChunkSource extends ChunkSource { interface Factory {

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions