StoreKit 2 Runtime error: connection to service named com.apple.storekitagent - swift

When performing StoreKit 2 operations in my Mac app, even very simple ones like AppStore.sync() a small but steady percentage of users experiences the following error:
systemError(Error Domain=NSCocoaErrorDomain Code=4097 \"connection to service named com.apple.storekitagent\" UserInfo={NSDebugDescription=connection to service named com.apple.storekitagent})
Rebooting or re-downloading the App from the Mac App Store, as well as signing out and in again on the Mac App Store does not solve the issue.
Strangely enough all of the affected users I'm aware of were initially able to perform In-App purchases via the said app. Without any updates or anything else however suddenly after a restart of the app the above error gets thrown by the system.
As I have not found any way to solve this issue yet and the said customers are consequently left without service even though they are paying customers, I am desperate to find help with this issue.
Given the simplicity of the AppStore.sync() method for example I can't imagine the solution to lie in code, but I might of course be wrong.

Related

Google play list this error Broadcast of Intent { act=android.accounts.LOGIN_ACCOUNTS_CHANGED

I got following error on google play store but I have no idea why this error occured. They said that it is happing on (Sharp AQUOS sense2 SH-01L Android 9 (SDK 28) ).
I have logcat but I can't find anything in logcat too. I already released to production. This one is my bugs fixed for new release.
ANR in com.google.android.apps.tachyon;PID: 18069;Broadcast of Intent {
act=android.accounts.LOGIN_ACCOUNTS_CHANGED flg=0x5000010 cmp=com.google.android.apps.tachyon/com.google.apps.tiktok.account.data.device.DeviceAccountsChangedReceiver_Receiver };
A similar Error occurred for me as well.
"ANR in com.google.android.apps.tachyon" at same device "Sharp AQUOS sense2 SH-01L"
E/ActivityManager(1566): ANR in com.google.android.apps.tachyon
E/ActivityManager(1566): PID: 18457
E/ActivityManager(1566): Reason: Broadcast of Intent { act=android.intent.action.LOCALE_CHANGED flg=0x11200010 cmp=com.google.android.apps.tachyon/.common.applifecycle.LocaleChangeReceiver }
I believe this device has com.google.android.apps.tachyon app is installed by default and an automatic update for this app could be running in the background (just a guess) which crashes anytime.
The crash is just a coincidence.
It will not happen every time with the same app and with the same use case. It will also not happen with any other device. just update the versionCode and publish the App again.
One other option is to go to the device catalog and mark this device as not supported.
After a lot of research, I think I have finally solved this for my app.
In my case, other than my main activity, the other Activies were only called by my app. In my activities in my AndroidManifest.xml, I had
android:exported="true"
Of course, this allows these activities to be invoked by other external activities/etc
By changing this to:
android:exported="false"
...it prevents the activity from being called.
In my case and going through the logs, I didn't see anything that jumped out and bit me but my research led me to believe that com.google.apps.tiktok.* was some sort of old transactional piece of Android. Also, I noticed my Tutorial activity was logging well after it should have been.
My suspicion is the test may actually be real and intended to check for either Activities handling external launches or checking for a security injection of some kind.
I think the use case is likely that an Android user is changed on the phone (usually at end of these robo tests), ticktok handles that and sends this intent/message to all externally known Activities. If so, that would mean either the Activities have to not be exported or handle the intent appropriately.
Anyhow, this change helped me tremendously and I haven't hit this with this app since after about 100 robo tests. Hope it helps someone else.
I think this is a problem with Google Play Store testing devices. Problems went away without me making any changes on a new release.

Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service _after_ implementing AdMob

I just integrated AdMob into my project and I get a whole bunch of these error messages in the Xcode output.
The app does not communicate w/ the internet and does not open up WKView (all I found n SO was references to WKWebView like this https://stackoverflow.com/a/44623268/14414215 but doesn't seem to be related to me since I don't use WKWebView). All I did was integrate Google-Mobile-Ads using cocoa pods and followed the Admob support pages.
Some SO Pages talk about ATS, but google support pages don't have the same error message (https://developers.google.com/admob/ios/app-transport-security)
App Transport Security has blocked a cleartext HTTP (http://) resource
load since it is insecure. Temporary exceptions can be configured via
your app's Info.plist file.
Its happening both on simulator and real device. Is this a real issue or something I can ignore?
Also, there's a ton of messages coming out from the Admob SDK, it's frankly a bit annoying to filter through.
The Messages in the console remains and does not seem to affect the app performance (AFAICT) and while it is excessive, I have silenced them some-what using environment variable ( https://stackoverflow.com/a/64471106/14414215) in my scheme. (per below pictures)
Take note however, if you do have issues w/ Google-Mobile-Ads, please be reminded to remove this such that you will be able to see the console messages.

Sending custom app logs to developer

I'm planning to release a new app in the future.
I have a custom logging function which logs some application data (not crashes) into a file (location manager state, app foreground-background transitions, main actions...). These logs helped me a lot to debug problems which were app-related, but not causing a crash. Until now these were in the documents directory (shared in iTunes) and the testers sent them to me after they saw some incorrect behaviors, however I don't want to share them anymore because this directory contains the app's database too.
I'd like to obtain these logs even when the app will be on App Store, but I don't know how this should be done. As I wrote, it is a new app and even after the test phase may exist minor bugs. I know that the users can report problems in iTunes or on the Dev site, but without a detailed scenario or log it is really hard to correct a bug. Should I make some kind of in-app bug report functionality (even if this creates a wrong user impression) ? How is this usually handled ?
Edit1 : I'd want these logs only if the user thinks something went wrong and should be analyzed, otherwise I don't really need them. I think some kind of user action is needed to confirm that something isn't working as intended, that's why I asked about making a functionality ( like the "Report a problem" in the Maps App ).
Thanks
If your app is gonna crash, don't submit it to AppStore because more likely it will be refused.
I don't know your app but usually logging slow down things. But if you really want logging I would suggest you to first find out if application crashed. For instance in your appDelegate when the app is terminated without problems set some NSUserDefaults value like closedSuccesfully=YES. Just after you start app set closedSuccesfully=NO, but if it was set to NO before it means your app crashed last time. In that case you could grab your previous logs and try to send them to your server via http post message. On your server there might be very simple php script to get that data. That way it will be automated and your users wouldn't have to do anything and you would get all crashes even these not reported.

PayPal iOS Sandbox gives Error 520002, Network Timeout and Session Time Out

I have created a buyer test account in the PayPal sandbox and have used it to attempt to make a purchase via PayPal both in their Simple Demo App and in my own project. Running the app gives back a variety of errors such as Error ID 520002 or Network Timeout or Session TimeOut.
It has never successfully run a purchase.
I've read that these errors are due to bugs in the Sandbox. Anybody hear or know anything else?
Also, is there anything that I am possibly doing that is causing these errors? In other words, how do I get this to work!
I have just integrated the simple Demo App in my own app, I run into the same problem: Make sure you added not only the Paypal.h and so but the frameworks too.(there are three to guarantee the connection).
I got rid of the complicated buttons and methods, only stayed with the simple payment function, one button, and the adjustTaxes function. Works fine.
Maybe you are doing something more complicated, if you explained further.
Let me know if you want to take a look at same code.

How do YOU handle crashes in your iPhone apps?

If been looking around the web and can't seem to find any good solutions to sending allowing your user to submit bug reports from your iPhone app.
How do you handle crashes and exceptions?
Do you send the error user-data to a server,
grab a log file from somewhere and attach,
or do you ignore it and pretend it never happened?
Anybody got any experience with this?
Update
I am aware of how to prepare you software testing it with Static Analysis, Leak Detection, User Testing etc.
But errors might still happen when a user (mis)using my software. Always assume your user is trying to break your software.
What I want to figure out is how (I, or rather the app) can provide me with useful data when/if errors happen. As they do even in top quality products – like my own ofc. :)
I'm looking anyone that has experience with allowing the use to send error reports, stack traces, logs etc. to see how they handle the problem.
Some people use built-in analytics like Flurry which will post exception data to Flurry's website which you can review later.
Also, Apple has a "crash log" reporting area on iTunes Connect, but I'm not sure if it works since I've yet to see something come through and I kinda doubt each and every person has run my apps flawlessly. Not saying I write poor code (hopefully), but not every device is created equal either so I have to imagine it has crashed at least ONCE. There's always the option of logging and sending to a server later though.
Most of the time though, if you give users your e-mail address within the app itself (like on an instructions or about screen), they will e-mail me about any issues. That's a little bit nicer since it gives you a chance to correct the issue before they hit the review forms on iTunes.
You can also try BugSense. It's free, realtime, error reporting for iOS
PS: I am one of the founders.
Crashes most of the time comes with problems of memory management. To test memory leaks and find in your code on to what areas you were leaking a memory. Use the Instruments if your using XCode.
In your XCode go to Run -> Run with performance tool -> Leaks.
You can check everything here when it comes to memory allocations.
Note: To avoid crashes, make sure you released objects correctly and check your scheduled timers as well.
Regards,
ZaldzBugz