Android Studio with Galaxy S7 - Android 7.0 - java

I'm trying to debug with Androd Studio 2.3.1 an app (min sdk 16, target sdk 24) with a Samsung Galaxy S7 (Android 7.0 installed), but I get the following exception and the app stops:
com.venework.app.venework E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.venework.app.venework, PID: 3556
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.venework.app.venework/com.venework.app.venework.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.venework.app.venework.MainActivity" on path: DexPathList[[zip file "/data/app/com.venework.app.venework-1/base.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_9_apk.apk"],
nativeLibraryDirectories=[/data/app/com.venework.app.venework-1/lib/arm64, /system/lib64, /vendor/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2844)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3008)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.venework.app.venework.MainActivity" on path: DexPathList[[zip file "/data/app/com.venework.app.venework-1/base.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.venework.app.venework-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.venework.app.venework-1/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
If I test with any other device everything is ok... any hint ? I have run out of options. Thank you

SOLUTION
The splash-screen image was in the wrong folder. drawable instead of drawable-xxhdpi... really a stupid problem.... with devices with low resolution displays it didn't make any difference, but with a high-res display like that of the Samsung S7 is completely another story...

Related

My Flutter App is Crashing on several devices after launching on playstore

I have launched an app on play store but it is crashing on several devices & I am not able test my app on every devices.
i have crashlytics report
Crashlytics Report
Stack Trace
I am getting this error in android version 6
Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Ld/e/c/a/c;
at com.google.common.base.Splitter.on(Splitter.java)
at io.grpc.internal.GrpcUtil.<clinit>(GrpcUtil.java)
at io.grpc.internal.AbstractManagedChannelImplBuilder.<clinit>(AbstractManagedChannelImplBuilder.java)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java)
at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java)
at com.google.firebase.firestore.remote.GrpcCallProvider.initChannel(GrpcCallProvider.java)
at com.google.firebase.firestore.remote.GrpcCallProvider.lambda$initChannelTask$6(GrpcCallProvider.java)
at com.google.firebase.firestore.remote.GrpcCallProvider.lambda$initChannelTask$6$GrpcCallProvider(GrpcCallProvider.java)
at com.google.firebase.firestore.remote.-$$Lambda$GrpcCallProvider$SCD5iiibQ8l4haiO8ofSfE0wIJg.call(-.java)
at com.google.android.gms.tasks.zzv.run(zzv.java)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0(ThrottledForwardingExecutor.java)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0$ThrottledForwardingExecutor(ThrottledForwardingExecutor.java)
at com.google.firebase.firestore.util.-$$Lambda$ThrottledForwardingExecutor$MfIJbVuxZtLwosAgPzPA-cU66Ko.run(-.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by java.lang.ClassNotFoundException: Didn't find class "d.e.c.a.c" on path: DexPathList[[zip file "/data/app/com.scaptor.bkdschool-1/base.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.armeabi_v7a.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.bn.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.en.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.gu.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.hi.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.kn.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.mr.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.ta.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.te.apk", zip file "/data/app/com.scaptor.bkdschool-1/split_config.xhdpi.apk"],nativeLibraryDirectories=[/data/app/com.scaptor.bkdschool-1/lib/arm, /data/app/com.scaptor.bkdschool-1/base.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.armeabi_v7a.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.bn.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.en.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.gu.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.hi.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.kn.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.mr.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.ta.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.te.apk!/lib/armeabi-v7a, /data/app/com.scaptor.bkdschool-1/split_config.xhdpi.apk!/lib/armeabi-v7a, /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 com.google.common.base.Splitter.on(Splitter.java)
at io.grpc.internal.GrpcUtil.<clinit>(GrpcUtil.java)
at io.grpc.internal.AbstractManagedChannelImplBuilder.<clinit>(AbstractManagedChannelImplBuilder.java)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java)
at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java)
at com.google.firebase.firestore.remote.GrpcCallProvider.initChannel(GrpcCallProvider.java)
at com.google.firebase.firestore.remote.GrpcCallProvider.lambda$initChannelTask$6(GrpcCallProvider.java)
at com.google.firebase.firestore.remote.GrpcCallProvider.lambda$initChannelTask$6$GrpcCallProvider(GrpcCallProvider.java)
at com.google.firebase.firestore.remote.-$$Lambda$GrpcCallProvider$SCD5iiibQ8l4haiO8ofSfE0wIJg.call(-.java)
at com.google.android.gms.tasks.zzv.run(zzv.java)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0(ThrottledForwardingExecutor.java)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0$ThrottledForwardingExecutor(ThrottledForwardingExecutor.java)
at com.google.firebase.firestore.util.-$$Lambda$ThrottledForwardingExecutor$MfIJbVuxZtLwosAgPzPA-cU66Ko.run(-.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Logs
Crashlytics - Custom logs
Application: com.myapp.name
Platform: android
Version: 1.0.9 (9)
Issue: 249cf5c99a9e11ad407fca359f935c56
Session: 60FE32E9034000012DDEB2B2FD120ABC_DNE_0_v2
Date: Mon Jul 26 2021 09:28:38 GMT+0530 (India Standard Time)
0 | Mon Jul 26 2021 09:28:35 GMT+0530 (India Standard Time) | screen_view
Device info
Device Information img

How to avoid appcrashes in Android 9 with AmazonSNSClient?

In Android 9 (API 28) my App crashes when creating a new AmazonSNSClient (in API 26 I don't get any errors):
AmazonSNSClient pushClient = new AmazonSNSClient(credentialsProvider);
My LogCat says:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/logging/LogFactory;
at com.amazonaws.AmazonWebServiceClient.<clinit>(AmazonWebServiceClient.java:55)
at myapp.service.AWSMessagingService.createEndpoint(AWSMessagingService.java:170)
at myapp.service.AWSMessagingService.registerWithSNS(AWSMessagingService.java:103)
at myapp.service.PushNotificationService.sendRegistrationToAWS(PushNotificationService.java:109)
at myapp.service.PushNotificationService.onNewToken(PushNotificationService.java:105)
at com.google.firebase.messaging.FirebaseMessagingService.zzd(Unknown Source:86)
at com.google.firebase.iid.zzg.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:7)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.logging.LogFactory" on path: DexPathList[[zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/base.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_dependencies_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_resources_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_0_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_1_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_2_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_3_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_4_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_5_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_6_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_7_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_8_apk.apk", zip file "/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/base.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_dependencies_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_resources_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_0_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_1_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_2_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_3_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_4_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_5_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_6_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_7_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_8_apk.apk!/lib/x86, /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_slice_9_apk.apk!/lib/x86, /system/lib]]
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 com.amazonaws.AmazonWebServiceClient.<clinit>(AmazonWebServiceClient.java:55) 
at myapp.service.AWSMessagingService.createEndpoint(AWSMessagingService.java:170) 
at myapp.service.AWSMessagingService.registerWithSNS(AWSMessagingService.java:103) 
at myapp.service.PushNotificationService.sendRegistrationToAWS(PushNotificationService.java:109) 
at myapp.service.PushNotificationService.onNewToken(PushNotificationService.java:105) 
at com.google.firebase.messaging.FirebaseMessagingService.zzd(Unknown Source:86) 
at com.google.firebase.iid.zzg.run(Unknown Source:4) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:7) 
at java.lang.Thread.run(Thread.java:764) 
2018-12-17 09:25:07.483 10291-10344/myapp E/AndroidRuntime: Suppressed: java.io.IOException: No original dex files found for dex location /data/app/myapp-grqOb2dmxK1zDq9u44b9Rg==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
at android.app.LoadedApk.getResources(LoadedApk.java:1032)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5749)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I found out that I can avoid the error if I don't exclude "commons-logging" from "com.amazonaws:aws-android-sdk-sns" in my build.gradle, so I replaced:
implementation 'com.amazonaws:aws-android-sdk-sns:2.2.0', {
exclude module: 'commons-logging'
}
with:
implementation 'com.amazonaws:aws-android-sdk-sns:2.2.0'
The app works fine now but I can't build a signed APK because I get
the error "DuplicatePlatformClasses: Duplicate Platform Classes" and
my Lint Report says:
commons-logging defines classes that conflict with classes now
provided by Android. Solutions include finding newer versions or
alternative libraries that don't have the same problem (for example,
for httpclient use HttpUrlConnection or okhttp instead), or
repackaging the library using something like jarjar. There are a
number of libraries that duplicate not just functionality of the
Android platform but using the exact same class names as the ones
provided in Android -- for example the apache http classes. This can
lead to unexpected crashes.
To solve this, you need to either find a newer version of the library
which no longer has this problem, or to repackage the library (and all
of its dependencies) using something like the jarjar tool, or finally,
rewriting the code to use different APIs (for example, for http code,
consider using HttpUrlConnection or a library like okhttp). Note: This
issue has an associated quickfix operation in Android Studio and
IntelliJ IDEA. To suppress this error, use the issue id
"DuplicatePlatformClasses" as explained in the Suppressing Warnings
and Errors section.
So I ran "gradlew app:dependencies > dependencies.txt" in the terminal in my project folder and found out that "com.amazonaws:aws-android-sdk-sns:2.2.0" uses "commons-logging:commons-logging:1.1.1" but I can also find "commons-logging:commons-logging:1.2" which is "provided by Android" I guess?
So why does "com.amazonaws:aws-android-sdk-sns:2.2.0" not use "commons-logging:commons-logging:1.2" if I exclude "commons-logging:commons-logging:1.1.1" and how can I fix this issue?
I could solve the error by updating "com.amazonaws:aws-android-sdk-sns:2.2.0" to a newer version (in my case "com.amazonaws:aws-android-sdk-sns:2.9.1").
The NoClassDefFoundError in Android 9 is also tracked in this issue:
https://github.com/aws-amplify/aws-sdk-android/issues/476

Android - Apache Commons DbUtils - QueryRunner Exception

I'm using in my app Apache Commons DbUtils (https://commons.apache.org/proper/commons-dbutils/).
I added jar file (commons-dbutils-1.7.jar) to the libs folder. Then I have this code:
ResultSetHandler<List<Objekt>> h = new BeanListHandler<Objekt>(Objekt.class);
QueryRunner run = new QueryRunner();
List<Objekt> persons = run.query(conn, "select * from C_OBJEKT", h);
And in the last row I get this exception:
12-12 14:33:46.939 24150-24210/com.tempus.touch W/art: Unresolved exception class when finding catch block: java.beans.IntrospectionException
12-12 14:33:46.939 24150-24210/com.tempus.touch E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.tempus.touch, PID: 24150
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/beans/Introspector;
at org.apache.commons.dbutils.BeanProcessor.propertyDescriptors(BeanProcessor.java:432)
at org.apache.commons.dbutils.BeanProcessor.toBeanList(BeanProcessor.java:197)
at org.apache.commons.dbutils.BasicRowProcessor.toBeanList(BasicRowProcessor.java:140)
at org.apache.commons.dbutils.handlers.BeanListHandler.handle(BeanListHandler.java:83)
at org.apache.commons.dbutils.handlers.BeanListHandler.handle(BeanListHandler.java:34)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:388)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:266)
at com.tempus.touch.MainActivity$3.run(MainActivity.java:160)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.beans.Introspector" on path: DexPathList[[zip file "/data/app/com.tempus.touch-1/base.apk", zip file "/data/app/com.tempus.touch-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.tempus.touch-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.tempus.touch-1/lib/arm, /vendor/lib, /system/lib]]
What's wrong? What should I do? Import some other library?
Thank you for help!

Didn't find class "com.google.android.gms.common.app.GmsApplication"

I have got a problem when running my app on Android 4.4 with Google Play Services version 100884030. I get the following error:
FATAL EXCEPTION: main
Process: com.google.android.gms, PID: 8678
java.lang.RuntimeException: Unable to instantiate application com.google.android.gms.common.app.GmsApplication: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.app.GmsApplication" on path: DexPathList[[zip file "/system/framework/com.android.media.remotedisplay.jar", zip file "/system/framework/com.android.location.provider.jar", zip file "/system/framework/com.google.android.ble.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:507)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4301)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.app.GmsApplication" on path: DexPathList[[zip file "/system/framework/com.android.media.remotedisplay.jar", zip file "/system/framework/com.android.location.provider.jar", zip file "/system/framework/com.google.android.ble.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:502)
... 11 more
My Gradle settings:
compileSdkVersion 25
buildToolsVersion "25.0.2"
minSdkVersion 14
targetSdkVersion 22
....
compile 'com.google.android.gms:play-services-analytics:10.2.1'
compile 'com.google.android.gms:play-services-ads:10.2.1'
So you see what is the problem?
Thanks !!!
I had an identical problem, I think, and it turned out that the .apk on the device was corrupted. Maybe by an internal flash storage (hardware) problem?
This is what I did:
Turn on Developer Settings on the device (by tapping the Build Number seven times in the About screen of Settings).
From the Developer Settings menu that appeared, turn on USB Debugging.
Connect to a PC with adb installed.
Find the path of the existing Google Play Services apk on the device, with adb shell pm path com.google.android.gms
Use that path to pull the existing apk from the device, to check it, with adb pull /data/app/com.google.android.gms-1/base.apk (replace the path here with what you got at point 4).
Check if the apk is broken, by changing its extension to .zip, and doing a zip integrity test. In my case it said classes2.dex bad CRC.
Download a good apk from somewhere trusted. Another identical device would be perfect, but I didn't have one, so I got mine from apkmirror.com (make sure you pick the right variant, there are a number of them for the same version number). The one I downloaded had the same number of bytes as the one pulled from the phone, but a segment of data inside was different.
Install the downloaded apk with adb install -r <downloaded file>.
Reboot the device.
That's it. Everything worked after this.

Error on using weka library on android (Want to Implement Machine Learning in an Android Application)

For implementing Machine Learning in an Android Application, I am using 'WEKA Tool' which I have included it on the Project 'libs' and compile it from the 'gradle' of project.
But while running on the phone when that functions invoked which doing the classification (calling 'RandomForest Classifier'), my app goes crashed.
I am getting this 'Runtime Error'. Can anyone help me please?
Unable to create WEKA_HOME (/wekafiles)
Unable to create packages directory (/wekafiles/packages)
Unable to create repository cache directory (/wekafiles/repCache)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.weirdmyth.testapp, PID: 31474
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/GraphicsEnvironment;
at weka.core.packageManagement.PackageManager.setProxyAuthentication(PackageManager.java:191)
at weka.core.WekaPackageManager.establishWekaHome(WekaPackageManager.java:377)
at weka.core.WekaPackageManager.<clinit>(WekaPackageManager.java:162)
at weka.core.Utils.readProperties(Utils.java:174)
at weka.core.Capabilities.<init>(Capabilities.java:275)
at weka.classifiers.AbstractClassifier.getCapabilities(AbstractClassifier.java:508)
at weka.classifiers.trees.RandomTree.getCapabilities(RandomTree.java:602)
at weka.classifiers.trees.RandomForest.getCapabilities(RandomForest.java:182)
at weka.classifiers.meta.Bagging.buildClassifier(Bagging.java:701)
at com.example.weirdmyth.testapp.MainActivity.showExtractData(MainActivity.java:68)
at com.example.weirdmyth.testapp.MainActivity.access$000(MainActivity.java:18)
at com.example.weirdmyth.testapp.MainActivity$1.onClick(MainActivity.java:35)
at android.view.View.performClick(View.java:4794)
at android.view.View$PerformClick.run(View.java:19905)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:139)
at android.app.ActivityThread.main(ActivityThread.java:5298)
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:950)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.GraphicsEnvironment" on path: DexPathList[[dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-weka_24a0e957b7a2bd7b1eca884c1d1fe17134d04e02-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-support-annotations-24.2.0_1d91a870686be0d9b2c0cad6f095599608f8ea8b-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-internal_impl-24.2.0_e60a43d4d67966d22f555860d8f3ea89bf40a00d-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-internal_impl-24.2.0_bab1238d93c9b1e214aa74253243e0e0a1179d1b-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-internal_impl-24.2.0_ac3ce21dd47241b373379a2a2250d916ddec89f2-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-internal_impl-24.2.0_86622e6ad735878a3262fd8fb6bc9c316447f2bd-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-internal_impl-24.2.0_024d25ee6599778d6213941fb989deeaa23d0a37-classes.dex", dex file "/data/data/com.example.weirdmyth.testapp/files/instant-run/dex/slice-com.android.support-support-vector-drawable-24.2.0_a300254740b0ce696848c36d6b2c7e26898aba9c-classes.dex", dex file "/data/data/com.example
try using this one: https://github.com/rjmarsan/Weka-for-Android
As writer says: and 100% functionality is not promised. However, it's sure better than nothing.

Categories