被 Deepseek R1 绕了一个小时 😵‍💫

事情起因:

我在学习 react native,打 android 的 debug 包出来装上发现必须要连一个 metro 服务,就想着让 deepseek 给我看看

Deepseek R1 绕圈圈:

结果这个 deepseek R1 倒好,给我好一顿绕,先是告诉我在 app/build.gradle 里这么写

project.ext.react = [
    bundleInDebug: true,  // 自动在 Debug 构建时生成 Bundle
    devDisabledInDebug: false
]

一绕

然后我觉得还是发给他 app/build.gradle 文件让他看看先,然后他 话锋一转 告诉我应该这么写 :face_with_spiral_eyes:

react {
    // 添加以下配置
    bundleInDebug = true          // Debug 模式下生成 JS Bundle
    devDisabledInDebug = true     // 关闭开发模式(禁用红屏警告、开发者菜单)
}

一运行,报错了,这个属性不存在。。。

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not set unknown property 'bundleInDebug' for extension 'react' of type com.facebook.react.ReactExtension.

二绕

发错误信息给 deepseek R1,它来一个 话锋回转 告诉我该回去:face_with_spiral_eyes:

project.ext.react = [
    bundleInDebug: true,      // Debug 模式下生成 JS Bundle
    devDisabledInDebug: true  // 关闭开发模式
]

一运行,报错了,告诉我这是老式配置方式应该用新的。。。:face_with_spiral_eyes:

ERROR: Using old project.ext.react configuration.
We identified that your project is using a old configuration block as:

project.ext.react = [
    // ...
]

You should migrate to the new configuration:

react {
    // ...
}

三绕

再发给 deepseek R1,它 话锋再转 告诉我这么写。。。:face_with_spiral_eyes:

react {
    // 核心配置
    entryFile = file("../index.js")              // 入口文件路径
    bundleInDebug.set(true)                     // Debug 模式下生成 JS Bundle
    devDisabledInDebug.set(true)                // 关闭开发模式功能
    enableHermes.set(true)                      // 启用 Hermes 引擎(如果已配置)

我也不懂啊,反正我就是个抄 :crazy_face:
再运行,果然报错了,属性就不存在嘛,再变调用方式也不会让它变出来嘛。。。:face_with_spiral_eyes:

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not set unknown property 'bundleInDebug' for extension 'react' of type com.facebook.react.ReactExtension.

亖绕

继续把错误信息发给它,我就是个 辅助 AI 编程 :crazy_face:
然后来了个新的写法,涨了点记性,不在用那个不存在的属性了哦

react {
    // 新版本配置方式(替代 bundleInDebug/devDisabledInDebug)
    bundleConfig."debug" {          // 针对 Debug 构建类型的配置
        bundle = true               // 强制生成 JS Bundle
        dev = false                 // 关闭开发模式(等效于 devDisabledInDebug)
    }
    // 可选:其他构建类型配置(如 release)
    bundleConfig."release" {
        bundle = true
        dev = false
    }

拿去运行一下,又又又又报错了 :face_with_spiral_eyes:

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method bundleConfig() for arguments [build_8fik7m2gxw2dvzjbowzgjtn2a$_run_closure1$_closure4@2ecd0462] on extension 'react' of type com.facebook.react.ReactExtension.

正绕

再把错误信息给他,来了个这。。。:face_with_spiral_eyes:
我寻思虽然我是 辅助 AI 编程 ,但我也不傻啊,这不一样的么。。。

react {
    // 基础配置
    entryFile = file("../index.js")
    hermesCommand = "../../node_modules/hermes-engine/%OS-BIN%/hermesc"
    codegenDir = file("../../node_modules/@react-native/codegen")

    // 构建类型配置
    bundleConfig {
        "debug" {
            bundle = true      // 生成 JS Bundle
            dev = false        // 关闭开发模式
            minify = false     // 不启用代码压缩(Debug 模式通常不需要)
        }
        "release" {
            bundle = true
            dev = false
            minify = true      // 启用代码压缩(Release 模式推荐)
        }
    }

直接告诉他换一种,他就给我来了个,我寻思这应该也不对吧?怎么都不区分 debug 和 release 了?

react {
    // JS Bundle 控制
    jsBundle = "index"     // 必须明确指定 Bundle 名称
    bundle = true          // 全局强制生成 JS Bundle
    dev = false            // 关闭开发模式(等效 devDisabledInDebug)
}

回绕

不过我还是 辅助 AI 编程 贯彻执行,拿去运行一下,果然报错!:angry:
然后告诉 deepseek R1,让它解决
这回倒好,绕回去了

project.ext.react = [
    // JS Bundle 控制
    bundleInDebug: true,          // Debug 模式强制生成 Bundle
    bundleInRelease: true,        // Release 模式强制生成 Bundle
    devDisabledInDebug: true,     // 关闭开发模式
]

绕你个头绕 :upside_down_face:

阿 西 吧,我辅助 AI 编程,你 AI 绕我玩是吧 :angry:
我笨办法搞了再说

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

所以,正确应该怎么搞?:upside_down_face:

1 个赞

AI总是试图把最好的答案给你,如果你把问题描述清楚了,而AI第一次给出的答案解决不了,那你换个问法第二也大概率解决不了,第二次都解决不了基本上可以确定第10次也解决不来哦。所以建议2轮对话都搞不掉问题就换个AI,第2个AI也解决不了的,就准备好自己动手吧 :rofl:

差不多日常使用也发现这些问题了,推理类型的模型感觉适合的场景是模糊的,上下文太多的这种比如说编码还是传统模型强一点,编码日常还是用的4o :grimacing:

所以有佬友知道正确应该怎么写么?:eyes:

DS R1 有严重的嘴硬综合症和路径依赖,会坚持一个说法到底,建议重开一个新对话?

1 个赞

其实我用的API,这一波下来挺心疼我的token花费的。。。。

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。