2

I've a annotation processor for android with following dependencies:

compile 'com.squareup:javapoet:1.10.0'
compile 'com.google.android:android:4.1.1.4'
compile 'com.google.android:support-v4:r7'

In my processor I access Activity and Fragment class. Which includes do I need now to be able to use the new android x Fragment? I can't find anything about this...

I naivly tried adding

implementation 'androidx.fragment:fragment:1.0.0'
// or
implementation 'androidx.appcompat:appcompat:1.0.0'

But this does not help...

prom85
  • 16,896
  • 17
  • 122
  • 242

1 Answers1

0

On the new AndroidX projects, Fragments import are like this:

import androidx.fragment.app.Fragment

Which means, you should already have added the dependencies and migrated to AndroidX which will show the dependenices like following for example:

implementation 'androidx.appcompat:appcompat:1.0.0'

So, you won't probably need this:

implementation 'androidx.fragment:fragment:1.0.0'
ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
  • I tried `androidx.appcompat:appcompat:1.0.0` but this is not working in my java project. In my android projects I use this, but their should be some minimal libraries that only declare the classes for the use in annotation processors... – prom85 Sep 27 '18 at 13:59
  • Didn't you use Migrate to Androidx by Android Studio? Or you just added the dependencies by your own? As you know, we weren't used to use another dependency for the `Fragment`s before and now, it's like the same situation. – ʍѳђઽ૯ท Sep 27 '18 at 14:04