【问题标题】:What is the meaning of -r in the command line of npx jetify -rnpx jetify -r 命令行中的-r是什么意思
【发布时间】:2021-06-02 23:24:50
【问题描述】:

npx jetify -r命令行中的-r是什么

我需要知道 npx jetify -r 有什么作用?

我在 package.json 中设置了一个脚本为

postinstall: npx jetify -r

注意:我使用的是最新的 react-native (0.63)

但它已通过所有本地构建。但在应用圈的云构建中却失败了。

我需要解决以下问题

    node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/RNCalendarEvents.java:104: error: cannot find symbol
    
            int writePermission = ContextCompat.checkSelfPermission(reactContext, Manifest.permission.WRITE_CALENDAR)
node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/RNCalendarEvents.java:13: error: package android.support.v4.content does not exist

import android.support.v4.content.ContextCompat;

【问题讨论】:

    标签: android react-native androidx npx android-jetifier


    【解决方案1】:

    -r 表示reverse mode

    什么reverse mode

    您还不能迁移到 AndroidX,但库已使用 AndroidX 迁移和发布

    【讨论】:

    • 我没有得到你。所以我已经在 react-native 0.63.0.但是出现了一些问题,所以我添加了npx jetify -r。所以我只需要运行 npx jetify 而不是 npx jetify -r。我说的对吗?
    • @sejn 您是否尝试安装依赖项并遇到问题?如果是,什么依赖项..因为如果你使用 npx react-native init 创建 RN 项目,你可以在 gradle.properties 进行检查。应该是 androidX = true。 CMIIW
    • 所以如果我在 android x 中创建一个新项目 npx 。我不需要运行 npx jetify -r。我是对的吗? gradle 属性也会显示 AndroidX = true。
    • 问题已修复。在最新的 react-native 中删除 -r 后它可以工作
    猜你喜欢
    • 1970-01-01
    • 2016-05-08
    • 2011-01-22
    • 1970-01-01
    • 2022-01-21
    • 1970-01-01
    • 2012-09-06
    • 1970-01-01
    • 2013-09-24
    相关资源
    最近更新 更多