I am building a location sharing app in React Native and as such I already have a maps Plugin installed from Github. However, I would like to select contacts to share location with and for that I tried to add react-native-contacts-wrapper plugin.
I added react-native-contacts-wrapper plugin to get contacts, but when I rebuild the project with react-native run-android, i get this error :
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:prepareGeoTagReactNativeContactsWrapperUnspecifi edLibrary'. Failed to create parent directory 'C:\Program Files\Nodejs_projects\GeoTag\and roid\app\build\intermediates\exploded-aar\GeoTag\react-native-contacts-wrapper' when creating directory 'C:\Program Files\Nodejs_projects\GeoTag\android\app\bui ld\intermediates\exploded-aar\GeoTag\react-native-contacts-wrapper\unspecified'
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
What could be the issue :
I am pretty sure its because of multiple plugins (maps and contacts) but I have no idea how to overcome this problem as I want both of them.
I am certain that the error is located in settings.gradle file due to multiple libs as shown below :
rootProject.name = 'GeoTag'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
project(':react-native-contacts-wrapper').projectDir = new File(settingsDir, '../node_modules/react-native-contacts-wrapper/android/app')
What I have done to solve this :
- Create a new dummy project and implements this contacts plugin, and to my surprise, it worked
- I tried to replicate the same in my original project and i still cant get it to build
- Changing permissions to the entire project folder (not sure if this helps)
The Contacts Plugin works in a project without any other plugins but when used in a project with other plugins, it doesn't, so its clear that the problem is due to conflict between the two. I have no idea how to go about multiple plugin issues and thus this question.
Let me know if you need the code to test in your systems. Thank you for reading.
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered