Android build error with React Native 0.33
Hi,
With React Native 0.33, I get the following error when I try to build my app for Android:
:react-native-permissions:compileReleaseJavaWithJavac
/Users/mvila/Projects/enchante-app/node_modules/react-native-permissions/android/src/main/java/com/joshblour/reactnativepermissions/ReactNativePermissionsModule.java:82: error: method requestPermission in class PermissionsModule cannot be applied to given types;
mPermissionsModule.requestPermission(permission, new Callback() {
^
required: String,Promise
found: String,<anonymous Callback>,<null>
reason: actual and formal argument lists differ in length
1 error
:react-native-permissions:compileReleaseJavaWithJavac FAILED
I guess there is a breaking change in 0.33.
Same issue
I am not good in Java so I don't want to make a pull request but here is my attempt to fix the issue:
https://github.com/mvila/react-native-permissions/commit/8a9e81543e33f7f2f3b5ac8ed62ab693a618a685
Hope this helps.
@mvila that solution looks good. Would you mind submitting a PR?
@yonahforst Okay, here it is: #34
merged, thanks!
did this publish to npm registry?
@lotosbin I don't think it did. Ran npm install --save react-native-permissions but am still getting the above error
I installed today and I am having the exactly same error message. Using: react-native: 0.31
just published 0.2.5 to npm
I am using react-native 0.32 and must use react-native-permissions-0.2.4, 0.2.5 does not work. So I guess you have to choose depending on your RN version:
react-native >= 0.33 --> react-native-permissions >= 0.2.5 react-native < 0.33 ---> react-native-permissions 0.2.4