Migrate annotation processor to androidX

核能气质少年 提交于 2021-02-10 05:20:29

问题


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...


回答1:


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'


来源:https://stackoverflow.com/questions/52537975/migrate-annotation-processor-to-androidx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!