Skip to content
This repository has been archived by the owner on Nov 25, 2023. It is now read-only.

Simple getting started tutorial #39

Open
karussell opened this issue Feb 11, 2019 · 11 comments
Open

Simple getting started tutorial #39

karussell opened this issue Feb 11, 2019 · 11 comments
Assignees

Comments

@karussell
Copy link
Member

karussell commented Feb 11, 2019

See the tutorial here. Here we collect some of the issues.

  • The sonatype snapshort repo is missing in build.gradle under "allprojects": maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
  • the emulator does not seem to work
  • Under linux I get
com.android.ddmlib.AdbCommandRejectedException: insufficient permissions for device: user in plugdev group; are your udev rules wrong?
 See [http://developer.android.com/tools/device.html] for more information
 Error while Installing APK
@karussell karussell self-assigned this Feb 11, 2019
@karussell
Copy link
Member Author

karussell commented Feb 11, 2019

I fixed the linux problem via:

sudo apt-get install adb
sudo adb kill-server
sudo adb start-server
# now reconnecting the device

@boldtrn
Copy link
Member

boldtrn commented Feb 11, 2019

the emulator does not seem to work

Yes, I usually a hardware device to run it. I only had bad experiences with the emulator (also in other projects).

@ahamed-musthafa
Copy link

ahamed-musthafa commented Feb 12, 2019

I'm getting below error while building the project. Can you please take a look?

ERROR: Failed to resolve: com.graphhopper:graphhopper-navigation-android-ui:0.1.0-SNAPSHOT
Affected Modules: app

=====
Executing tasks: [assemble]

:app:buildInfoDebugLoader
:app:checkDebugClasspath FAILED
:app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find com.graphhopper:graphhopper-navigation-android-ui:0.1.0-SNAPSHOT.
  Searched in the following locations:
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/maven-metadata.xml
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.pom
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.jar
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/google/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/maven-metadata.xml
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/google/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.pom
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/google/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.jar
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/android/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/maven-metadata.xml
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/android/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.pom
      file:/Users/ahamed.musthafa/Library/Android/sdk/extras/android/m2repository/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.jar
      https://dl.google.com/dl/android/maven2/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/maven-metadata.xml
      https://dl.google.com/dl/android/maven2/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.pom
      https://dl.google.com/dl/android/maven2/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.jar
      https://jcenter.bintray.com/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/maven-metadata.xml
      https://jcenter.bintray.com/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.pom
      https://jcenter.bintray.com/com/graphhopper/graphhopper-navigation-android-ui/0.1.0-SNAPSHOT/graphhopper-navigation-android-ui-0.1.0-SNAPSHOT.jar
  Required by:
      project :app

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
3 actionable tasks: 3 executed
=====

@boldtrn
Copy link
Member

boldtrn commented Feb 12, 2019

You should be able to fix this by adding maven { url "https://oss.sonatype.org/content/repositories/snapshots" } in a new line here.

@ahamed-musthafa
Copy link

Excellent, it works! Thanks a lot for super quick response.

@karussell
Copy link
Member Author

There is issue #27 happening for me when installing this from IDE. @boldtrn you said

For now this is fixed by passing the gh key as Mapbox key to the Navigation SDK

Can you outline where exactly the change is necessary?

@mapotu26
Copy link

When trying to clone the project, I get an error in the "Events" section of Android Studio once installed. The error is: "Cannot run Git". File not found:git.exe. Please help :) I copied the link and rewrote it myself and still the same error
Android Studio error

@boldtrn
Copy link
Member

boldtrn commented Mar 25, 2019

@mapotu26 you will need to install git. This seems completely unrelated to this project. For relevant question, please let us know in our forum.

@DakastaKay
Copy link

DakastaKay commented Jul 18, 2019

in the README.md is says:

Note: while it's possible to use raster tiles, we recommend vector tiles for mobile applications.

But in the tutorial it does not mention it.

Is there a way to use raster tiles like https://a.tile.openstreetmap.org/${z}/${x}/${y}.png ?

edit:
i guess it should work something like:
adding a style.json to assets with following content:
{ "version": 8, "sources": { "raster-tiles": { "type": "raster", "tiles": ["https://a.tile.openstreetmap.org/${z}/${x}/${y}.png "], "tileSize": 256 } }, "layers": [{ "id": "simple-tiles", "type": "raster", "source": "raster-tiles", "minzoom": 0, "maxzoom": 22 } ] }

and than setting in developer-config.xml
<string name="map_view_styleUrl" translatable="false">file:///android_asset/style.json</string>

but i get the error

loading style failed:

and no tiles are loaded

@boldtrn
Copy link
Member

boldtrn commented Jul 24, 2019

Something like this should work:

style: {
"version": 8,
"sources": {
"raster-tiles": {
"type": "raster",
"tiles": ["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg"],
"tileSize": 256,
"attribution": 'Map tiles by <a target="_top" rel="noopener" href="http://stamen.com">Stamen Design</a>, under <a target="_top" rel="noopener" href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a target="_top" rel="noopener" href="http://openstreetmap.org">OpenStreetMap</a>, under <a target="_top" rel="noopener" href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'
}
},
"layers": [{
"id": "simple-tiles",
"type": "raster",
"source": "raster-tiles",
"minzoom": 0,
"maxzoom": 22
}]
}

@DakastaKay
Copy link

DakastaKay commented Jul 24, 2019

Something like this should work:

style: {
"version": 8,
"sources": {
"raster-tiles": {
"type": "raster",
"tiles": ["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg"],
"tileSize": 256,
"attribution": 'Map tiles by <a target="_top" rel="noopener" href="http://stamen.com">Stamen Design</a>, under <a target="_top" rel="noopener" href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a target="_top" rel="noopener" href="http://openstreetmap.org">OpenStreetMap</a>, under <a target="_top" rel="noopener" href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'
}
},
"layers": [{
"id": "simple-tiles",
"type": "raster",
"source": "raster-tiles",
"minzoom": 0,
"maxzoom": 22
}]
}

Thank you for your input. It seems like the only difference to mine is the attributions line. I tested it and it still doesn't work. Any other suggestions? Thanks.

edit:

I tested some more and i get it to work with the url like:
"tiles": ["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg"],
and attribution like:
"attribution": "Map tiles by <a target=\"_top\" rel=\"noopener\" href=\"http://stamen.com\">Stamen Design</a>, under <a target=\"_top\" rel=\"noopener\" href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a>. Data by <a target=\"_top\" rel=\"noopener\" href=\"http://openstreetmap.org\">OpenStreetMap</a>, under <a target=\"_top\" rel=\"noopener\" href=\"http://creativecommons.org/licenses/by-sa/3.0\">CC BY SA</a>"
but only with the style.json on an external source on a web-server and not as asset with a url: file:///android_asset/style.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants