trouble using HERE Mobile SDK UI Kit - android

I am trying to implement new HERE Mobile SDK UI Kit for Android but with no luck.
did everything described in Quickstart text file inside uikit-android-release-1.0.0-78. During gradle compiling
there is no error only when application launched. Pasting logcat errors.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2702)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2767)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
at android.os.Handler.dispatchMessage(Handler.java:102)
......................................
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/DividerItemDecoration;
at com.here.msdkui.routing.WaypointList.init(WaypointList.java:48)
at com.here.msdkui.routing.WaypointList.<init>(WaypointList.java:35)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:614)
......................................
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.DividerItemDecoration"
on path: DexPathList[[zip file "/data/app/com.testapp.nav-1/base.apk",
zip file "/data/app/com.testapp.nav-1/split_lib_dependencies_apk.apk",
zip file "/data/app/com.testapp.nav-1/split_lib_slice_0_apk.apk",
zip file "/data/app/com.testapp.nav-1/split_lib_slice_1_apk.apk",
..................................................................
zip file "/data/app/com.testapp.nav-1/split_lib_slice_9_apk.apk"],
nativeLibraryDirectories=[/data/app/com.testapp.nav-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClas

Did you include the android support library in your build?
Seems like you are missing it!

Related

Error getting google ad id Xamarin

I'm trying to include OneSignal push notification into my Xamarin android app, In OneSignal panel it says that there is a device reachable but when I run my application on (Sony Xperia E5303) it says :
Error getting Google Ad id:
[OneSignal] java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;
[OneSignal] at com.onesignal.AdvertisingIdProviderGPS.getIdentifier(AdvertisingIdProviderGPS.java:39)
[OneSignal] at com.onesignal.OneSignal$6.run(OneSignal.java:631)
[OneSignal] at java.lang.Thread.run(Thread.java:818)
[OneSignal] Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.identifier.AdvertisingIdClient" on path: DexPathList[[zip file "/data/app/com.app.app.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.app.app.app-1/lib/arm64, /data/app/com.app.app.app-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
[OneSignal] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[OneSignal] at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[OneSignal] at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[OneSignal] ... 3 more
[OneSignal] Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.ads.identifier.AdvertisingIdClient
[OneSignal] at java.lang.Class.classForName(Native Method)
[OneSignal] at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[OneSignal] at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[OneSignal] at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[OneSignal] ... 4 more
I've already checked google play services version, it is 11.7.46, seems updated.
How can I solve this error?
The issue java is complaining about is that it is likely missing a jar file or import because whatever program you are running does not have dependent classes to understand what the Google Ad Id is defined as. The likely solution is going to be importing a new dependency, if you want to know what it is it's likely the packages mentioned in the exception. (the ones beginning in com).
If you don't know what those packages are you can try a google search for some of them or even the class name and see if you can find a reputable source to download and important the package from.

NoClassDefFoundError when updating from mockito 2.9.0 to 2.10.0

I am getting the following error when updating from mockito 2.9.0 to 2.10.0:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/mockito/internal/invocation/realmethod/RealMethod;
at com.android.dx.mockito.DexmakerMockMaker.createMock(DexmakerMockMaker.java:43)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51)
at org.mockito.Mockito.mock(Mockito.java:1798)
at org.mockito.Mockito.mock(Mockito.java:1711)
at org.ligi.passandroid.TestApp$createKodein$1$2.invoke(TestApp.kt:28)
at org.ligi.passandroid.TestApp$createKodein$1$2.invoke(TestApp.kt:21)
at com.github.salomonbrys.kodein.bindings.ASingleton.getInstance(bindings.kt:71)
at com.github.salomonbrys.kodein.bindings.NoArgBinding$DefaultImpls.getInstance(Binding.kt:186)
at com.github.salomonbrys.kodein.bindings.ASingleton.getInstance(bindings.kt:65)
at com.github.salomonbrys.kodein.bindings.ASingleton.getInstance(bindings.kt:65)
at com.github.salomonbrys.kodein.internal.KodeinContainerImpl$_transformBinding$1.invoke(KodeinContainerImpl.kt:129)
at com.github.salomonbrys.kodein.KodeinContainer$providerOrNull$1.invoke(KodeinContainer.kt:63)
at com.github.salomonbrys.kodein.Kodein$DefaultImpls.Instance(Kodein.kt:396)
at com.github.salomonbrys.kodein.internal.KodeinImpl.Instance(KodeinImpl.kt:13)
at org.ligi.passandroid.App.onCreate(App.kt:68)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.support.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:382)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.mockito.internal.invocation.realmethod.RealMethod" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/org.ligi.passandroid.test-1/base.apk", zip file "/data/app/org.ligi.passandroid-1/base.apk"],nativeLibraryDirectories=[/data/app/org.ligi.passandroid.test-1/lib/x86, /data/app/org.ligi.passandroid-1/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
Anyone else getting this? Happening on an android project
Try using mockito-android instead of DexMaker (which doesn't seem to be working anymore for Android instrumentation tests on Mockito 2.10 and higher):
compile "org.mockito:mockito-android:2.11.0"

How to use jess in Android

I'm trying to use JESS in and Android project. I tried using Jess 6 which is working fine on a web application on netbeans, but it's giving errors. It seems like the version of the jar file is not compatible.
I need help on how to integrate jess with an Android project.
The error is generated from a line of code:
Rete engine = new Rete();
See the error trail below:
2593-2593/com.example.modupe.tryjessapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.modupe.tryjessapp, PID: 2593
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/applet/Applet;
at jess.Rete.getApplet(Unknown Source)
at jess.Batch.batch(Unknown Source)
at jess.Rete.if(Unknown Source)
at jess.Rete.<init>(Unknown Source)
at jess.Rete.<init>(Unknown Source)
at jess.Rete.<init>(Unknown Source)
at com.example.modupe.tryjessapp.MainActivity.<init>(MainActivity.java:17)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.applet.Applet" on path: DexPathList[[zip file "/data/app/com.example.modupe.tryjessapp-1/base.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.modupe.tryjessapp-1/lib/x86, /system/lib, /vendor/lib]]
....
Jess uses a number of Java APIs that are not supported on Dalvik, Applet being one, but more importantly, java.beans.Introspector. An android-capable version of Jess is available as an alpha build to source licensees only; it hasn't been released.

Android Application crashed when share debug APK from output folder

I am working on one application that have only one screen barcode scanning and I am achieve this with zxing Library. But my problem is if I am install app with android studio it is working fine but if I share this apk from output folder with Bluetooth, Email, Xender, etc.. Application is install but when I open the app it will crash and Exception is NoClassFoundException.
Here is Logcat:
FATAL EXCEPTION: main
Process: com.jenex.cartracking, PID: 31223
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.jenex.cartracking/com.jenex.cartracking.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.jenex.cartracking.MainActivity" on path: DexPathList[[zip file "/data/app/com.jenex.cartracking-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3029)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3300)
at android.app.ActivityThread.access$1000(ActivityThread.java:211)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1705)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6946)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jenex.cartracking.MainActivity" on path: DexPathList[[zip file "/data/app/com.jenex.cartracking-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3019)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3300) 
at android.app.ActivityThread.access$1000(ActivityThread.java:211) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1705) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:6946) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 
Suppressed: java.lang.ClassNotFoundException: com.jenex.cartracking.MainActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
You have to clean build before share the app and make a debug build.
Follow this simple steps,
Goto Build -> Clean Project
Goto Build -> Build Apk
This will generate build Apk. Share this Apk.
Hope this helps.
It seems like I have the same problem. Such an exception happens now with any project, even with empty and clean just created. I used to share myproject_debug.apk with testers, but now it crashes on start up. Maybe it started after some update of Android Studio or platform-tools, I'm not sure.
So, I found some work around that work for me
Before copy project-debug.apk from output folder:
go to menu in Android Studio and open menu 'Build'
click 'Build APK'
After successful build I copy myproject-debug.apk from output folder and it works well.

MultiDex issue: java.lang.ClassNotFoundException: Didn't find class on path: DexPathList

I am facing an issue with my app:
If I deactivate within Android Studio Instant Run, my app crashes upon startup with the stacktrace:
12-29 13:36:37.876 4549-4549/com.mycoolapp.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mycoolapp.debug, PID: 4549
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mycoolapp.debug/com.myapp.SplashScreenActivity}: java.lang.ClassNotFoundException: Didn't find class "com.myapp.SplashScreenActivity" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.mycoolapp.debug-2/base.apk"],nativeLibraryDirectories=[/data/app/com.mycoolapp.debug-2/lib/arm, /vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2216)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)
at android.app.ActivityThread.access$800(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5272)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.myapp.SplashScreenActivity" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.mycoolapp.debug-2/base.apk"],nativeLibraryDirectories=[/data/app/com.mycoolapp.debug-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1065)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2206)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) 
at android.app.ActivityThread.access$800(ActivityThread.java:148) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5272) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) 
Suppressed: java.lang.NoClassDefFoundError: com.myapp.SplashScreenActivity
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:226)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
at dalvik.system.DexPathList.findClass(DexPathList.java:321)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
... 14 more
Suppressed: java.lang.ClassNotFoundException: com.myapp.SplashScreenActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
As far as I have researched this belongs to multidex:
https://developer.android.com/studio/build/multidex.html
Even if I add the multiDexEnabled property to my gradle config the app crashes. Only if I enable InstantRun (which enables multidex in background), the app runs...
If I create an apk the installation works, but the app crashes on startup with the same error.
Since I have as minSDK API Level 21, there should be no other change except of the multiDexEnabled property necessary, right?
So last but not least my answer:
All my configuration for multidex was correct... I don't know why, but after a complete OS restart everything works fine now... :)
Just create new phone on AVD and try to install app on that phone. Hope it will work.
The accepted answer was only a temporary fix for me, after altering code and a few builds the error came back.
After alot of trial and error the real problem was the jdk location my project was using, instead of using the embedded jdk in android studio i was using an installed version from oracle. After going to File > Project Structure > SDK Location and checking Use embedded JDK the problem was fixed for good.
Check if your classpath
'com.android.tools.build:gradle:3.1.0-alpha05'
is up-to-date, had same problem and solved it with a full update.

Categories

Resources