
image.png
正常情況下 在AS工具欄上 點擊一鍵遷移就可以遷移
然后點擊運行 看看有沒有報錯的
一般是會出現(xiàn)報錯的· build-rebuild
- AndroidManifest.xml provider 修改為androidx
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:enabled="true"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"
tools:replace="android:resource" />
</provider>
- butterknife 一般需要升級到版本10以上
- The given artifact contains a string literal with a package reference 'android.support.v4.content' that cannot be safely rewritten. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx.
給定的工件包含字符串文字,該文字字符串具有無法安全地重寫的包引用'android.support.v4.content'。使用反射的庫(例如注釋處理器)需要手動更新,以增加對androidx的支持
這里需要注意:反射或者字符串引用到的support 需要自己手動更新 這里是個坑?。?! 特別是反射 一不小心就報錯