java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/maps/GeoPoint -
i'm trying latitude , longitude address through method:-
public geopoint getlocationfromaddress(string straddress){ geocoder coder = new geocoder(this); list<address> address; geopoint p1 = null; try { address = coder.getfromlocationname(straddress,5); if (address==null) { return null; } address location=address.get(0); location.getlatitude(); location.getlongitude(); p1 = new geopoint((int) (location.getlatitude() * 1e6), (int) (location.getlongitude() * 1e6)); return p1; } catch (ioexception e) { e.printstacktrace(); } return null; }
but got error:-
java.lang.noclassdeffounderror: failed resolution of: lcom/google/android/maps/geopoint
what missing here?
my full error:-
process: breamex.happy_week_end, pid: 22803 java.lang.noclassdeffounderror: failed resolution of: lcom/google/android/maps/geopoint; @ breamex.happy_week_end.search.searchactivity.getlocationfromaddress(searchactivity.java:439) @ breamex.happy_week_end.search.searchactivity.search(searchactivity.java:357) @ breamex.happy_week_end.search.searchactivity.access$000(searchactivity.java:76) @ breamex.happy_week_end.search.searchactivity$1.onclick(searchactivity.java:189) @ android.view.view.performclick(view.java:5610) @ android.view.view$performclick.run(view.java:22265) @ android.os.handler.handlecallback(handler.java:751) @ android.os.handler.dispatchmessage(handler.java:95) @ android.os.looper.loop(looper.java:154) @ android.app.activitythread.main(activitythread.java:6077) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:865) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:755) caused by: java.lang.classnotfoundexception: didn't find class "com.google.android.maps.geopoint" on path: dexpathlist[[zip file "/data/app
my full gradle:-
apply plugin: 'com.android.application' android { compilesdkversion 'google inc.:google apis:24' buildtoolsversion '25.0.3' defaultconfig { applicationid "app" minsdkversion 15 targetsdkversion 26 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" vectordrawables.usesupportlibrary = true } 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 project(':stepper') compile project(':slider') compile 'com.android.support:appcompat-v7:26.+' compile 'com.android.support:design:26.+' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.google.firebase:firebase-messaging:10.2.0' compile 'org.greenrobot:eventbus:3.0.0' compile 'com.facebook.android:facebook-android-sdk:4.22.0' compile 'com.mcxiaoke.volley:library-aar:1.0.0' compile 'com.google.android.gms:play-services:10.2.0' compile 'com.google.android.gms:play-services-maps:10.2.0' compile 'com.google.android.gms:play-services-auth:10.2.0' compile 'com.google.firebase:firebase-auth:10.2.0' compile 'com.android.support:support-v4:26.+' compile 'com.github.bumptech.glide:glide:4.0.0-rc1' compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.jakewharton:butterknife:8.6.0' testcompile 'junit:junit:4.12' } apply plugin: 'com.google.gms.google-services'
you have include multidex in application. see below error in error log.
classnotfoundexception: didn't find class "com.google.android.maps.geopoint" on path: dexpathlist[[zip file "/data/app
add dependencies.
compile 'com.android.support:multidex:1.0.1'
in gradle add multidexenabled true
android { defaultconfig { ... minsdkversion 21 targetsdkversion 26 multidexenabled true // add line } ... }
in manifest add multidex application class.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myapp"> <application android:name="android.support.multidex.multidexapplication" > ... </application> </manifest>
then clean , rebuild project.
hope hleps:)
Comments
Post a Comment