Closed
Description
Currently Glide compiler is partially supporting androidx.annotation
namespace, currently the AndroidX project I am building is failing because Glide compiler is still using android.support.annotation.CheckResult
and android.support.annotation.NonNull
rather than its successors androidx.annotation.NonNull
& androidx.annotation.CheckResult
.
I have tried with both versions 4.7.1 & 4.8.0-SNAPSHOT
It would be great if the AndroidX annotation namespace is completely supported rather than partially supported.
Basically any occurrence of android.support.annotation
should change to androidx.annotation
Activity
[-]Glide compiler for AndroidX project partially supports `androidx.annotation`[/-][+]Glide compiler for AndroidX project partially supports `androidx.annotation` namespace[/+]KevinLeigh commentedon Jul 5, 2018
For now I temporarily added the below so that there is no longer a compilation error:
Rajeshr34 commentedon Jul 6, 2018
Temporary fix not working for me with android databinding enabled.
KevinLeigh commentedon Jul 6, 2018
@Rajeshr34 Hey there, are you using AndroidX? Please post your error as well
Rajeshr34 commentedon Jul 6, 2018
@KevinLeigh Same annotation errors.... also tried to make change and build but its not worked for me. is there any solution for this?
KevinLeigh commentedon Jul 6, 2018
@Rajeshr34
It works fine on my side, please see below the project setup that I am using.
I am using Glide
4.8.0-SNAPSHOT
for both annotation processor library and core library. I am usingAndroid Studio IDE 3.3 Canary build Version 2
with Gradle version4.8
, as well as Gradle build tools3.3.0-alpha02
. I would not recommend this setup for a project that is in production that should use only stable versions of libraries. This current setup is only for trying out certain features that are not yet available in stable releases.KevinLeigh commentedon Jul 6, 2018
@Rajeshr34
Another thing is you should always clean rebuild your project correctly when making major updates.
The reason the temporary fix should work is because
android.support.annotation
does not exist when you update to useandroidx.annotation
, and Glide compiler is currently using both namespaces to generate classes. So importing older namespaceandroid.support.annotation
will include the missing namespace that no longer exists when usingandroidx.annotation
, so your project should now have both namespaces.Rajeshr34 commentedon Jul 6, 2018
@KevinLeigh Thank You. its working now
KevinLeigh commentedon Jul 6, 2018
@Rajeshr34 All good, glad it is working on your side.
kerjani commentedon Jul 10, 2018
Hi,
The solution sounds good, but when will be the 4.8.0-SNAPSHOT version available?
Rajeshr34 commentedon Jul 10, 2018
@kerjani 4.8.0-SNAPSHOT is out
mufumbo commentedon Jul 12, 2018
@Rajeshr34 is it working for you? here it's still using damn android.support.annotation package rather than android.xannotation
Shusshu commentedon Jul 26, 2018
4.8.0-SNAPSHOT works for me
mice777 commentedon Aug 15, 2018
I solved this by normally using stable version 4.7.1, and added files Nullable.java and CheckResult.java into my project from Android SDK sources (into correct path android\support\annotation). Then Glide finds its annotation classed, and it works, while my app uses AndroidX.
24 remaining items