Codename One: App broken after iOS build - intellij-idea

I have been building my App for Android repeatedly without any errors. I know tried to also build it for iOS which would not work, since I now know that I need a Mac.
After that, I tried to build it again for Android and now everything seems broken. IntelliJ tells me everywhere that it "can't resolve Symbols" and "can't resolve methods". I tried opening and closing the IDE and also restarted the computer, tho I am not able to make a successful build again. This just started after the failed iOS build.
Here is a Screenshot for you, those are very simple lines, there is no reason for them not to work. I am really clueless right now what wrong.
Maybe someone of you has an advice for me? I can only repeat, i did not change the code at all, but it just won't compile anymore, neither in the simulator nor with the Android build.

That may be due to a missing or corrupt CodenameOne_SRC.zip and/or CodenameOne.zip and/or JavaSE.jar files.
Solution:
Create a new dummy Codename One project, right click on the dummy project and select Properties then click the Update Project libs button. Once it's done, close the dialog and right click the project again, then navigate to Codename One -> Refresh cn1lib files.
Now close the dummy project and minimize your IDE and go open your Dummy project folder in your file explorer. Now copy the CodeNameOneBuildClient.jar and JavaSE.jar found in the main folder to the relative path of your faulty project, replace them if already exist. Do the same for CLDC11.jar, CodenameOne.jar, CodenameOne_SRC.zip that are found in the lib folder of your dummy project.
Go back to IntelliJ and right click on your faulty project and navigate to Codename One -> Refresh cn1lib files, then clean and build your project.
This should fix any reference or missing class issues.

FYI, you don't need a Mac to build an iOS project in Codename One.

Related

Xcode build stuck at DataModelCompile `momc`

I have a project which builds fine a month ago. Now I tried to open it again but I am stuck with building the project in Xcode. Upon checking it from the Report Navigator tab, it shows that there was an error on DataModelCompile about a missing inverse property.
I was able to get through this by suppressing the momc warnings in Build Settings. But when I build the project again, I am still stuck at DataModelCompile. This time it doesn't say anything helpful aside from outputting the exact momc command.
I have tried the following so far but nothing works:
Clean project and rebuild
Delete DeriveData folder and rebuild
Clean, delete DereveData, close Xcode and rebuild
Remove xcdatamodel, build project, close Xcode, delete DeriveData put back xcdatamodel and rebuild
Please tell me I'm not the only once experiencing this. It is really frustrating that a project that used to work is broken now without anything changed.
Any help is appreciated!
Note:
I am using the latest version of Xcode (7.1.1)
The project is using CoreData with 3 versions of xcdatamodel
I also tried checking out an earlier version of the project but I still encounter the same problem

ConnectionKit app not opening on other Computers

I created a Mac app that uses ConnectionKit to connect to a server using FTP. Today I went to export the file and use it on another computer only to find that the app does not open entirely on a different computer.
On the development computer, the app functions completely, but on another computer, it opens, the icon stops bouncing in the dock, and the name of the app is shown in the menu bar, but the first view controller and window are never opened.
The menu is also not visible. It just shows the app title and nothing else.
I assume that this has to do with ConnectionKit, but I checked the package contents of the exported bundle and ConnectionKit is in there under Frameworks.
Here are the steps I took to include it.
I downloaded ConnectionKit using git clone
I downloaded each git submodule using git submodule update --recursive --init
I dragged the ConnectionKit.xcodeproj file to my Frameworks directory in the project explorer
I added ConnectionKit from the workspace into the "Link Binary with Libraries" section
I added a new "Copy Files" build phase.
I changed the destination to "Frameworks"
I added the ConnectionKit.framework from the Products of the ConnectionKit.xcodeproj to the copy files phase.
The build phases tab looks like this:
This doesn't seem to work. The application just sits there and doesn't launch the app on any computer other than the development computer.
What am I doing wrong here?
You need to run the app in Xcode under the debugger on one of these other computers. It sounds very likely that you are getting a raise at launch. Seeing the raise in the debugger would doubtless shed light on the cause, which might or might not even have anything to do with ConnectionKit. :-> You could also look at the console logs generated by your app, in Console.app (in Applications/Utilities/), but actually getting the raise in the debugger is generally more useful unless the problem is something very obvious.

Xcode builds on Debug but not on Release

So, I have this problem when trying to build my project.
Currently If I run the project in Debug mode, it runs fine, the app starts up on the device and I can test stuff.
However the weird part is when i switch over to the Release build and try to build on the device. When I press the Run button Xcode builds as normal and the build succeeded notification even pops up, but then I get this error code.
Lets call my app xxx
Could not launch "xxx.app"
No such file or directory:
/Users/*my Name*/Library/Developer/Xcode/DerivedData/*Bunch of xcode folders*/Products/Release-iphoneos/xxx.app/xxx
I went into finder and searched up xxx.app and couldn't find it. Furthermore there doesn't even exist a Library folder under /Users/my Name/.
So what is xcode trying to do here, and what should I do to fix this?
Edit: I have also tried Cleaning the project and building again, the error code still comes up.
I get this crap all the time.
What I do is clean the project, close it, shut down Xcode, start up Xcode, open project, then build and run.
If that still does not work then find the "DerivedData' folder Organizer->Projects and delete it, then do the above again and try again.
I tried creating a new scheme and setting it to Release mode. That worked for me. However, a reboot after closing xCode seems to work, too.
I went into finder and searched up xxx.app and couldn't find it. Furthermore there doesn't even exist a Library folder under /Users/my Name/.
It does exist, but it's hidden (since OSX Lion) in the Finder (because standard users -- as opposed to developers -- should not mess with it).
Some utilities (on a simple command line) can make it visible again but the simplest thing to do is to use "Go" menu of the Finder and select "Go to folder…" (Command-Shift-G). Then copy/paste the path you want to go to and validate.

UIKit.h not found error

I made a single view app for the ipad, with a movie, webview and button, and I get this error when I try and run it. I have restarted the application, and reinstalled it, but nothing is working. This error keeps coming up in my MoviePlayer_Prefix.pch file. Can someone help me out?
I have had the same issue with being unable to compile project due to UIKit.h not being found + "unable to load standard library for target..."
The solution for me was very simple - to quit (CMD+Q) and relaunch Xcode. I have found out that with Xcode opened, macOS seems to have removed command line tools for Xcode because it was preparing for a update and relaunching Xcode triggered the "install additional components" update and it made the problem disappear.
Like Faul Textor said, most likely your XCode updated to 12.1 but your Command Line Tools didn't. You need to quit XCode completely and then start it again and you should get a pop-up saying "Install Additional Components"
Sorry, this should have been a comment to his reply but I cannot do that.
It sounds like you removed the UIKit.framework from your project at some point. Check if it is listed in your project navigator. If it's not there, go to your project in the project navigator pane, select your target, go to the build phases tab, click on link binary with libraries, hit the plus button, find the UIKit.framework there and add it to your project.
EDIT:
This answer suggests that there mayb be an issue with your framework search paths build setting. Check that out and if the path is empty and it still doesn't work, a re-install of Xcode would fix it, I think.
Just wanted to add my two cents on not making a dumb-ass mistake - came across this answer hoping to solve same problem.
Turns out I had written #import "<UIKit/UIKit.h>" instead of #import <UIKit/UIKit.h>.
Thought I would add in case someone else makes a simple mistake like me.

Couldn't load a xcode project because it is already opened from another project or workspace

I have a project that has one target dependency. The target dependency is dependent on a framework called Three20.
The dependency tree looks like this.
myProject
-> myCustomFramework
-> Three20
When I tried to build and run I get the following error message.
Workspace Integrity Couldn't load Three20.xcodeproj because it is
already opened from another projet or workspace.
I have only one project open. Any suggestions on why I am getting this message?
Quitting the xcode completely and opening it up again worked.
Quitting Xcode alone didn't work for me. What I did was:
File->Close Workspace/Project on every open workspace.
Xcode->Quit
Open Xcode again and open troublesome workspace
I have close the Xcode completely but IT didn't work. I have killed the procces and It did finally!!!
:-)
Had the same problem in a case where I got a workspace working, closed it, copied the containing folder to a USB drive, then reopened. I got that message for one of the projects in the workspace. Closed, tried again, removed/re-added project - no luck. Closed, tried to open the project alone and got the message about it being open in another workspace - not true. Quit XCode, restarted by double-clicking my workspace in Finder, and all went well after.
I had same problem. Fixed after updating of cocoa pods with pod update command.
Restart the computer and try again opening the project :)