I have added an external library from .jar in my project and whenever I run the the app, it throws this error :
FATAL EXCEPTION: main
Process: com.enginious.snowblossom, PID: 17643
java.lang.NoSuchMethodError: No static method decodeHex(Ljava/lang/String;)[B in class Lorg/apache/commons/codec/binary/Hex; or its super classes (declaration of 'org.apache.commons.codec.binary.Hex' appears in /system/framework/org.apache.http.legacy.boot.jar)
at snowblossom.lib.SnowFieldInfo.(SnowFieldInfo.java:28)
at snowblossom.lib.NetworkParamsTestnet.genSnowFields(NetworkParamsTestnet.java:32)
at snowblossom.lib.NetworkParams.(NetworkParams.java:22)
at snowblossom.lib.NetworkParamsTestnet.(NetworkParamsTestnet.java:13)
at snowblossom.lib.NetworkParams.loadFromConfig(NetworkParams.java:96)
at snowblossom.client.SnowBlossomClient.(SnowBlossomClient.java:281)
at com.enginious.snowblossom.MainActivity.onCreate(MainActivity.java:32)
at android.app.Activity.performCreate(Activity.java:7183)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
org.Appache.Commons is included in the library I have added but it is still throwing this error. I need guidance regarding this issue. Thanks.
Related
When I use public #NonNull Bitmap loadThumbnail(#NonNull Uri uri, #NonNull Size size,#Nullable CancellationSignal signal) method ,
it is always showing this error
2019-12-24 16:16:10.661 30299-30299/com.shaheen.filemanager E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.shaheen.filemanager, PID: 30299
java.lang.NoSuchMethodError: No virtual method loadThumbnail(Landroid/net/Uri;Landroid/util/Size;Landroid/os/CancellationSignal;)Landroid/graphics/Bitmap; in class Landroid/content/ContentResolver; or its super classes (declaration of 'android.content.ContentResolver' appears in /system/framework/framework.jar)
at com.shaheen.filemanager.activities.FileSelectActivity.onCreate(FileSelectActivity.kt:38)
at android.app.Activity.performCreate(Activity.java:7036)
at android.app.Activity.performCreate(Activity.java:7027)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6501)
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)
Is there is any other way to solve this error ?
My code looks like this :
val bitmap = applicationContext.contentResolver.loadThumbnail(uri,Size(5,5),null)
thumbnail_image_view.setImageBitmap(bitmap)
screenshot_image_view.setImageBitmap(bitmap)
The method loadThumbnail() was only added in API level 29 that Android 10.0 so it won't work in lower versions.
However, you can use image loader libraries like picasso or glide with the uri.
Have you tried passing the context of activity or fragment instead of application context ?
I make a simple app, that uses http. For debug previously I used Chuck library. But now, when I try to open http-package from Chuck I get exception and I don't understand why.
You can see the project here: https://github.com/FirstSpectr/Sandbox
Process: ru.spectr.kotlinsandbox, PID: 4699
java.lang.IncompatibleClassChangeError: Class 'com.readystatesoftware.chuck.internal.ui.TransactionActivity' does not implement interface 'androidx.lifecycle.LifecycleOwner' in call to 'androidx.lifecycle.Lifecycle androidx.lifecycle.LifecycleOwner.getLifecycle()' (declaration of 'androidx.lifecycle.LiveData' appears in /data/app/ru.spectr.kotlinsandbox-cFhy1fESF3ecXGlmQrM-Yg==/base.apk!classes2.dex)
at androidx.lifecycle.LiveData.observe(LiveData.java:172)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setCallback(LoaderManagerImpl.java:100)
at androidx.loader.app.LoaderManagerImpl.createAndInstallLoader(LoaderManagerImpl.java:400)
at androidx.loader.app.LoaderManagerImpl.initLoader(LoaderManagerImpl.java:421)
at com.readystatesoftware.chuck.internal.ui.TransactionActivity.onCreate(TransactionActivity.java:91)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
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 found problem dependency:
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
After deleted chuck work fine
enter image description here
I am creating a chat in android studio, when I run the program everything comes up with green chekes, but in the log I get the following error and send me to correct the problem in the Main Activity, in the emoludar opens the application and closes it.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: mensajeria.chatappsistema, PID: 11008
java.lang.RuntimeException: Unable to start activity ComponentInfo{mensajeria.chatappsistema/mensajeria.chatappsistema.MainActivity}: java.lang.ClassCastException: android.support.v7.app.AlertController$RecycleListView cannot be cast to android.support.v7.widget.RecyclerView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
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)
Caused by: java.lang.ClassCastException: android.support.v7.app.AlertController$RecycleListView cannot be cast to android.support.v7.widget.RecyclerView
at mensajeria.chatappsistema.MainActivity.onCreate(MainActivity.java:38)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
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)
E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE
E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE
E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE
Application terminated.
In XML file you are using different recyclerview and java you are casting different recyclerview that's why the error is coming. Use the same type of recyclerview in both XML and java file.
I am new in the development of the AOSP environment. I'm trying to create a system service using the following url (sample source code)
http://devarea.com/aosp-creating-a-system-service,
I'm receiving a problem when I'm running the application:
Logcat error message:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.bojojnav.sampleserviceapp/com.example.bojojnav.sampleserviceapp.MainActivity}: java.lang.IllegalStateException: Failed to find ISampService by name [com.android.sampservice.ISampService]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
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)
Caused by: java.lang.IllegalStateException: Failed to find ISampService by name [com.android.sampservice.ISampService]
at com.android.sampservice.SampManager.<init>(SampManager.java:43)
at com.android.sampservice.SampManager.getInstance(SampManager.java:18)
at com.example.bojojnav.sampleserviceapp.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
please help me to resolve issue.
After the update, my application did not make any mistakes, but when I opened the emulator, I could not find the SweetAlertDialog library.Debug mode instead of release apk I tried it on the emulator this time it worked and did not give an error.I do not understand why it gives an error while in Debug mode.
FATAL EXCEPTION: main
Process: com.dinlenet, PID: 7427
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dinlenet/com.dinlenet.activitys.PermissionActivity}: java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:77)
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:64)
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:41)
at cn.pedant.SweetAlert.OptAnimationLoader.loadAnimation(OptAnimationLoader.java:22)
at cn.pedant.SweetAlert.SweetAlertDialog.<init>(SweetAlertDialog.java:80)
at com.dinlenet.utils.DialogUtil.showSweetAlertDialogWithListener(DialogUtil.java:27)
at com.dinlenet.utils.RuntimePermissionsActivity.onCreate(RuntimePermissionsActivity.java:30)
at com.dinlenet.activitys.PermissionActivity.onCreate(PermissionActivity.java:25)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
10-29 08:30:49.083 7427-7427/com.dinlenet E/CrashlyticsCore: Failed to execute task.
add this library is the same just with new features https://jitpack.io/p/Leogiroux/sweet-alert-dialog
try to add this line to your proguard file:
-keep class cn.pedant.SweetAlert.** { *; }
Reference of this Error solution. This is from Git Error issue page of SweetAlaert.
Remove the dependency from build.graddle and add it as a module as shown here:
https://github.com/pedant/sweet-alert-dialog/issues/148
This Library is not maintained
To solve this issue
Modify the File OptAnimationLoader
Add another else condition / case
case "YOURPATH.Rotate3dAnimation":
anim = new Rotate3dAnimation(c, attrs);
break;