Android-youtube-player: FullScreenHelper gives the error "Usage of Kotlin internal declaration from different module"

Created on 29 Sep 2020  路  5Comments  路  Source: PierfrancescoSoffritti/android-youtube-player

Most helpful comment

Seems like you are importing classes from the wrong package.
I guess you are supposed to copy all the classes from the sample project to yours and import the copied classes. What you do however is importing the package private core classes.

In other words:
Copy the class(es) from the Core Sample App directory (in your case the FullScreenHelper.java) into your project under utils for exmaple, and then import your class from your project. I guess the core's FullScreenHelper.kt class is for defaults purposes in case the developer does not want to implement customizations.

Hope that solves your problem. :)

All 5 comments

Hey @raghavagg01, that seems understandable because the class you try to acces is not visible (declared internal aka. package private in java). This is probably for a reason.

What do you try to achieve with the class instantiation?

I have copied the code from CompleteExampleActivity.java file as i am trying to implement the Complete Youtube player in my android app.
File address:
https://github.com/PierfrancescoSoffritti/android-youtube-player/blob/master/core-sample-app/src/main/java/com/pierfrancescosoffritti/androidyoutubeplayer/core/sampleapp/examples/completeExample/CompleteExampleActivity.java

Seems like you are importing classes from the wrong package.
I guess you are supposed to copy all the classes from the sample project to yours and import the copied classes. What you do however is importing the package private core classes.

In other words:
Copy the class(es) from the Core Sample App directory (in your case the FullScreenHelper.java) into your project under utils for exmaple, and then import your class from your project. I guess the core's FullScreenHelper.kt class is for defaults purposes in case the developer does not want to implement customizations.

Hope that solves your problem. :)

@malliaridis thanks for helping out! my bad for give the same name to internal and sample app class.

Thanks for the help, Appreciated !

Was this page helpful?
0 / 5 - 0 ratings