我正在使用 frommapforgs
但是当我运行 app 时出现以下错误:
java.lang.NoClassDefFoundError: org.mapsforge.map.android.view.MapView
at com.example.asheq.locationappandroid_1.MapOfflineActivity.onCreate(MapOfflineActivity.java:69)
at android.app.Activity.performCreate(Activity.java:5236)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2178)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264)
at android.app.ActivityThread.access$600(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1259)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5148)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
贝娄是我的毕业生:
apply plugin: 'com.android.application'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
multiDexEnabled true
applicationId "com.locationappandroid_1"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.google.android.gms:play-services-base:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
testCompile 'junit:junit:4.12'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.1'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.google.maps.android:android-maps-utils:0.4+'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.jjoe64:graphview:4.0.1'
compile(group: 'com.graphhopper', name: 'graphhopper', version: '0.4.1') {
exclude group: 'com.google.protobuf', module: 'protobuf-java'
exclude group: 'org.openstreetmap.osmosis', module: 'osmosis-osm-binary'
exclude group: 'org.apache.xmlgraphics', module: 'xmlgraphics-commons'
}
compile group: 'org.mapsforge', name: 'mapsforge-core', version: '0.5.0'
compile group: 'org.mapsforge', name: 'mapsforge-map', version: '0.5.0'
compile group: 'org.mapsforge', name: 'mapsforge-map-android', version: '0.5.0'
compile group: 'org.mapsforge', name: 'mapsforge-map-reader', version: '0.5.0'
compile group: 'org.slf4j', name: 'slf4j-android', version: '1.7.10'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.10'
}