Calsign / APDE

Source code for APDE: Create and run Processing sketches on an Android device.
GNU General Public License v2.0
338 stars 76 forks source link

App crashing and won't open ever again #112

Open Fireboss05 opened 2 years ago

Fireboss05 commented 2 years ago

I was working on something very simple (2 class and only basic stuff) and the app crashed during or after a run. Then I can't reopen it even after shutting down my phone. It already happened before and I had to reinstall for the app to work again. I noticed no one talked about it so here I am

I'm on a "zenfone max m2 pro". It happens very very very rarely since I use the app multiple times a week

uheinema commented 2 years ago

Hello,

just post your code, and I will try to reproduce the effect. Are other examples working?

Best regards Ullrich

Fireboss05 commented 2 years ago

I'm using multiple tab but I can share you the code yeah, I changed it since that but I don't think the issue is related to that. It once happened when I was waiting with an empty tab. A second tab had only a setup/draw with background and size but nothing else. I didn't launch anything and it crashed, then I was unable to reopen. And when you reinstall and retry to launch, it works perfectly.

(Maybe you can give me a way to share the code plz 😅 I can make a mega if you want to)

I don't know If I can be more useful because I have no clue of what it is related to (I don't use something out of the ordinary to make my sketch crash I swear Ahah)

Thank you for your response and I hope you the best

Sacha

Fireboss05 commented 2 years ago

Hello,

just post your code, and I will try to reproduce the effect. Are other examples working?

Best regards Ullrich

Hi, I think I figured out how the bug works. It happens only when I start a new project (usually I open another tab and let the first blank) and when I leave the application before even trying it out. When I say leave, I mean misscliking on the home button, then going back right after it on the application. So I think that leaving the app before first-trying a sketch, break the app or hard lock it

Best regards Sacha

Here's my code (for the second tab since the first is empty)

class complex{
  float real, imaginary;
  complex(float realPart, float imaginaryPart){
    real = realPart;
    imaginary = imaginaryPart;
  }

  void addComplex(complex other){
    real += complex.real;
    imaginary += complex.imaginary;
  }

  complex addition(complex z1, complex z2){
    float z3 = new complex(z1.real + z2.real, z1.imaginary + z2.imaginary);
    return z3;
  }

  void multComplex(complex other){
    float newReal = real * complex.real - imaginary * complex.imaginary;
    imaginary = real * complex.imaginary + imaginary * complex.real;
    real = newReal;
  }

  complex multiplication(complex z1, complex z2){
    float z3 = new complex(z1.real * z2.real - z1.imaginary * z2.imaginary, z1.real * z2.imaginary + z1.imaginary * z2.real);
    return z3;
  }

  void invertComplex(){
    float module = new PVector(real,imaginary).mag();

  }

}