Could not locate login item in the caller's bundle error when using SMLoginItemSetEnabled - swift

I'm trying to get my swift Mac app to launch at login using the method described in this page: https://theswiftdev.com/how-to-launch-a-macos-app-at-login/
However, I keep getting the following errors as soon as I call SMLoginItemSetEnabled:
Could not locate login item com.domain.LauncherApplication in the caller's bundle
Could not enable login item: com.domain.LauncherApplication: 3: No such process
I checked that the launcher app ID is correct multiple times, I tried changing it and changing its version number. I even tried cleaning the project and moving the base app to /Applications but I always get these error messages.
Any idea what the problem might be? (Notice the solution must not require me to disable App Sandboxing)

OK, I found the problem but it took a long time since it was so sneaky: In the Copy File Build Phase section I entered "Contents/Library/LoginItem" as the subpath instead of "Contents/Library/LoginItems" (notice the 's' in the end - can't believe I missed it). So thank you #vadian! You were absolutely right.

Related

Suddenly receiving firebase database error when logging in through app: " Evaluation error: NSURLErrorDomain: -1003"

I am currently working on an IOS app built through Swift on Xcode. Firebase packages are installed using Cocoapods, and all pods are updated. Additionally, I double-checked that the Plist and Google-Service Info files are correct.
This is the full error line I receive when logging into the app and trying to retrieve user information from the database:
nw_proxy_resolver_create_parsed_array [C3.1.1 proxy pac] Evaluation
error: NSURLErrorDomain: -1003
I am unable to figure out how to resolve this issue as there were no changes in my code and it was working beforehand perfectly.
I can provide code snippets if needed but since the app was working prior, I am assuming this isn't related to my code.
The only time I was able to solve this issue temporarily was to reset the package caches through XCode, allowing me to view posts and other content pulled from the firebase backend. Unfortunately, after I restarted the app, this solution did not work anymore, and the same error from above popped up. Since resetting the package caches worked initially, I am assuming there is no direct correlation between the error and my source code.
Does anyone have any idea as to ways I can solve this issue? It has prevented me from working on my app for several days now. Thanks for any help!
Update: After looking over my code one more time, I found that there was a missing dot in a line of code, leading to my IOS app not running. This did NOT solve the error of nw_proxy_resolver_create_parsed_array [C3.1.1 proxy pac] Evaluation error: NSURLErrorDomain: -1003, but since the app is working successfully, my problem is solved.

Hosted app: “Installation of this item may not work properly”

My hosted app is showing a floating banner with a notice saying “Installation of this item may not work properly.” on its Google Chrome Web Store product page. The app is undiscoverable by searching the Web Store.
What is causing this problem? I find no additional information in the developer dashboard.
If you get this message, it is probable that there really is an error in the manifest or locale files (For example, in my case it was a trailing comma on the locale files).
The process y follow to solve the problem was:
Try to instal the app version you have just submited to the chrome store. When you try to install the app you will probably get a error message thats points you on the track of the problem of your manifest file.
Solved the problem on the app and upload it again. You may get the same error on the developers panel. Two thinghs can be appening:
A) If you've already corrected all errors in the manifest files remenber to publish the changes and what is more important remenber that the publication process may take a few minutes to become effective. The message will disappear after a while if everything is okay. (This explains why is you look on the internet for that problem you find people saying that the message will disappear after a while)
B) If error persist event after the publishing process have been complete finished. You may have not solved all error on the manifest file go back to Step 1
cheers
I had this exact problem. When I tried installing, I got an error message about a missing file.
When I removed my locales directory, everything worked fine.

How To Build and Compile PJSIP for Xcode, Using sample code IPJSUA to test?

How to build and compile PJSIP using xCode and run the sample code IPJSUA?
First, you need to open the terminal. Terminal can be found at Applications->Utilities->terminal.
After you open the terminal, make sure you point to the desktop to make it easier to get the data folder. just type :
cd Desktop
Congrats, you already at your desktop. Now continue to type this.
svn co http://svn.pjsip.org/repos/pjproject/trunk pjproject
That code means you download the pjproject from the website to your desktop. After you finish download the PJSIP, you need to add a config_site.h. Honestly, I don't what should we do that, but just follow it. :D
How do you create a config_site.h? Just copy the config_site_sample.h, paste, and change the content become like this.
After this, we need to change the configure-iphone. I figured it out. If you just want to run at simulator you need to change the DevPath. If you want to test on device, just leave it be.
Now, I will give example to run on the Simulator. Open pjproject and you will find the configure-iphone. Open the file using a text editor and change the DEVPATH and hardcode the IPHONESDK.
The devpath will looks like this.
DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
Remember, this refers to the path to your Xcode app. If you want to make sure, go to finder->applications->xcode->show package contents. I also hardcoded the IPHONESDK.
IPHONESDK=iPhoneSimulator5.1.sdk
After you're done with that, we will going back to the terminal. Make sure you already at the pjproject folder. Type this.
export CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc
export CFLAGS="-O2 -m32 -miphoneos-version-min=5.0 -g -ggdb -g3 -DNDEBUG"
export LDFLAGS="-O2 -m32"
After that, you can configure it. Just click this on terminal. If you want to test on your device, you don't need to change the configure-iphone, export CC, etc., just directly configure-iphone.
./configure-iphone
After you're done, continue by entering the commands below to build the library and all dependencies. This line below is where the magic happens and it needs to complete successfully for you to continue.
make dep && make clean && make
You will find that all the libraries will compile. The resulting library can help us if we want to create a new project. -> this is what I'm thinking right now.
Now you almost finished, just go to the pjsip-apps->src->ipjsua. You will find the Xcode project, just click it to open at your xcode. Click build and run. You will find the interface like this.
If you want to test on your device, you must have the certificate and private key chain. I can't explain that because I got that certificate from my company. They provide it.
If you want to try, you must create a SIP account first. You can use sip2sip or ekiga. At here I tried ekiga. for example my SIP is 12345678#ekiga.net and 87654321#ekiga.net.
After the simulator we key in +a to add new account.
Next you will have to type your SIP name. remember to type "sip:". dont ever forget. here is the example:sip:12345678#ekiga.net.
After that you will have to type the URL address, just type ekiga.net since that is our URL. This URL means our server. Tor example, sip:ekiga.net.
Next is the auth realm. Type the same as the URL address, sip:ekiga.net.
Next is your username. In here my username is 12345678. You don't need to add sip or type with #ekiga.net.
Last is your password. After you register, it will automatically add it to the account. Just go to the textfield, and hit enter. It will refresh for you.
Next, we need to add buddy. Type +b, and you must input the URI address. Type sip:87654321#ekiga.net and you are done. Back to the textfield, it will add automatically to your buddy list.
You will see that your account still in offline mode. You need to change into online mode before you make a call. Just change the status by type t, and hit enter.
After that you can make a call by type M. and type 1. because our buddy is no 1. 1 is their ID. and you can make a call.
Please check below link. You can get source code from there and biuld for both device and simulator.
https://github.com/radif/SIPHON-SIP-Client-that-actually-compiles
For XCode 4.5
->
export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/
export IPHONESDK=iPhoneSimulator5.1.sdk
export CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc

How to handle bootstrap error in xcode 4.2,ios5.0

I did two sample applications in ios.Both applications i have done using storyboard.Then after i did i copied the two classes of one application to another.Then i saved and compiled,it worked>But second time when i build the application and when i run that application,am getting error like this:
Couldn't register BundleIdentifier.application name with the bootstrap server.Error:unknown
error code.
This generally means that another instance of this process was already running or is hung in the debugger.(gdb)
How to resolve this error?Please give me some suggestions in resolving this issue.
The reason for this error is that you are testing app in either simulator or device and suddenly change for another without stopping it.
For this you need to properly close app from navigator before moving for another ios selection.
if encounter this problem then restart xcode and simultor(also reset simulator).

Invalid or missing URL scheme hackbook

I am trying to use facebook ios sdk but when I run the Hackbook example it gives me the error message "Invalid or missing URL scheme. You cannot run the app unti you set up a valid URL scheme in your .plist" Where do I make the changes for this?
Since one of the answers mentioned it, I will say that I have already modified the plist to have fb[my_app_id] in the URLSchemes.
This tutorial walks you through the process step by step, search for "Modify the app property list file".
I figured it out. There was another instance in the code where the ID needed to be replaced. What's odd is that it's not specifically called out as far as I can tell. I did a search for it.
you have to add like this
100% works and solved crash