kraffslol / react-native-braintree-xplat

Cross-platform Braintree module for React Native
MIT License
81 stars 121 forks source link

Can't build release APK #95

Closed miguelglz closed 6 years ago

miguelglz commented 6 years ago

I'm following the instructions from the official react native website, but can't get pass the $ ./gradlew assembleRelease step. I fixed some errors but now I get the following when running the command with --info :

> Task :react-native-braintree-xplat:verifyReleaseResources FAILED
Putting task artifact state for task ':react-native-braintree-xplat:verifyReleaseResources' into context took 0.0 secs.
Up-to-date check for task ':react-native-braintree-xplat:verifyReleaseResources' took 0.0 secs. It is not up-to-date because:
  Task has failed previously.
All input files are considered out-of-date for incremental task ':react-native-braintree-xplat:verifyReleaseResources'.
Unable do incremental execution: full task run
QueuedCruncher is using /Users/miguel/Library/Android/sdk/build-tools/27.0.3/aapt

Shutdown finished in 0ms

:react-native-braintree-xplat:verifyReleaseResources (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.7 secs.
:react-native-svg:platformAttrExtractor (Thread[Task worker for ':',5,main]) completed. Took 10.698 secs.
:react-native-vector-icons:platformAttrExtractor (Thread[Daemon worker Thread 23,5,main]) completed. Took 10.461 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-braintree-xplat:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5m 19s
173 actionable tasks: 152 executed, 21 up-to-date

If I run the app directly on debug by executing react-native run-android works fine.

zhenghow93 commented 5 years ago

@miguelglz I'm having the similar problem. Did you manage to resolve this? Only when trying to compile release build then I have this problem, nothing wrong when I am making debug build.

miguelglz commented 5 years ago

@zhenghow93 sorry for the late answer, I hope you already figured out. But for any future reference, what I did was update the build.gradle from the braintree xplat library. Then other libraries showed the same error so I had to manually update the build.gradle file of each library.

This only solved my problem temporary as it will be overwritten if I delete my node_modules folder and run npm install. Or if somebody else clones the project. But at least I was able to build the release apk.

zhenghow93 commented 5 years ago

@miguelglz hi thanks for the reply. In case others may encounter the similar problem, I'll just leave my solution here. What I did was to change the build.gradle of the library in the node_modules to use one version older than the latest braintree sdk. Probably the latest sdk is not compatible with the version of react native that I'm using (0.46.4).

cassmtnr commented 5 years ago

@zhenghow93 Thank you, it helped me with the same error on another dependency.