There is an error 'finished with non-zero exit value 2' when i was run on android environment. How to solve this problem ?
+1
I think I solved it. If you installed the package with rnpm, follow the steps of Manual Install. You probably only have to edit MainApplication.java to add the include and the package in the getPackages() method.
Then delete node_modules/react-native-share/android/build folder along with android/app/build folder, and run react-native run-android again.
if this is the error you got
Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
I solved it by running this:
cd android && ./gradlew clean
Most helpful comment
if this is the error you got
Execution failed for task ':app:dexDebug'.
I solved it by running this:
cd android && ./gradlew clean