【问题标题】:gradlew assembleRelease it gives the following error in react-nativegradlew assembleRelease 它在 react-native 中给出以下错误
【发布时间】:2020-03-06 09:57:58
【问题描述】:

我想制作我的应用程序代码的 apk 文件,但每当我运行 gradlew assembleRelease 时,它都会出现以下错误,我只想用任何东西创建构建,因为我必须交付我的周一的项目。任何帮助将不胜感激

 C:\Users\dines\Documents\ANUJ\managementportal\android>gradlew assembleRelease
    :ReactNative:Unexpected empty result of running '[node, undefined, config]' command.
    :ReactNative:Running '[node, undefined, config]' command failed.

    FAILURE: Build failed with an exception.

    * Where:
    Script 'C:\Users\dines\Documents\ANUJ\managementportal\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 170

    * What went wrong:
    A problem occurred evaluating script.
    > internal/modules/cjs/loader.js:584    throw err;    ^Error: Cannot find module 'C:\Users\dines\Documents\ANUJ\managementportal\android\undefined'    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)    at Function.Module._load (internal/modules/cjs/loader.js:508:25)    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)    at startup (internal/bootstrap/node.js:283:19)    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 2s

    C:\Users\dines\Documents\ANUJ\managementportal\android>

【问题讨论】:

  • 查看solution
  • 对不起,我无法理解,请您在回答中解释一下吗?

标签: android react-native apk


【解决方案1】:

执行此步骤:

1) C:\Users\dines\Documents\ANUJ\managementportal> react-native run-android

2) C:\Users\dines\Documents\ANUJ\managementportal> cd android

3) C:\Users\dines\Documents\ANUJ\managementportal\android> ./gradlew assembleRelease

所有流程在获得发布应用后完成

项目文件夹 > android > 应用 > 构建 > 输出 > apk > 发布

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多