App freezes on textfield after iOS 14 update - ios

after updating Xcode to Xcode 12 and upgrading my physical test device to iOS 14, I am having a peculiar problem with my app. I have two textfields for username and password, and if I fill out the username, and click on the textfield for password, the keyboard pops up but the apps CPU usage increases drastically to 99% and the app freezes. This has never happened before, and I haven’t made any changes that should cause this. I tested the same build on an iOS 12.4 and iOS 13.7 device, and they did not have the same issue. This seems to be happening only on iOS 14 devices. Another peculiar thing that happens is that if I fill out the password and then the username, the issue does not occur. I haven’t made any changes to textfields , the only thing that I am getting different from this build is that “archiveRootObject” has been deprecated. Could that maybe cause the issue here?
After debugging for a while I also found this weird message on Thread 1 “Application violated contract by causing UIApplicationMain() to return. This incident will be reported.” Has anybody faced this issue before?
EDIT: If I write a value in the username textfield, and then remove it, and then try to enter in password, the app works fine. Its only if the username textfield has a value before the password textfield has a value.

After many failed attempts at fixing the problem, and waiting for weeks until Apple answered my questions, the problem has finally been solved. It was actually just updating the "MaterialComponents" pod to version "119.1.0" that solved the issue. It took some time to update as we had problems with the pod but we eventually got it working. Thanks everyone for your help!

try this and restart your system
"Simulator -> Edit -> Automatically Sync Pasteboard" canel selected.
"Hardware -> Restart"
Device -> Restart

Related

Flutter: Lost connection to device in iOS Simulator Firebase

Following the steps of a tutorial (git/flash_chat_app), I got stuck when I write the code to get the connection with Firebase. The app runs very well (simple app). The problem is on the "Login" & "Register" buttons. After writing the email and password, when I press the button to submit the app crushes and I've got a simple "Lost connection to device" message. However, on Firebase the email is registered. So there is the connection but the app just crushes every time... I've read the posts about this subject but nothing similar to this issue.
I hope you can help, thank you
Ok found it...the whole day.
If anybody else faces this issue, I solved it just downgrading flutter (I had the last version 1.27xxxxx till this day). So on 1.26 I have no issue for the moment.

iOS 10 with XCode 8 GM caused NSUserDefaults to intermittently not work

NOTE: I have seen many other posts on Stack Overflow about NSUserDefaults being renamed to UserDefaults in Swift or not working on simulator until a restart. This is not a duplicate by anyway. Many of the questions SO is tagging against is from 4 years ago. My question is specific to iOS 10 from this year as this has always worked in older versions. I have mentioned in my question already that my question is not a duplicate of those questions as those were simulator bugs in swift and my issue is on device objective C bug. Please read the questions before marking as duplicate
My issue is different as I am able to reproduce this on objective C and on physical device itself.
I created a brand new project from scratch for this test. I placed this code in the viewDidLoad of a view controller:
if (![[NSUserDefaults standardUserDefaults] valueForKey:#"checkIfInitialized"]){
NSLog(#"setting checkIfInitialized as not exist");
[[NSUserDefaults standardUserDefaults] setValue:#"test" forKey:#"checkIfInitialized"];
[[NSUserDefaults standardUserDefaults] synchronize];
self.view.backgroundColor=[UIColor redColor];
self.mylabel.text=#"NSUserDefaults was NOT there, try running again";
} else {
NSLog(#"checkIfInitialized exists already");
self.view.backgroundColor=[UIColor blueColor];
self.mylabel.text=#"NSUserDefaults was already there this time, try running again";
}
Now if I run the app about 10 times, few times it finds the checkIfInitialized and sometimes it doesn't. No exact number on how many times it fails as it might work 3 times then fail next 2 times then work 4 times and fail once and so on.
Now something I have noticed (not 100% sure though) that the issue only seems to happen when I am testing connected via Xcode. If I run by launching the app by clicking the app icon on device without Xcode, then it seems to work fine but I can't be 100% sure.
I noticed this error occur sometimes:
[User Defaults] Failed to write value for key checkIfInitialized in CFPrefsPlistSource<0x1700f7200> (Domain: com.xxxx.appname, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null)): Path not accessible, switching to read-only
I have this very simple project on my dropbox if you want to test it out.
I would suggest testing about 10-15 times to reproduce this issue.
https://www.dropbox.com/s/j7vbgl6e15s57ix/nsuserdefaultbug.zip?dl=0
This works completely fine on iOS 9 so definitely something to do with iOS 10.
EDIT
Bug logged: 28287988
Response from apple DTS team:
First off, you should first determine whether standardUserDefaults or
valueForKey is failing. My guess is that “standardUserDefaults” is
returning NULL and, if that’s the case, then that’s something you
should be guarding against generally. Notably, standardUserDefaults
will return NULL if the preference file is encrypted in the
environment the app is currently running in (for example, preferences
is set to “NSFileProtectionComplete” and the app is running in the
background). That shouldn’t be an issue for standard foreground-only
apps, but it’s something to be aware of anyway.
It’s very likely that Xcode is actually inducing the problem here.
Xcode vastly complicates the app launching environment in a way that’s
VERY different than a standard app launch. My guess is that this is
basically being triggered by Xcode’s timing inducing an an expected
situation during the app launch, but if you want a more formal test of
that try setting a single breakpoint in applicationDidFinishLaunching
and continuing in the debugger as soon as you hit it. My guess is
just adding that disrupts the timing enough to stop the problem from
happening. Sort of. It’s iOS 10 only in the sense that iOS 9 will
never print that log message, but that’s because the log message was
added in iOS 10. The code itself is similar enough to iOS 9.3 that I
suspect exactly the same behavior is (at least in theory) possible in
iOS 9.
Yes, this is definitely a reproducible bug.
It happens with the GM release of Xcode 8 and iOS 10.
It is not the linked question referring to Swift.
It is not the linked question referring to beta versions of the Simulator.
The bug happens on devices and on the Simulator. It is intermittent: saving will work six times and then fail. Unlike you, I did not get the "failed to write key" message.
The bug also occurs when operating directly on the device without Xcode. This is in fact how I discovered it.
You should report a bug to Apple, especially since you have a short program that will reproduce it. I will do the same.
One key difference: In my case the failure is in writing the default. The previously written value remains in NSUserDefaults. Sometimes one key is successfully written while another is unchanged.
A similarly very intelligent DTS response from my own support request. Basically, killing using Xcode is more murderous than anything that would naturally happen on the device (even the double-Home-click-and-upswipe method) and since everything is abruptly crashed when Xcode halts it, the lazy writing of NSUserDefaults can fail, or be only half completed.
And indeed, pure on-device testing of the app, without Xcode involved, shows that everything does get correctly written to NSUserDefaults when the app is terminated.
I have closed my own bug report.

Simulator/device does not sync with iCloud

From time to time I'm getting errors that my iOS 8 device or simulator will sometimes not sync with iCloud (Drive). The following message appears (multiple times) in the output log:
CoreData: iCloud: Error: failed to receive initial sync notification
call back in 90 seconds
Only reinstalling the app helps.
Has anyone experienced the same issue or got some information about this?
I have seen that error (today) on an iPad running iOS 8. I fixed it by performing a reset (hold power and home/sleep buttons until the Apple logo appears). After that when I reran my app it synced immediately.
For the simulator it may be sufficient just to quit the simulator and relaunch. However, I have seen cases where restarting the computer was required.
I'm not sure what the cause of the issue is but hopefully the above help.

webrtcjingle disconnect crash on ios Lukeweber version

I just downloaded the lukeweber version of webrtcjingle, which I believe is just a branch of the google one.
I change the server and account setting on the demo and run it. It was able to log in and send/receive messages. However, When I tried to logout. The app crash.
I had a little debug on it, and found out the line of code that crash was in file txmppump.cc, function:
void TXmppPump::WakeTasks() {
talk_base::Thread::Current()->Post(this);
}
Does anyone have an idea what the problem is? I noticed that there is a fix on disconnecting problem issued caused by a race problem on the repo:
github bug list
However, I compared my code to the fixed version. They are the same. So I dont know if they are related or not.

Xcode Organizer - The service is invalid

I'm using XCode 4.3 (on Lion) and my iPod touch 2nd generation does show up, but displays "The service is invalid" (0xE8000022). I've tried every possible combination of restarting/reconnecting the device and have even restored the OS on the device... any ideas on how to further figure this out?
EDIT - initially I suggested restarting the device but I realized you had already done this.
I think this answer might be valid:
Error : The service is invalid

Resources