繁体   English   中英

androidX迁移并将react-native升级到0.60.4之后,“包android.support.annotation不存在”

[英]“package android.support.annotation does not exist” after androidX migration and react-native upgrade to 0.60.4

我已经使用重构->从Android Studio迁移到AndroidX迁移到了androidX。

而且我已经将我的react native升级到0.60.4

在构建应用程序时出现此错误之后。

error: package android.support.annotation does not exist
import android.support.annotation.Nullable;

我找到了这个解决方案, https://stackoverflow.com/a/56206103/9724247

它也可以!

但是这些来自节点模块,我有太多这样的错误。

除了手动编辑之外,还有什么方法可以处理这些?

谢谢。

请按照https://github.com/mikehardy/jetifier/blob/master/README.md上的说明使用jetifier。

这是自述文件的摘要:

1. First, use Android Studio's refactoring tool to convert your app re: the Android developer docs
2. npm install --save-dev jetifier
3. npx jetify
4. npx react-native run-android (your app should correctly compile and work)
5. Call npx jetify run in the postinstall target of your package.json (Any time your dependencies update you have to jetify again)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM