Estimote / react-native-proximity

React Native wrapper for Estimote Proximity SDK
Apache License 2.0
61 stars 38 forks source link

Android build fails(constructor Builder in class Builder cannot be applied to given types) #33

Closed saadmutahar closed 5 years ago

saadmutahar commented 5 years ago

I am using Estimote/react-native-proximity. I am able to run and configure in iOS perfectly. But got issues in android.

Below is the terminal error.

estimote

I am using following. @estimote/react-native-proximity: "^0.4.1", react: ^16.3.1, react-native: "0.55.2, implementation "com.android.support:appcompat-v7:27.0.2"

Any help would be highly appreciated. Thanks

saadmutahar commented 5 years ago

Dear @heypiotr can you please help me out on this? Thank you.

heypiotr commented 5 years ago

It looks like your support-compat library is too old. This plugin requires 26.1.0 or later, which is when the second argument was added to the NotificationCompat.Builder constructor, the channelId string.

Which is weird, because you say you're using 27.0.2:

I am using following. @estimote/react-native-proximity: "^0.4.1", react: ^16.3.1, react-native: "0.55.2, implementation "com.android.support:appcompat-v7:27.0.2"

Maybe something else in your project downgrades this library? Can you run the app:dependencies gradle task and paste the output from the debugCompileClasspath section?

saadmutahar commented 5 years ago

Hello @heypiotr I attached below the link of debugCompileClasspath via gist git.

https://gist.github.com/saadmutahar/8e91e0cb3868654fc01a65f772d2c623

I see that two libraries react-native-toast and react-native-touch-id are downgraded the support-compat library. And I tried to upgrade the version of suppport-compat in these two libraries but still nothing better.

Thank you.

heypiotr commented 5 years ago

As far as gradle goes, it looks like you should be good:

+--- com.android.support:support-compat:{strictly 27.1.1} -> 27.1.1 (c)

Which makes me confused as for why it still doesn't work for you. Have you tried clean build?

saadmutahar commented 5 years ago

Yes I tried to clean many times, and the above error was gone But now zone.onEnterAction not fired in android when beacon is in range. Everything is good in iOS. I also update the react -native version to 0.56. Edit: react-native-push-notification uses this version 27.1.1 of support- appcompat.

heypiotr commented 5 years ago

So the build error is gone? I'll close this issue then. (Summary for any future reference: make sure support-compat (supportLibVersion) is 26.1.0 or later, and that no other dependencies are downgrading it.)

Can you open a new one for the onEnterAction not working, and share more details? Relevant code snippets, logs = output from adb logcat, the model of the device you're using, Android OS version, etc.