其他分享
首页 > 其他分享> > react-native 0.58版本打包图片问题 task ':app:mergeReleaseResources' Error: Duplicate resources

react-native 0.58版本打包图片问题 task ':app:mergeReleaseResources' Error: Duplicate resources

作者:互联网

debug没问题,在生成正式apk的时候就如下:

google了一下在github上找到了解决方案:

github问题指向

在node_modules/react-native/react.gradle   

修改为

 

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()
}

 

标签:task,mergeReleaseResources,app,react,originalDir,call,file,curry,moveFunc
来源: https://www.cnblogs.com/pengkun06Gmail/p/10373761.html