Android Question [Solved] Error with C̵a̵m̵e̵r̵a̵ MaterialDialogs in Beta 12

Cebuvi

Active Member
Licensed User
Longtime User
Hello,

I have installed the Beta 12 version of B4A and when I run an app that uses the Camera library.

The camera opens but when I capture the image and try to present it I get this error:

act_imagen<init> (java line: 17)
java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
at androidx.savedstate.SavedStateRegistryController$Companion.create(Unknown Source:2)
at androidx.savedstate.SavedStateRegistryController.create(Unknown Source:2)
at androidx.activity.ComponentActivity.<init>(ComponentActivity.java:146)
at androidx.fragment.app.FragmentActivity.<init>(FragmentActivity.java:108)
at androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:94)
at de.amberhome.materialdialogs.MaterialDialogsActivity.<init>(MaterialDialogsActivity.java:18)
at com.tempusumbra.gnomonicphoto.act_imagen.<init>(act_imagen.java:17)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at android.app.Instrumentation.newActivity(Instrumentation.java:1273)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3901)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
... 23 more
after searching in the forum for something similar, I have added this instruction

#AdditionalJar:kotlin-stdlib-1.5.31

then I get this other error

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/arch/core/executor/ArchTaskExecutor;
at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.java:322)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:178)
at androidx.activity.ComponentActivity.<init>(ComponentActivity.java:277)
at androidx.fragment.app.FragmentActivity.<init>(FragmentActivity.java:108)
at androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:94)
at de.amberhome.materialdialogs.MaterialDialogsActivity.<init>(MaterialDialogsActivity.java:18)
at com.tempusumbra.gnomonicphoto.act_imagen.<init>(act_imagen.java:17)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at android.app.Instrumentation.newActivity(Instrumentation.java:1273)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3901)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.ClassNotFoundException: androidx.arch.core.executor.ArchTaskExecutor
... 23 more
I have uninstalled B4A, deleted the libraries and reinstalled everything as explained in the download post and I still have the same problem.

Now I'm lost, can anyone help me?
 

DonManfred

Expert
Licensed User
Longtime User
A small project showing the problem can - and probably will - help.

Your post have no indices what could be wrong. The information you provide is nearly zero. Where is the code that raises this error?

As you are reffering to kotlin it can not be any b4a code which raises this problem.
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
I just can't isolate where the problem occurs. In Debug mode, right in the "cam.Release" instruction, the error is produced.
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
Camera 2.0 and the class CameraEx.

yes, the problem seems to be act_imagen when loading the image, but the Activity doesn't even get created.

I will try to prepare a small example.
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
I still have the error from the first post.
The line in the Java file it refers to is:

public class act_imagen extends de.amberhome.materialdialogs.MaterialDialogsActivity implements B4AActivity{

Could it be a bug in the MaterialDalogs library?
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
sorry, I didn't see it properly. Now it is this
act_imagen<init> (java line: 17)
java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
at androidx.savedstate.SavedStateRegistryController$Companion.create(Unknown Source:2)
at androidx.savedstate.SavedStateRegistryController.create(Unknown Source:2)
at androidx.activity.ComponentActivity.<init>(ComponentActivity.java:146)
at androidx.fragment.app.FragmentActivity.<init>(FragmentActivity.java:108)
at androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:94)
at de.amberhome.materialdialogs.MaterialDialogsActivity.<init>(MaterialDialogsActivity.java:18)
at com.tempusumbra.gnomonicphoto.act_imagen.<init>(act_imagen.java:17)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at android.app.Instrumentation.newActivity(Instrumentation.java:1273)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3901)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
... 23 more
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
the whole problem is due to the use of the MaterialDialogs library and in particular the ColorChooserDialog.

To avoid this problem and others in the future with this library, I have decided to use B4XDialogs and B4XColorTemplate.

Thank you very much for your help.
 
Upvote 0
Top