FairyLandM's Blog

  • 首页
  • 文章归档
  • 默认分类
  • 关于页面

  • 搜索
linux docker vue vue,lunix,docker

react-native 无法打release包

发表于 2021-02-08 | 分类于 react-native | 0 | 阅读次数 100

底层项目与rn项目是分开的,也就是先存在项目然后集成的react-native

错误如下:

另一程序已锁定文件的一部分,进程无法访问。

打开react-native项目,找到node_modules\react-native\react.gradle文件

修改reactRoot,entryFile,inputExcludes等变量的路径

entryFile 中的index.android.js可能需要修改成为index.js
根据你文件名来选择是否需要修改

注意此时的两个文件夹同级

def cliPath = config.cliPath ?: "node_modules/react-native/cli.js"
def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
def entryFile = config.entryFile ?: "index.js"
def bundleCommand = config.bundleCommand ?: "bundle"
def reactRoot = file(config.root ?: "../../severallessons-rn/")
def inputExcludes = config.inputExcludes ?: ["../severallessons-android/**", "ios/**"]
def bundleConfig = config.bundleConfig ? "${reactRoot}/${config.bundleConfig}" : null ;

重复资源(同文件加入)

   doLast {
          def moveFunc = { resSuffix ->
          File originalDir = file("$buildDir/generated/res/react/release/drawable-${resSuffix}");
          if (originalDir.exists()) {
            File destDir = file("$buildDir/../src/main/res/drawable-${resSuffix}");
            ant.move(file: originalDir, tofile: destDir);
          }
     }
    moveFunc.curry("ldpi").call()
    moveFunc.curry("mdpi").call()
    moveFunc.curry("hdpi").call()
    moveFunc.curry("xhdpi").call()
    moveFunc.curry("xxhdpi").call()
    moveFunc.curry("xxxhdpi").call()
}

  • 本文作者: FairyLandM
  • 本文链接: https://slogc.cc/archives/react-native-wu-fa-da-release-bao
  • 版权声明: 本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0 许可协议。转载请注明出处!
# linux # docker # vue # vue,lunix,docker
docker部署vue 到linux
  • 文章目录
  • 站点概览
FairyLandM

FairyLandM

既然选择了远方,便只顾风雨兼程!

3 日志
3 分类
4 标签
RSS
Creative Commons
© 2021 FairyLandM
由 Halo 强力驱动
|
主题 - NexT.Pisces v5.1.4