Crash on iOS after editing a TextArea

69 views
Skip to first unread message

Arne Sikström

unread,
Jan 5, 2014, 11:34:30 AM1/5/14
to codenameone...@googlegroups.com
I have two TextAreas in a Form. If I start to edit the first one and the press "Next", everything is fine, but when I press "Done" on the last one I get a NPE. This works on the simulator and also worked a couple of days ago on the device.
The log in Xcode is not very helful:
Jan  5 16:45:55 Arnes-iPhone-4S kernel[0] <Debug>: launchd[594] Container: /private/var/mobile/Applications/XXX (sandbox)
Jan  5 16:46:00 Arnes-iPhone-4S MyApp[594] <Warning>: [EDT] 0:0:3,517 - postMain
Jan  5 16:46:12 Arnes-iPhone-4S kbd[112] <Warning>: -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](754): CoreData: Ubiquity:  mobile~XXX:UserDictionary
Using local storage: 1
Jan  5 16:46:12 Arnes-iPhone-4S kbd[112] <Warning>: -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](754): CoreData: Ubiquity:  mobile~XXX:UserDictionary
Using local storage: 0
Jan  5 16:46:20 Arnes-iPhone-4S MyApp[594] <Warning>: [EDT] 0:0:23,805 - Error type: java.lang.NullPointerException
Jan  5 16:46:20 Arnes-iPhone-4S MyApp[594] <Warning>: [EDT] 0:0:23,809 - Current Form: Main
Jan  5 16:46:20 Arnes-iPhone-4S MyApp[594] <Warning>: [EDT] 0:0:23,813 - Exception: java.lang.NullPointerException - null


I have even removed all hand made code in that Form(Main) but I still get a crash.

I am quickly running out of trouble shooting options here, any ideas?


Arne Sikström

unread,
Jan 5, 2014, 12:55:00 PM1/5/14
to codenameone...@googlegroups.com
I made a simple test case for this. Is this a regression for r1665 or r1666?
package userclasses;

import com.codename1.io.Log;
import com.codename1.ui.Button;
import com.codename1.ui.Container;
import com.codename1.ui.Form;
import com.codename1.ui.Label;
import com.codename1.ui.TextArea;
import com.codename1.ui.events.ActionEvent;
import com.codename1.ui.events.ActionListener;
import com.codename1.ui.layouts.BorderLayout;
import com.codename1.ui.layouts.BoxLayout;

public class MyApp {

private int numb = 0;

public MyApp() {

}

public void start() {
Log.p("start in Myapp");

Form main = new Form("Test of TextArea");

TextArea firstArea = new TextArea(3, 20);
TextArea secondArea = new TextArea(3, 20);
final Label label = new Label("Some text");
Button actionButton = new Button("The action starts here");

actionButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
numb++;
label.setText("Pressed: " + numb);
}
});

main.setLayout(new BorderLayout());

Container center = new Container(new BoxLayout(BoxLayout.Y_AXIS));

center.addComponent(firstArea);
center.addComponent(secondArea);
center.addComponent(label);
center.addComponent(actionButton);

main.addComponent(BorderLayout.CENTER, center);
main.show();
}

}



Shai Almog

unread,
Jan 5, 2014, 2:18:11 PM1/5/14
to codenameone...@googlegroups.com
Thanks, this was fixed in the server 90 minutes ago or so.

Arne Sikström

unread,
Jan 5, 2014, 4:49:47 PM1/5/14
to codenameone...@googlegroups.com
Now it works, Thanks.
Reply all
Reply to author
Forward
0 new messages