googlesamples / easypermissions

Simplify Android M system permissions
https://firebaseopensource.com/projects/googlesamples/easypermissions/
Apache License 2.0
9.87k stars 1.46k forks source link

androidx support please #245

Closed XinyueZ closed 6 years ago

XinyueZ commented 6 years ago

For jetpack, this library can not be used if I use androidx namespace.

samtstern commented 6 years ago

@XinyueZ can you explain the error you're getting and how to reproduce it?

XinyueZ commented 6 years ago

@samtstern I have a project with androidx namespace which is from jetpack,

i.e.

androidx.appcompat.app.AppCompatActivity
androidx.appcompat.app.Fragment
....

however, the library is using android.support.v4.app.Fragment etc which is not awesome. Actually, I can not use this library for jetpack project.

Can the library drive a snapshot version for Jetpack, androidx namespace?

SUPERCILEX commented 6 years ago

@XinyueZ We can't do that until everyone has migrated. In the meantime, enable the Jetifier: image

XinyueZ commented 6 years ago

OK thanks, I close the ticket just for info of your side.

samtstern commented 6 years ago

Thanks @XinyueZ and @SUPERCILEX for resolving this!

peterhav commented 6 years ago

Just a minor question related to this, I decided to switch to AndroidX. In the UI of Android Studio I do see the following errors:

image

The error says cannot resolve method (due to the fact that the method now receives a androidx.fragment.app.Fragment). Compilation works fine (using the Jetifier method). Is it normal that the UI shows these errors, or do I miss something?

SUPERCILEX commented 6 years ago

Are you using Android Studio 3.2?

peterhav commented 6 years ago

@SUPERCILEX, yes, I'm using 3.2 RC2, but nevermind: the error seems to have disappeared today. This could be related to a new version of the SDK Platform tools (28.0.1) which I installed today.

XinyueZ commented 6 years ago

If anyone has problem with easypermissions on Jetpack or under androidx namespace, I've converted easypermissions to support Jetpack which has androidx namespace http://tinyurl.com/y7qb2rr7

This is a workaround to mirror origin project, it won't be supported for any bug fixing etc, it is only for androidx namespace.

implementation "com.github.xinyuez:easypermissions:1.3.0"