Getting “verifyReleaseResources” error after upgrading React Native

前端 未结 4 1167
迷失自我
迷失自我 2021-01-03 18:28

I\'m trying to upgrade an application to React Native 0.57.1. I think I\'ve followed all the steps, upgraded all the right files, yet I\'m still getting an error that I cann

相关标签:
4条回答
  • 2021-01-03 18:35

    You need to add following code in your project's android/build.gradle:

    subprojects {
        afterEvaluate {project ->
            if (project.hasProperty("android")) {
                android {
                    compileSdkVersion 27
                    buildToolsVersion "27.0.2"
                }
            }
        }
    }
    
    0 讨论(0)
  • 2021-01-03 18:43

    Reason for the error:

    You have installed react-native-document-picker as a dependency, And the reason for this error is that the configurations of your android/app/build.gradle and node_modules/react-native-document-picker/android/build.gradle mismatch.

    Solution

    1. Navigate to node_modules/react-native-document-picker/android/build.gradle
    2. Edit and keep the compileSdkVersion buildToolsVersion minSdkVersion targetSdkVersion same as you have in android/app/build.gradle
    3. Sync the project again.
    4. Run ./gradlew assembleRelease from the terminal.
    0 讨论(0)
  • 2021-01-03 18:51

    For me, what fixed the issue was prefixing with app

    ./gradlew app:assembleRelease
    
    0 讨论(0)
  • 2021-01-03 18:57

    Had another reason for this issue, I had previously modified minSdkVersion. All you need to do is to remove /node_modules/ folder, /android/build and /android/app/build folders, re npm install and perform ./gradlew assembleRelease again.

    0 讨论(0)
提交回复
热议问题