PierfrancescoSoffritti / android-youtube-player

YouTube Player library for Android and Chromecast, stable and customizable.
https://pierfrancescosoffritti.github.io/android-youtube-player/
MIT License
3.44k stars 765 forks source link

Error when I try to build apk after implementing the code and the library #134

Closed leketemi closed 6 years ago

leketemi commented 6 years ago

I implemented the code according to the instruction in the tutorial but when I tried to build the apk it shows the following error: Error:(20, 26) error: cannot access LifecycleObserver class file for android.arch.lifecycle.LifecycleObserver not found

PierfrancescoSoffritti commented 6 years ago

Hi, is your activity extending AppCompatActivity?

You don't usually need to import any library, but just in case you can import it as explained here.

Or, if you don't want to add the player as a lifecycle observer you can just not register it and call destroy and pause yourself, as explained here.

leketemi commented 6 years ago

Thanks for the reply. Yes, my activity extended AppCompatActivity.

PierfrancescoSoffritti commented 6 years ago

which version of appcompat are you using?

leketemi commented 6 years ago

'com.android.support:appcompat-v7:25.3.1'. I think it's going to work. I'll like to make a request from you, I don't know if you can be like a mentor to me because I'm still a begininer in android. So if you like to help me please give me your twitter and whatsApp(for direct comminucation) address, or send it to my mail: leketemi@gmail.com. Thanks.

PierfrancescoSoffritti commented 6 years ago

You need to updated app compat to its last version com.android.support:appcompat-v7:27.1.1. If you use the last version you won't need any extra library to use lifecycle observers.

Regarding your request: I am quite busy and therefore won't be able to help you in real time, also this days it's quite easy to learn Android development on the internet (that's how I've learned some years ago). But feel free to ask specific questions if you have any, you can find my email on my github profile.

I will be able to answer only questions you have already researched on your own and asked in a clear and specific format.

leketemi commented 6 years ago

Do you mean if I use "com.android.support:appcompat-v7:27.1.1". There is no need to use livecycle dependencies. Also, I want to know if I can apply fullscreen to the player from the code without using the toggle button. Thanks a million.