I am having difficulty running my app in the emulator although it runs fine on my device.
The following code did not run at all but failed completely and stopped the debugger until I created and emulator at API level 18 Google APIs, then it at least failed gracefully. The line that failed:
The error message for the above line:
The above error message is in debug mode. If I compile for release the error changes to:
And the program stops.
B4A version 3.80 Android SDK Manager Version 22.2.1.
And again, this code runs fine on My Samsung Note 2 Android 4.4.2 but I would like to test for other versions.
This is a new version of a program that has been running fine for over a year and which continues to run fine on the emulator. The code that is failing is all new. The PublicFile Type and the .Length property were not used in the older version of the program.
Thanks for any help.
The following code did not run at all but failed completely and stopped the debugger until I created and emulator at API level 18 Google APIs, then it at least failed gracefully. The line that failed:
B4X:
Dim MyFile As PublicFile
The error message for the above line:
B4X:
Error occurred on line: 41 (trialexp)
java.lang.ClassNotFoundException: com.datasteam.b4a$system$file$PublicFile
at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:544)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:516)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:320)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:162)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:158)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:66)
at android.view.View.performClick(View.java:4240)
at android.view.View$PerformClick.run(View.java:17721)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
The above error message is in debug mode. If I compile for release the error changes to:
B4X:
java.lang.NoSuchFieldError: android.os.Environment.DIRECTORY_DOCUMENTS
at com.datasteam.b4a.system.file.PublicFile.<clinit>(PublicFile.java:22)
at com.superlativesoftware.nagtrial.trialexp._buybtn_click(trialexp.java:319)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:162)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:158)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:66)
at android.view.View.performClick(View.java:4240)
at android.view.View$PerformClick.run(View.java:17721)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
B4A version 3.80 Android SDK Manager Version 22.2.1.
And again, this code runs fine on My Samsung Note 2 Android 4.4.2 but I would like to test for other versions.
This is a new version of a program that has been running fine for over a year and which continues to run fine on the emulator. The code that is failing is all new. The PublicFile Type and the .Length property were not used in the older version of the program.
Thanks for any help.
Last edited: