How fix My android app not working on android 9? - android

My android app works fine on android below 9 but on android 9 not working and app will close after run with Myappname Keeps Stop error on phone.
I've build app with SDKVersion & TargetSDKversion 28 ( Android 9 ) already. Please help me how can compatible my app with android 9
This is my Logcat when my app crashes , I think there is problem with background processes
--------- beginning of crash
2019-12-20 18:08:33.181 9444-9499/com.example.asanbekhar E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.example.asanbekhar, PID: 9444
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/DatatypeConverter;
at org.scribe.services.DatatypeConverterEncoder.encode(DatatypeConverterEncoder.java:10)
at org.scribe.services.HMACSha1SignatureService.bytesToBase64String(HMACSha1SignatureService.java:51)
at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:46)
at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32)
at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151)
at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75)
at org.scribe.oauth.OAuth10aServiceImpl.signRequest(OAuth10aServiceImpl.java:126)
at com.ciyashop.library.apicall.PostApi$postAPiCall.doInBackground(PostApi.java:109)
at com.ciyashop.library.apicall.PostApi$postAPiCall.doInBackground(PostApi.java:40)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.bind.DatatypeConverter" on path: DexPathList[[zip file "/data/app/com.example.asanbekhar-YRxDnKrurpdOW4cXsei4lA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.asanbekhar-YRxDnKrurpdOW4cXsei4lA==/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 org.scribe.services.DatatypeConverterEncoder.encode(DatatypeConverterEncoder.java:10) 
at org.scribe.services.HMACSha1SignatureService.bytesToBase64String(HMACSha1SignatureService.java:51) 
at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:46) 
at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32) 
at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151) 
at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75) 
at org.scribe.oauth.OAuth10aServiceImpl.signRequest(OAuth10aServiceImpl.java:126) 
at com.ciyashop.library.apicall.PostApi$postAPiCall.doInBackground(PostApi.java:109) 
at com.ciyashop.library.apicall.PostApi$postAPiCall.doInBackground(PostApi.java:40) 
at android.os.AsyncTask$2.call(AsyncTask.java:333) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
2019-12-20 18:08:33.192 9444-9499/com.example.asanbekhar E/UncaughtException: java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/DatatypeConverter;
at org.scribe.services.DatatypeConverterEncoder.encode(DatatypeConverterEncoder.java:10)
at org.scribe.services.HMACSha1SignatureService.bytesToBase64String(HMACSha1SignatureService.java:51)
at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:46)
at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32)
at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151)
at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75)
at org.scribe.oauth.OAuth10aServiceImpl.signRequest(OAuth10aServiceImpl.java:126)
at com.ciyashop.library.apicall.PostApi$postAPiCall.doInBackground(PostApi.java:109)
at com.ciyashop.library.apicall.PostApi$postAPiCall.doInBackground(PostApi.java:40)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.bind.DatatypeConverter" on path: DexPathList[[zip file "/data/app/com.example.asanbekhar-YRxDnKrurpdOW4cXsei4lA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.asanbekhar-YRxDnKrurpdOW4cXsei4lA==/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 org.scribe.services.DatatypeConverterEncoder.encode(DatatypeConverterEncoder.java:10) 
at org.scribe.services.HMACSha1SignatureService.bytesToBase64String(HMACSha1SignatureService.java:51) 
at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:46) 
at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32) 
at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151) 
at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75) 
at org.scribe.oauth.OAuth10aServiceImpl.signRequest(OAuth10aServiceImpl.java:126) 
at com.ciyashop.library.apicall.PostApi$postAPiCall.doInBackground(PostApi.java:109) 
at com.ciyashop.library.apicall.PostApi$postAPiCall.doInBackground(PostApi.java:40) 
at android.os.AsyncTask$2.call(AsyncTask.java:333) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 

The problem is because android 9 and above uses SSL socket ( HTTPS Ports ) to communicate and in this case the http port used. The problem solved with adding this line below to Manifest file
android:usesCleartextTraffic="true">
<uses-library android:name="org.apache.http.legacy" android:required="false" />

Related

Firebase Internal Error: java.lang.RuntimeException: Internal error in Firestore (19.0.2)

While using Firebase, Cloud Vision API, and the Google Translate API, there was a conflict between the dependencies and the case was resolved, but I faced this problem. I don't know what is the problem. In the case of Firebase code, it worked fine until I put in the cloud and Google Translate API.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.voca, PID: 32584
java.lang.RuntimeException: Internal error in Firestore (19.0.2).
at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$5(com.google.firebase:firebase-firestore##19.0.2:379)
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$5.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
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)
Caused by: java.lang.ExceptionInInitializerError
at com.google.firestore.v1.ListenRequest.getDefaultInstance(com.google.firebase:firebase-firestore##19.0.2:915)
at com.google.firestore.v1.FirestoreGrpc.getListenMethod(com.google.firebase:firebase-firestore##19.0.2:408)
at com.google.firebase.firestore.remote.WatchStream.<init>(com.google.firebase:firebase-firestore##19.0.2:62)
at com.google.firebase.firestore.remote.Datastore.createWatchStream(com.google.firebase:firebase-firestore##19.0.2:149)
at com.google.firebase.firestore.remote.RemoteStore.<init>(com.google.firebase:firebase-firestore##19.0.2:167)
at com.google.firebase.firestore.core.FirestoreClient.initialize(com.google.firebase:firebase-firestore##19.0.2:263)
at com.google.firebase.firestore.core.FirestoreClient.lambda$new$2(com.google.firebase:firebase-firestore##19.0.2:117)
at com.google.firebase.firestore.core.FirestoreClient$$Lambda$2.run(Unknown Source:8)
at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$4(com.google.firebase:firebase-firestore##19.0.2:311)
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$4.call(Unknown Source:2)
at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$3(com.google.firebase:firebase-firestore##19.0.2:287)
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$3.run(Unknown Source:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.firestore.util.AsyncQueue$DelayedStartFactory.run(com.google.firebase:firebase-firestore##19.0.2:205)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.RuntimeException: Unable to get message info for com.google.firestore.v1.ListenRequest
at com.google.protobuf.GeneratedMessageInfoFactory.messageInfoFor(GeneratedMessageInfoFactory.java:62)
at com.google.protobuf.ManifestSchemaFactory$CompositeMessageInfoFactory.messageInfoFor(ManifestSchemaFactory.java:143)
at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:55)
at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:93)
at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:107)
at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:171)
at com.google.firestore.v1.ListenRequest.<clinit>(com.google.firebase:firebase-firestore##19.0.2:911)
at com.google.firestore.v1.ListenRequest.getDefaultInstance(com.google.firebase:firebase-firestore##19.0.2:915) 
at com.google.firestore.v1.FirestoreGrpc.getListenMethod(com.google.firebase:firebase-firestore##19.0.2:408) 
at com.google.firebase.firestore.remote.WatchStream.<init>(com.google.firebase:firebase-firestore##19.0.2:62) 
at com.google.firebase.firestore.remote.Datastore.createWatchStream(com.google.firebase:firebase-firestore##19.0.2:149) 
at com.google.firebase.firestore.remote.RemoteStore.<init>(com.google.firebase:firebase-firestore##19.0.2:167) 
at com.google.firebase.firestore.core.FirestoreClient.initialize(com.google.firebase:firebase-firestore##19.0.2:263) 
at com.google.firebase.firestore.core.FirestoreClient.lambda$new$2(com.google.firebase:firebase-firestore##19.0.2:117) 
at com.google.firebase.firestore.core.FirestoreClient$$Lambda$2.run(Unknown Source:8) 
at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$4(com.google.firebase:firebase-firestore##19.0.2:311) 
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$4.call(Unknown Source:2) 
at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$3(com.google.firebase:firebase-firestore##19.0.2:287) 
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$3.run(Unknown Source:4) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at com.google.firebase.firestore.util.AsyncQueue$DelayedStartFactory.run(com.google.firebase:firebase-firestore##19.0.2:205) 
at java.lang.Thread.run(Thread.java:764) 
Caused by: java.lang.UnsupportedOperationException
at com.google.firestore.v1.ListenRequest.dynamicMethod(com.google.firebase:firebase-firestore##19.0.2:903)
at com.google.protobuf.GeneratedMessageLite.dynamicMethod(GeneratedMessageLite.java:252)
at com.google.protobuf.GeneratedMessageLite.buildMessageInfo(GeneratedMessageLite.java:280)
at com.google.protobuf.GeneratedMessageInfoFactory.messageInfoFor(GeneratedMessageInfoFactory.java:60)
at com.google.protobuf.ManifestSchemaFactory$CompositeMessageInfoFactory.messageInfoFor(ManifestSchemaFactory.java:143) 
at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:55) 
at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:93) 
at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:107) 
at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:171) 
at com.google.firestore.v1.ListenRequest.<clinit>(com.google.firebase:firebase-firestore##19.0.2:911) 
at com.google.firestore.v1.ListenRequest.getDefaultInstance(com.google.firebase:firebase-firestore##19.0.2:915) 
at com.google.firestore.v1.FirestoreGrpc.getListenMethod(com.google.firebase:firebase-firestore##19.0.2:408) 
at com.google.firebase.firestore.remote.WatchStream.<init>(com.google.firebase:firebase-firestore##19.0.2:62) 
at com.google.firebase.firestore.remote.Datastore.createWatchStream(com.google.firebase:firebase-firestore##19.0.2:149) 
at com.google.firebase.firestore.remote.RemoteStore.<init>(com.google.firebase:firebase-firestore##19.0.2:167) 
at com.google.firebase.firestore.core.FirestoreClient.initialize(com.google.firebase:firebase-firestore##19.0.2:263) 
at com.google.firebase.firestore.core.FirestoreClient.lambda$new$2(com.google.firebase:firebase-firestore##19.0.2:117) 
at com.google.firebase.firestore.core.FirestoreClient$$Lambda$2.run(Unknown Source:8) 
at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$4(com.google.firebase:firebase-firestore##19.0.2:311) 
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$4.call(Unknown Source:2) 
at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$3(com.google.firebase:firebase-firestore##19.0.2:287) 
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$3.run(Unknown Source:4) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at com.google.firebase.firestore.util.AsyncQueue$DelayedStartFactory.run(com.google.firebase:firebase-firestore##19.0.2:205) 
at java.lang.Thread.run(Thread.java:764) 

Android app is crashing with An error occurred while executing doInBackground() in android 9 [duplicate]

I was working on my code. it was working fine on version 8(Oreo) after that I got an update of android v 9.0 (Pie) and the app stopped working suddenly. after checking I got a error message om my Asyn task stating the below error:
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.global.exch, PID: 25112
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/logging/LogFactory;
at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:182)
at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:150)
at com.global.exch.Dataholder.getApi(Dataholder.java:100)
at com.global.exch.MainActivity$QuotesData.doInBackground(MainActivity.java:391)
at com.global.exch.MainActivity$QuotesData.doInBackground(MainActivity.java:386)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
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/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/base.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_resources_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/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.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:182) 
at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:150) 
at com.global.exch.Dataholder.getApi(Dataholder.java:100) 
at com.global.exch.MainActivity$QuotesData.doInBackground(MainActivity.java:391) 
at com.global.exch.MainActivity$QuotesData.doInBackground(MainActivity.java:386) 
at android.os.AsyncTask$2.call(AsyncTask.java:333) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.global.exch-sEcnUuVsCYjXlnxJddVQAA==/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)
E/AndroidRuntime: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:718)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:801)
at android.app.LoadedApk.getResources(LoadedApk.java:1023)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5780)
at android.app.ActivityThread.access$1100(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1660)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6762)
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)
Can anyone help me out what is the exact issue for this as it was working fine earlier.
thank you in advance.
I was also facing the same issue but After Adding the below code in my manifest file the issue got resolved
for reference you can also check this url:
https://developer.android.com/about/versions/pie/android-9.0-changes-28
manifest.xml
<application
...
android:usesCleartextTraffic="true"
...>
<uses-library
android:name="org.apache.http.legacy"
android:required="false"/>
</application>
How to update the existing project in androidx.
does not need to add the extra permission & code, dependencies,...
0.1): changes into the compileSdkVersion 29
0.2): Refactor-> Migrate to androidX then
Just add the following code in the project "ASDF":
1): add the XML directory,
1.1): Add the following code in XML, Code is below: i.e.
<application
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system"/>
</trust-anchors>
</base-config>
</network-security-config>
>
2): add the following code in the in manifest file:
2.1): within application tag the (manifest->application) add the following code:
android:networkSecurityConfig="#xml/network_security_config"
2.2): outside application tag the (manifest->application) add the following code:
<application>
<uses-library
android:name="org.apache.http.legacy"
android:required="false"/>
</application>
be happy and share your feedback with me Thank you**

couldn't find "libjniavutil.so" in my android studio

While initializing FFmpegFrameRecorder I'm getting crash in android PIE(9.0) and marshmallow as well.
Below I mentioned where exactly I'm getting a crash and logCat as well of a crash.
Can any one of you please help me to sort it out.?
mVideo = CameraUtil.getOutputMediaFile(recordedTime, CameraUtil.MEDIA_TYPE_VIDEO);
Log.i(LOG_TAG, "Output Video: " + mVideo);
mFrameRecorder = new FFmpegFrameRecorder(mVideo, videoWidth, videoHeight, 1);
mFrameRecorder.setFormat("mp4");
mFrameRecorder.setSampleRate(sampleAudioRateInHz);
mFrameRecorder.setFrameRate(frameRate);
mFrameRecorder.setGopSize(60);
Here I mentioned my LogCat File
Caused by: java.lang.NoClassDefFoundError: org.bytedeco.javacpp.avutil
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at org.bytedeco.javacpp.Loader.load(Loader.java:585)
at org.bytedeco.javacpp.Loader.load(Loader.java:530)
at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)
at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:152)
at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:132)
at com.starcam.test1.activities.EventLiveFrame3VideoQuestion.initRecorder(EventLiveFrame3VideoQuestion.java:606)
at com.starcam.test1.activities.EventLiveFrame3VideoQuestion.access$800(EventLiveFrame3VideoQuestion.java:83)
at com.starcam.test1.activities.EventLiveFrame3VideoQuestion$9.doInBackground(EventLiveFrame3VideoQuestion.java:458)
at com.starcam.test1.activities.EventLiveFrame3VideoQuestion$9.doInBackground(EventLiveFrame3VideoQuestion.java:453)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.starcam.test1-Tndkf7jqvwcCdq5w3dj8CQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.starcam.test1-Tndkf7jqvwcCdq5w3dj8CQ==/lib/arm64, /data/app/com.starcam.test1-Tndkf7jqvwcCdq5w3dj8CQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]] couldn't find "libjniavutil.so"

DJI app error (No original dex files found for dex location)

I am basically trying to convert the DJI videostreamdecodingsample to a kotlin based app but when I tried to run the app then it shows the following error
2018-12-10 15:12:02.031 5208-5227/com.joeydash.djilogapp E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.joeydash.djilogapp, PID: 5208
java.lang.NoClassDefFoundError: Failed resolution of: Ldji/sdk/sdkmanager/DJISDKManager;
at com.joeydash.djilogapp.ConnectionActivity$startSDKRegistration$1.run(ConnectionActivity.kt:83)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.sdk.sdkmanager.DJISDKManager" on path: DexPathList[[zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/base.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_dependencies_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_resources_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_0_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_1_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_2_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_3_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_4_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_5_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_6_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_7_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_8_apk.apk", zip file "/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/base.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_dependencies_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_resources_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_0_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_1_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_2_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_3_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_4_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_5_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_6_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_7_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_8_apk.apk!/lib/x86, /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_slice_9_apk.apk!/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at
com.joeydash.djilogapp.ConnectionActivity$startSDKRegistration$1.run(ConnectionActivity.kt:83) 
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
at java.lang.Thread.run(Thread.java:764) 
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.joeydash.djilogapp-UOs6TJS_aks11EEvG3Rv7w==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:353)
at dalvik.system.DexFile.<init>(DexFile.java:100)
at dalvik.system.DexFile.<init>(DexFile.java:74)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
at dalvik.system.DexPathList.<init>(DexPathList.java:157)
2018-12-10 15:12:02.032 5208-5227/com.joeydash.djilogapp E/AndroidRuntime: 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:69)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:35)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:693)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:727)
at android.app.LoadedApk.getResources(LoadedApk.java:954)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2270)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5639)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
I made minifyEnabled false in debug build but still it doesn't works
I am not getting what the error is

NoClassDefFoundError exception in android stuidio

Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/impl/client/DefaultHttpClient
I am not able to resolve below error :
Caused by: java.lang.NoClassDefFoundError: Failed resolution of:
Lorg/apache/http/impl/client/DefaultHttpClient;
at com.medicend.jykra.medicend.Async.Parser.LoginParser.hitWS(LoginParser.java:68)
at com.medicend.jykra.medicend.Async.Parser.LoginParser.postData(LoginParser.java:50)
at com.medicend.jykra.medicend.Activity.SignInActivity$LoginAsync.doInBackground(SignInActivity.java:91)
at com.medicend.jykra.medicend.Activity.SignInActivity$LoginAsync.doInBackground(SignInActivity.java:73)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.impl.client.DefaultHttpClient" on path:
DexPathList[[zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/base.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_dependencies_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_resources_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_0_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_1_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_2_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_3_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_4_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_5_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_6_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_7_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_8_apk.apk",
zip file
"/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/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.medicend.jykra.medicend.Async.Parser.LoginParser.hitWS(LoginParser.java:68) 
at com.medicend.jykra.medicend.Async.Parser.LoginParser.postData(LoginParser.java:50) 
at com.medicend.jykra.medicend.Activity.SignInActivity$LoginAsync.doInBackground(SignInActivity.java:91) 
at com.medicend.jykra.medicend.Activity.SignInActivity$LoginAsync.doInBackground(SignInActivity.java:73) 
at android.os.AsyncTask$2.call(AsyncTask.java:333) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
Suppressed: java.io.IOException: No original dex files found for dex location
/data/app/com.medicend.jykra.medicend-IiBcrMY7QQm4ixa9RIMICQ==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.(DexFile.java:101)
at dalvik.system.DexFile.(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
E/AndroidRuntime: 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)
Add the following to your manifest file under 'application':
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p
You are getting this error because your app uses the legacy org.apache.http.legacy client and your app's targetSdkVersion is set to 28 or higher.
Consider using HttpURLConnection or lowering your targetSdkVersion in build.gradle.

Categories

Resources