android– 在react-native中创建apk时出错

android– 在react-native中创建apk时出错,第1张

概述错误是—>任务’:app:processReleaseResources’的执行失败.我按照文档Generatesignedapk生成apk.当我发出命令cdandroid&&./gradlewassembleRelease然后我收到了这个错误.我的build.grade文件是—>`applyplugin:"com.android.application"importcom.android.build.O

错误是—>任务’:app:processReleaseResources’的执行失败.

我按照文档Generate signed apk

生成apk.当我发出命令cd androID&& ./gradlew assembleRelease然后我收到了这个错误.

我的build.grade文件是—>

`

apply plugin: "com.androID.application"import com.androID.build.Outputfileproject.ext.react = [    entryfile: "index.Js"]apply from: "../../node_modules/react-native/react.gradle"def enableSeparateBuildPercpuArchitecture = falsedef enableProguardInReleaseBuilds = falseandroID {    compileSdkVersion 25    buildToolsversion '25.0.3'    defaultConfig {        applicationID "com.newsapp"        minSdkVersion 16        targetSdkVersion 25        versionCode 1        versionname "1.0"        ndk {            abiFilters "armeabi-v7a", "x86"        }    }    splits {        abi {            reset()            enable enableSeparateBuildPercpuArchitecture            universalApk false  // If true, also generate a universal APK            include "armeabi-v7a", "x86"        }    }    signingConfigs {         release {             if (project.hasProperty('MYAPP_RELEASE_STORE_file')) {                 storefile file(MYAPP_RELEASE_STORE_file)                 storePassword MYAPP_RELEASE_STORE_PASSWORD                 keyAlias MYAPP_RELEASE_KEY_AliAS                 keyPassword MYAPP_RELEASE_KEY_PASSWORD             }         }     }    buildTypes {        release {            MinifyEnabled enableProguardInReleaseBuilds            proguardfiles getDefaultProguardfile("proguard-androID.txt"), "proguard-rules.pro"            signingConfig signingConfigs.release        }    }    // applicationVariants are e.g. deBUG, release    applicationVariants.all { variant ->        variant.outputs.each { output ->            // For each separate APK per architecture, set a unique version code as described here:            // http://tools.androID.com/tech-docs/new-build-system/user-guIDe/apk-splits            def versionCodes = ["armeabi-v7a":1, "x86":2]            def abi = output.getFilter(Outputfile.ABI)            if (abi != null) {  // null for the universal-deBUG, universal-release variants                output.versionCodeOverrIDe =                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode            }        }    }}dependencIEs {    compile project(':react-native-vector-icons')    compile project(':react-native-linear-gradIEnt')    compile project(':react-native-photo-vIEw')    compile project(':react-native-linear-gradIEnt')    compile project(':react-native-vector-icons')    compile project(':react-native-vector-icons')    compile project(':react-native-linear-gradIEnt')    compile project(':react-native-photo-vIEw')    compile project(':react-native-linear-gradIEnt')    compile project(':react-native-vector-icons')    compile filetree(dir: "libs", include: ["*.jar"])    compile "com.androID.support:appcompat-v7:23.0.1"    compile "com.facebook.react:react-native:+"  // From node_modules}// Run this once to be able to run the application with BUCK// puts all compile dependencIEs into folder libs for BUCK to usetask copyDownloadableDepsTolibs(type: copy) {    from configurations.compile    into 'libs'}` 

请帮我解决这个问题.我可以在调试模式下运行我的应用程序,但我无法生成realease apk.

解决方法:

我解决了这个问题.

问题在于反应导航模块.使用最新版本的gradle,它无法在react-navigation文件夹中编译图像.所以我删除了图像并运行命令然后它工作.

这个doc帮助我解决了这个问题.

Link

总结

以上是内存溢出为你收集整理的android – 在react-native中创建apk时出错全部内容,希望文章能够帮你解决android – 在react-native中创建apk时出错所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1116725.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存