Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package apk build failed #37

Open
Jeriming opened this issue Dec 26, 2018 · 3 comments
Open

package apk build failed #37

Jeriming opened this issue Dec 26, 2018 · 3 comments

Comments

@Jeriming
Copy link

I use command "gradlew assembleRelease --console plain" build my project get error info:

error: failed linking references.
:react-native-http-cache:verifyReleaseResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-http-cache:verifyReleaseResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

How can I solve this problem? Please give me some advice,Thanks!

environment:
"react": "16.6.3",
"react-native": "0.57.8",
"react-native-http-cache": "^0.2.0",

@Jeriming
Copy link
Author

I've found a solution!
See this link https://github.com/facebook/react-native/issues/19239#issuecomment-425623992

@iplus26
Copy link

iplus26 commented Dec 28, 2018

@Jeriming Where did you add this snippet? I tried $SRCROOT/android/build.gradle but no luck 😢

@iplus26
Copy link

iplus26 commented Dec 28, 2018

Fixed by bump ./android/app/build.gradle version to

// with react native 0.57.8
android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
}

and update all subprojects in ./android/build.gradle

def safeExtGet(prop, fallback) {
      rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion safeExtGet("compileSdkVersion", 26)
                buildToolsVersion safeExtGet("buildToolsVersion", "26.0.1")
            }
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants