react-native-permissions icon indicating copy to clipboard operation
react-native-permissions copied to clipboard

Android build error with React Native 0.33

Open mvila opened this issue 10 years ago • 10 comments

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.

mvila avatar Sep 10 '16 09:09 mvila

Same issue

ajagesser avatar Sep 12 '16 14:09 ajagesser

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 avatar Sep 14 '16 02:09 mvila

@mvila that solution looks good. Would you mind submitting a PR?

yonahforst avatar Sep 14 '16 08:09 yonahforst

@yonahforst Okay, here it is: #34

mvila avatar Sep 14 '16 08:09 mvila

merged, thanks!

yonahforst avatar Sep 14 '16 14:09 yonahforst

did this publish to npm registry?

lotosbin avatar Sep 19 '16 03:09 lotosbin

@lotosbin I don't think it did. Ran npm install --save react-native-permissions but am still getting the above error

anotherstarburst avatar Sep 20 '16 17:09 anotherstarburst

I installed today and I am having the exactly same error message. Using: react-native: 0.31

StellwagJo avatar Sep 21 '16 12:09 StellwagJo

just published 0.2.5 to npm

yonahforst avatar Sep 21 '16 13:09 yonahforst

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

fkoester avatar Sep 22 '16 12:09 fkoester