svan
April 17, 2023, 12:28am
1
Anyone know what causes this error on a new Galaxy Tab A8:
void setup() {
fullScreen();
background(209);
}
void draw() {
}
Hi @svan ,
You can add a follow up on this GitHub issue:
opened 10:33AM - 28 Feb 23 UTC
needs confirmation
I can't run any sketch on my device, even the tutorial code. The code builds and… I can see the sketch on my homepage but it crashes on startup. This is my first time using Processing for Android. My phone is a Xiaomi Redmi Mi 9t.
Tutorial code:
```
void setup() {
fullScreen();
noStroke();
fill(0);
}
void draw() {
background(204);
if (mousePressed) {
if (mouseX < width/2) {
rect(0, 0, width/2, height); // Left
} else {
rect(width/2, 0, width/2, height); // Right
}
}
}
```
Here is the error code:
```
FATAL EXCEPTION: main
Process: processing.test.sketch_230228a, PID: 18243
java.lang.VerifyError: Rejecting class processing.a2d.PSurfaceAndroid2D that attempts to sub-type erroneous class processing.core.PSurfaceNone (declaration of 'processing.a2d.PSurfaceAndroid2D' appears in /data/app/~~pbDTqMMEtdX3RM-7t2y1gg==/processing.test.sketch_230228a-BovUAs_i6QCNcpIiUa_xtw==/base.apk)
at processing.a2d.PGraphicsAndroid2D.createSurface(PGraphicsAndroid2D.java:180)
at processing.core.PApplet.initSurface(PApplet.java:538)
at processing.android.PFragment.onCreateView(PFragment.java:149)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2663)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManagerImpl.java:2613)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:246)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:542)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:210)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1436)
at android.app.Activity.performStart(Activity.java:8188)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3573)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2154)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Caused by: java.lang.VerifyError: Verifier rejected class processing.core.PSurfaceNone: android.content.Context processing.core.PSurfaceNone.getContext() failed to verify: android.content.Context processing.core.PSurfaceNone.getContext(): [0x22] can't resolve returned type 'Reference: android.content.Context' or 'Unresolved Reference: android.support.wearable.watchface.WatchFaceService' (declaration of 'processing.core.PSurfaceNone' appears in /data/app/~~pbDTqMMEtdX3RM-7t2y1gg==/processing.test.sketch_230228a-BovUAs_i6QCNcpIiUa_xtw==/base.apk)
... 31 more
```
Edit: Just tried in my friend's phone and it worked. I don't know why my phone's not working though.
svan
April 17, 2023, 3:36pm
3
Followup added. Thanks for responding.
1 Like
svan
April 17, 2023, 8:32pm
4
A revised AndroidMode was created by @ajavamind and posted on a github site. When downloaded and unzipped the revised AndroidMode was placed in the ‘modes’ folder of the Documents/Processing folder (previous AndroidMode was renamed to keep it from being used). Now I can continue Android development without any errors on my Galaxy A8.
1 Like