danshannon / javastravav3api

Strava API v3 implementation written in Java v8
http://danshannon.github.io/javastravav3api/
81 stars 44 forks source link

java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/management/ManagementFactory; #200

Open mudebbela opened 1 year ago

mudebbela commented 1 year ago

im simply trying to get the accessToken as described in your readme and i am getting this error. am I missing something in the implementation?

java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/management/ManagementFactory; at org.apache.commons.jcs.engine.control.CompositeCacheManager.initialize(CompositeCacheManager.java:266) at org.apache.commons.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:185) at org.apache.commons.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:161) at org.apache.commons.jcs.JCS.getCacheManager(JCS.java:156) at org.apache.commons.jcs.JCS.getGroupCacheInstance(JCS.java:219) at javastrava.cache.impl.StravaCacheImpl.<init>(StravaCacheImpl.java:47) at javastrava.service.impl.ActivityServiceImpl.<init>(ActivityServiceImpl.java:96) at javastrava.service.impl.ActivityServiceImpl.instance(ActivityServiceImpl.java:60) at javastrava.auth.model.Token.addServiceInstances(Token.java:130) at javastrava.auth.model.Token.<init>(Token.java:125) at com.example.beers4miles.Strava.authorize(Strava.java:38) at com.example.beers4miles.BeerActivity$1.run(BeerActivity.java:79) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.management.ManagementFactory" on path: DexPathList[[zip file "/data/app/com.example.beers4miles-o7ulMppE32aJniDmnOBmYg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.beers4miles-o7ulMppE32aJniDmnOBmYg==/lib/arm64, /system/lib64, /system/vendor/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at org.apache.commons.jcs.engine.control.CompositeCacheManager.initialize(CompositeCacheManager.java:266)  at org.apache.commons.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:185)  at org.apache.commons.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:161)  at org.apache.commons.jcs.JCS.getCacheManager(JCS.java:156)  at org.apache.commons.jcs.JCS.getGroupCacheInstance(JCS.java:219)  at javastrava.cache.impl.StravaCacheImpl.<init>(StravaCacheImpl.java:47)  at javastrava.service.impl.ActivityServiceImpl.<init>(ActivityServiceImpl.java:96)  at javastrava.service.impl.ActivityServiceImpl.instance(ActivityServiceImpl.java:60)  at javastrava.auth.model.Token.addServiceInstances(Token.java:130)  at javastrava.auth.model.Token.<init>(Token.java:125)  at com.example.beers4miles.Strava.authorize(Strava.java:38)  at com.example.beers4miles.BeerActivity$1.run(BeerActivity.java:79)  at java.lang.Thread.run(Thread.java:764)