App Closes Automatically on Start

I have been facing this issue from couple of days, I have been working on this project for long time and I never got any issue.
But since I want to update my existing app, I changed the version code and app crashes on start.
App works fine on companion but it crashes on installed apk

I am attaching the error code that I received, Request the community for help to solve this.

Note : I already read all the existing post and tried but couldn’t solve my problem, so I am creating this new topic, So I request moderators not to unlist.

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/appinventor/components/runtime/repackaged/org/json/JSONArray;
at java.lang.reflect.Executable.getMethodReturnTypeInternal(Native Method)
at java.lang.reflect.Method.getReturnType(Method.java:148)
at java.lang.Class.getDeclaredMethods(Class.java:1883)
at gnu.bytecode.ClassType.addMethods(ClassType.java:979)
at gnu.bytecode.ClassType.getDeclaredMethods(ClassType.java:725)
at gnu.bytecode.ClassType.getMethods(ClassType.java:809)
at gnu.kawa.reflect.ClassMethods.getMethods(ClassMethods.java:106)
at gnu.kawa.reflect.ClassMethods.apply(ClassMethods.java:229)
at gnu.kawa.reflect.Invoke.lookupMethods(Invoke.java:278)
at gnu.kawa.reflect.Invoke.applyN(Invoke.java:185)
at gnu.mapping.ProcedureN.apply2(ProcedureN.java:39)
at io.kodular.syedmuzakkir65.DentalCompanion.Screen1.$define(Screen1.yail:10250)
at com.google.appinventor.components.runtime.Form.onCreateFinish2(SourceFile:510)
at com.google.appinventor.components.runtime.Form.onCreateFinish(SourceFile:454)
at com.google.appinventor.components.runtime.Form.onCreate(SourceFile:384)
at android.app.Activity.performCreate(Activity.java:7893)
at android.app.Activity.performCreate(Activity.java:7880)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3286)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3460)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
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:2047)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7590)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: java.lang.ClassNotFoundException: com.google.appinventor.components.runtime.repackaged.org.json.JSONArray
… 30 more

Please read here ,

https://groups.google.com/g/app-inventor-open-source-dev/c/5ToREBm7M2A

Too many arrangment and labels :woozy_face:

It is not recommended to use extensions from Deep Host.

What does the code mean??

I don’t think this file is present in app inventor.
So I can’t help more.

Why does companion doesn’t give any error then ?

Is there no one who can explain the error code above ? ?

Remove permission blocks its working fine. Yesterday i also fetch same problem. I thing there is something buggy in permission block. its some time works some time not if you clear app data then its open 1 time and after same auto aromatically close

Didn’t worked

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/appinventor/components/runtime/repackaged/org/json/JSONArray;

Which component has this class

This class does not exist in App Inventor.

Can it be extension??

No, extensions can’t have that package name.
Try removing Deep Host’s extension.

I didn’t understood, I am not into java

Share the aia and / or APK.

JSONException is a class of org.json jar but gets refactored to com.google.appinventor.components.runtime.repackaged.org.json.JSONException.
It seems.
Originally it does not exists in runtime package.

It can be because of Image Utilities or Graphic Design extension.

Nothing suspicious except that error is occurring on Screen Initialize becase of an extension/ imported component.

:open_mouth::open_mouth: OMG what is that, what am I doing wrong