nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 699 forks source link

Could not determine the dependencies of ':app:preDebugBuild'. #1618

Closed louisnot closed 5 years ago

louisnot commented 5 years ago

Hello, I tried again to install mapbox on my react native project with android. So as I was told I did not use npm to install package but just put "@mapbox/react-native-mapbox-gl": "nitaliano/react-native-mapbox-gl#master" under dependencies in package.json and then I followed the instruction of android guide.

However when I try to start the server with react-native run-android I get this error: FAILURE: Build failed with an exception.

I might be too much of a beginner to understand what's the issue.

ferdicus commented 5 years ago

hey @louisnot, yes that was a shortcoming of the installation steps within the README (which was fixed). What you posted "@mapbox/react-native-mapbox-gl": "nitaliano/react-native-mapbox-gl#master" within your package.json should work.

Can you please make sure, that the linking was successful? See here: https://github.com/nitaliano/react-native-mapbox-gl/blob/master/android/install.md

louisnot commented 5 years ago

Hello @ferdicus thanks for your fast reply what do you mean by make sure that the linking was successful? Sorry I m kinda new to this stuff...

ferdicus commented 5 years ago

hey @louisnot, please make sure to read this: https://stackoverflow.com/a/54764060/1892871 Then afterwards go through the link I posted in the previous comment.

Basically you have to make sure that the native dependencies for the platform you are using are set up correctly and thus can be used in JS World.

louisnot commented 5 years ago

@ferdicus All right so I tried to do react-native link and it says No package found. "Are you sure this is a react-native project?" Do I need to do npm install "@mapbox/react-native-mapbox-gl": "nitaliano/react-native-mapbox-gl#master"?

ferdicus commented 5 years ago

Sorry, but did you follow the steps within the README and the link I've posted earlier?

The stackoverflow answer states:

When do I run link?

You only run it after you have installed your dependency.  
I would recommend running it just after you have installed the dependency.  
You should then check to make sure that it works,  
before installing any new dependencies so that you can easily debug. 

So yeah: 1) install 2) link 3) go through the install guide for android and make sure the linking did what it's supposed to do

louisnot commented 5 years ago

Hello, finally it worked :) Thanks a lot for your help man you were really helpful!

Lastly is there a code I can find that basically show the map?

Thanks again!

ferdicus commented 5 years ago

Glad it worked out. Yes, there most certainly is!

There is a Getting Started guide over on the new repo, simply replace the references from "@react-native-mapbox/maps" to "@mapbox/react-native-mapbox-gl" in there and you should be good to go:

https://github.com/react-native-mapbox/maps/blob/master/docs/GettingStarted.md

newtonEMC2 commented 4 years ago

in your build.gradle file add www to maven { url 'https://jitpack.io' } so that it ends up being maven { url 'https://www.jitpack.io' }