MyLocationOverlay

189 views
Skip to first unread message

Евгений Ковтунов

unread,
Apr 27, 2016, 10:21:20 AM4/27/16
to mapsforge-dev
Hi! I need to show current location on the map. When I use code from examples I get a problem with AndroidSupportUtil. This class used in MyLocationOverlayClass. I include in gradle only this dependencies

compile 'org.mapsforge:mapsforge-map-android:0.6.0'
compile 'com.caverock:androidsvg:1.2.2-beta-1'


error: cannot find symbol class AndroidSupportUtil

Emux

unread,
Apr 27, 2016, 1:02:27 PM4/27/16
to mapsfo...@googlegroups.com
You don't necessarily have to use the android-extras module (it's permissions related).
My location overlay can function without it too.

To answer your question, see our integration guide which has all the modules grouped.
That class exists in the mapsforge-map-android-extras artifact.

--
Emux

Евгений Ковтунов

unread,
Apr 27, 2016, 1:27:28 PM4/27/16
to mapsforge-dev
When I add 

compile 'org.mapsforge:mapsforge-map-android-extras:0.6.0'

I get this error: 

Failed to resolve: android.support:compatibility-v4:23.1.1

My gralde dependensies:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'org.mapsforge:mapsforge-map-android:0.6.0'
compile 'com.caverock:androidsvg:1.2.2-beta-1'
    compile 'org.mapsforge:mapsforge-map-android-extras:0.6.0'
}



среда, 27 апреля 2016 г., 20:02:27 UTC+3 пользователь Emux написал:

Emux

unread,
Apr 27, 2016, 1:31:03 PM4/27/16
to mapsfo...@googlegroups.com
Well the message declares what extra you need from Android libs.

e.g. for android support v4 that can be:

compile 'com.android.support:support-v4:23.2.1'

--
Emux

Евгений Ковтунов

unread,
Apr 28, 2016, 9:53:38 AM4/28/16
to mapsforge-dev
I create empty project with minSdkVersion 4. And I only add dependencies to gradle. This is my .gradle file
apply plugin: 'com.android.application'

android {
    compileSdkVersion
23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId
"com.example.my.myapplication"
        minSdkVersion 4
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes
{
        release
{
            minifyEnabled
false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
   
}
}

dependencies
{
    compile fileTree
(dir: 'libs', include: ['*.jar'])
    testCompile
'junit:junit:4.12'
    compile 'com.android.support:support-v4:23.2.1'
    compile 'org.mapsforge:mapsforge-map-android:0.6.0'
    compile 'com.caverock:androidsvg:1.2.2-beta-1'
    compile 'org.mapsforge:mapsforge-map-android-extras:0.6.0'

    //compile 'com.android.support:appcompat-v7:23.3.0'
}

And I get this error again:
Error:Failed to resolve: android.support:compatibility-v4:23.1.1 

Ludwig

unread,
Apr 28, 2016, 10:01:32 AM4/28/16
to mapsfo...@googlegroups.com
We do not support Android SDK version 4.

--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To post to this group, send email to mapsfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mapsforge-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/bfbba76b-d2e1-4b4e-a156-81d1800c1c92%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Евгений Ковтунов

unread,
Apr 28, 2016, 10:32:45 AM4/28/16
to mapsforge-dev
Ok, this is .gradle file with minSdkVersion 19. I get the same error.

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
        applicationId "com.example.my.mymapforge"
minSdkVersion 19
        targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'

Emux

unread,
Apr 28, 2016, 11:09:04 AM4/28/16
to mapsfo...@googlegroups.com
Have you installed with SDK Manager the "Android Support Repository" ?

Also if you have declared the v7 dependency, normally you don't need to declare also the v4, since it's included in v7.

--
Emux

Евгений Ковтунов

unread,
Apr 28, 2016, 11:25:54 AM4/28/16
to mapsforge-dev
I reinstall "Android Support Repository" and "Google Repository" but this don't help.

There another log:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find android.support:compatibility-v4:23.1.1.
     Searched in the following locations:
         file:/home/kovtunov/Android/android-studio/gradle/m2repository/android/support/compatibility-v4/23.1.1/compatibility-v4-23.1.1.pom
         file:/home/kovtunov/Android/android-studio/gradle/m2repository/android/support/compatibility-v4/23.1.1/compatibility-v4-23.1.1.jar
         file:/home/kovtunov/Android/Sdk/extras/android/m2repository/android/support/compatibility-v4/23.1.1/compatibility-v4-23.1.1.pom
         file:/home/kovtunov/Android/Sdk/extras/android/m2repository/android/support/compatibility-v4/23.1.1/compatibility-v4-23.1.1.jar
         file:/home/kovtunov/Android/Sdk/extras/google/m2repository/android/support/compatibility-v4/23.1.1/compatibility-v4-23.1.1.pom
         file:/home/kovtunov/Android/Sdk/extras/google/m2repository/android/support/compatibility-v4/23.1.1/compatibility-v4-23.1.1.jar
     Required by:
         MyApplication9:app:unspecified > org.mapsforge:mapsforge-map-android-extras:0.6.0 

Emux

unread,
Apr 28, 2016, 11:33:57 AM4/28/16
to mapsfo...@googlegroups.com
I copy here a solution posted in another topic:


The problem arises from the mapsforge-map-android-extras dependencies in Maven / jCenter centrals (where is declared differently as jar vs aar).

To overcome that annoyance you can declare it in Gradle as a non transitive dependency:

    compile('org.mapsforge:mapsforge-map-android-extras:0.6.0') {
        transitive = false
    }


If that works I'll update our docs.

--
Emux

Евгений Ковтунов

unread,
Apr 28, 2016, 11:44:54 AM4/28/16
to mapsforge-dev
Yes, this is help, thank you :)

Emux

unread,
Apr 28, 2016, 11:55:24 AM4/28/16
to mapsfo...@googlegroups.com
Thanks for confirm it, I updated our integration doc.

--
Emux
Reply all
Reply to author
Forward
0 new messages