Why does my Xcode 11.2.1 (11B500) "Watch App" template fail? - watchkit

To familiarize myself with the process, before getting real, I tried to build a Watch-only app from the Xcode 11.2.1 template. The build fails when it attempts to copy an item into a file, instead of into a directory. I can hardly believe this isn't something corrupt in my Xcode environment, but it is happening on different Macs.
I created a new project with the "Watch App" template at ~/Development/Watch and ran xcodebuild from that directory. There is quite a lot of successful work done, but the last command (failing) in the build log is (with ... representing ~/Development/):
PBXCp .../Watch/build/Release-watchos/Watch\ WatchKit\ App.app \
.../Watch/build/Release-iphoneos/Watch.app/Watch/Watch\ WatchKit\ App.app
because
error: make directory
.../Watch/build/Release-iphoneos/Watch.app/Watch/Watch WatchKit App.app:
Not a directory
It's failing because .../Watch/build/Release-iphoneos/Watch.app/Watch is not a directory (nor should it be). Is this an Xcode bug (I've seen no reference to it from Apple or in Google searchs), or some stupidity on my part?

This is addressed in the GM Seed of Xcode 11.2.1. If you are writing a Mac Catalyst app, please also see the release notes for Xcode 11.2.1.
For any other issues you encounter while using Xcode, please file bug reports.

Found it!! A sneaky one too ..
It fails if you name the project "Watch" .. name it something else, it's OK.

Related

Error: Could not build Objective-C module 'Firebase'

When I compile the application I get an error equal to this:
Could not build Objective-C module 'Firebase'
This error appear in import Firebase of my file swift.
There is only one way to solve this issue.
Quit Xcode.
Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData
Delete ProjectName.xcworkspace
Delete Podfile.lock file and Pods folder
Run pod install.
Open the newly created ProjectName.xcworkspace file and build.
Build (⌘ + B) worked for me.
I am using Swift 4 and Xcode 9. All I have to do is selecting FirebaseCore Scheme.
On Xcode:
Product->Scheme->FirebaseCore.
If you don't have FirebaseCore go to Manage Schemes and select it. Then try again.
This may fix your problem:
Quit the Xcode. (Don't just close the Xcode window, right click and Quit it explicitly).
Go to ~/Library/Developer/Xcode/DerivedData and delete the project folder. (Simply delete all the folders).
Clean and Build the project.
If still error exist:
Do steps 1 and 2 and follow this steps:
Change scheme to Firebase and Build (Command + B).
Change back to your app scheme and Run again.
I opened the project with .xcodeproj and I installed Firebase with cocoapods. I got the same error. But I just close the project and open it with .xcworkspace.
The alert has gone. Firebase was the first library on my project. So I kept using .xcodeproj file.
Install FireBase properly via CocoaPods. Try the following steps
Step 1 - Close Xcode
Step 2 - Clear your derived data. You can find your derived data in here
~/Library/Developer/Xcode/DerivedData
Step 3 - Open your .xcworkspace
Step 4 - Clean your project (⌘+Shift+K)
Step 5 - Build your project (⌘+B)
Make sure your are opened .xcworkspace file
'pod deintegrate' and then 'pod install' worked for me.
I recently had this problem when using Xcode 12. I found that removing the Valid Architectures build setting (VALID_ARCHS) fixed it.
From the Xcode 12 release notes:
The Build Settings editor no longer includes the Valid Architectures build setting (VALID_ARCHS), and its use is discouraged. Instead, there is a new Excluded Architectures build setting (EXCLUDED_ARCHS). If a project includes VALID_ARCHS, the setting is displayed in the User-Defined section of the Build Settings editor. (15145028)
I am using Swift 4 and Xcode 9.4. This helped solve the same issue for me.
I selected the following frameworks in XCode -> Manage Schemes besides my target project
In Xcode:
Product-> Scheme-> FirebaseCore
Product -> Scheme -> nanopb
Product -> Scheme -> GoogleToolBoxforMac
Tried the above suggestions, but they didn't work for me. What worked for me was to build to Generic iOS Device first and then run it on my physical device iPhone6.
I still couldn't run it on a simulator, however. What worked here was to change Build Active Architecture Only - Debug to NO, in the Pod Project Build Settings.
Hope this helps someone.
This worked for me:
Close Xcode
pod deintegrate
delete xcworkspace
pod install
In project Navigator > project name > Configurations
Set all to none
Clean
Build
I had disabled Find Implicit Dependencies for faster build process under Edit Scheme... > Build.
Enabling it back resolved the issue.
It happened to me because I installed the Firebase CocoaPods but I didn't reopen it through the <projectName>.xcworkspace file.
So what I did to work was:
I quit Xcode
opened it by clicking the <projectName>.xcworkspace file of the project
then I could use "import Firebase" on my project.
For me the issue was simple. I have a new m1 mac and it has trouble loading cocoa pods sometimes. Simply:
Click your pods project(blue pods)->
Click all & build settings ->
Excluded architectures ->
add "arm64" to both debug and release ->
set any SDK on left side ->
do this on your main project folder too ->
build it your good to go
Can you please try to take a look at my answer here
TL;DR make sure you are running cocoapods version 1.4.0 minimum. It fixes static framework imports.
You can do this by running sudo gem install cocoapods on your terminal and verify your version by typing pod --version
I tried this (quitting Xcode, deleting all temp files, reinstalling pods, etc.) and it didn't work. What did work was just building my project (command + b) after pod install. Whatever works!
Make sure you are working with the workspace file created in the same directory as the pod file.
It worked for me, when I opened the white workspace instead of the blue one. You press on the file on your desktop and then press the white file.
Image of what the file looks like:
I had a same issue with a Flutter project.
You should exclude arm64 for simulator architecture both from project and every pod target
Exclude arm64 from the project
Add this code to Pofile
post_install do |installer|
installer.pods_project.targets.each do |target|
# exclude arm64 for simulator architecture the pod target
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
This happened to me today, I just couldn't figure out why, because when I closed the file that night, everything was perfect. I opened my file using the recent projects menu and got this issue. Then I decided to check something, Xcode opened the wrong file. Instead of opening the workspace file with the pods, it opened the Xcode project.
Once I opened the workspace it was error free and all the pods were behaving. Im sure you guys are all more experienced than me, but I just wanted to throw that in there.
just restart your xcode and run your project.
Nothing here worked for me, but then I figured out something that did work.
When I clicked on my project in Project Navigator in Xcode, and then selected Info I looked at the Configurations section and saw that there was only a Release configuration and no Debug configuration for my app.
In order to get Firebase to work, I went to Pods within the Project Navigator, and under the Configurations section I deleted the Debug configuration. Now it builds fine. Hopefully this will help someone else.
After 2 days of searching and trying every single step proposed in this post, eventually i could solve the problem. None of the above approaches solved my problem but this one:
There is a package of Firebase frameworks available to download from this link:
https://firebase.google.com/download/ios?authuser=0
There is a Firebase.h header file in this package. I added this header file to my project resources.
Finally i added a line of code at the top of this file:
' #import "Firebase.h" '
Simply and Easily the error is gone!
For and Solution was as simple as I didn't open the project from the .xcworkspace after I did pod install :D and I got the same error you got.
I mistakenly opened it from the old .xcodeproj file.
that was it for me, LOL
None of above solutions worked for me. I found that the problem was I have three targets in Cocoapods file. And only my main one target has Firebase added. So that when I want to import Firebase to a file that is used in other targets, Xcode gives error and says Module 'Firebase' not found. This is my pods project file. One solution for me is adding Firebase pod to all targets. Or another solution is removing the file from other targets.
def common_pods
pod 'XXX'
end
target 'myMainProject' do
common_pods()
pod 'Firebase/Core'
pod 'Firebase/AdMob'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
end
target 'myExtention1' do
common_pods()
end
target 'myextension2' do
common_pods()
end
Just go to Pod target and set arm64 in Excluded Architectures
This solution worked for me.
Delete project's temp files located at
~/Library/Developer/Xcode/DerivedData
Delete ProjectName.xcworkspace
Delete Podfile.lock file and Pods folder Run pod install.
Open the newly created ProjectName.xcworkspace file and build.
When you build, make sure you are at the root directory in the project navigator.
This worked for me:
rm -rf project.xcworkspace
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf Podfile.lock
pod install
/!\ Open project.xcworkspace instead of your old file
I had the exact same issue
You could be reinstalling pods with your Xcode open
Or your pods file won't allow and overwrite
With your workspace open, delete the "Pods" folder.
Quit X-Code
Open terminal in "Utilities"
You'll find this in "Applications"
Using cd ... go to your project folder
reinstall pods using "pod install".
That should fix it.

Cannot find c:\Users\qt\work\install\lib\Qt5Widgetsd.lib when compiling QtWebEngine examples

I downloaded Qt5.6 VS2013 32bit and try to run the official example of QtWebEngine.
I just followed the instruction but
When linking it gives out an error of
LNK1104 file not found c:\Users\qt\work\install\lib\Qt5Widgetsd.lib.
However, I have no idea of where this path c:\Users\qt\work\install\lib\ comes from.
I did text search in all directories of example folder and no hits other than generated files(makefiles and pdbs).
I also checked system environment variables but no hits.
Furthermore, I checked Qt Creator'r Projects panel and its Build Environment and still no hits.
Did I miss something?
P.S. this error was given out by linking DemoBrowser example of QtWebEngineWidgets pro
The link is generated by qmake when it generates the build scrip from the qt project file (*.pro). It is based from the qmake application path that is generaly installed together with the libraries (check you qt kit setup to change it if needed: Jst browse to qmake.exe application).
Then try regenerate the build script. It should fix the issue.
You may also have issue with installation not being in debug mode; you are trying to use Qt5Widgetsd.lib library instead of the non-debug one Qt5Widgets.lib

Build Kobold2d project from command line

I posted this on the Kobold2d forums but haven't received any replies yet. I'm hoping the larger audience here at SO can help.
I'm trying to get our Kobold2d project working with our Hudson CI server. I'd like to have a script that executes the proper command line build instructions using xcodebuild, but I'm running into a problem with any Kobold2d project.
As a test I created a Orthogonal-Tilemap template project and built/ran it in the xcode 4.4.1 gui successfully. Building the projects individually from the command line the Kobold2D-Libraries.xcodeproj reports a successful build (though I have no idea where any products are stored), but the tilemap project fails with the message:
ld: file not found: <path>/Kobold2D/Kobold2D-2.0.3/BuildTest/build/Release-iphoneos/libkobold2d-ios.a
The only information I can find on this message talks about errors from building in the xcode gui, which is not the problem.
I also tried having xcodebuild build the workspace file but that failed with multiple dependency errors.
Has anyone found a way to successfully build Kobold2d projects from the command line?
Thanks!
Actually I use Hudson to automate Kobold2D builds. Here's the build script for Hudson.
I can see from your path that you changed Xcode's default build locations (Advanced, next to Derived Data in Preferences -> Locations). There's one setting (legacy) that doesn't work at all with Kobold2D, and should actually open a browser window explaining the issue should you have used that setting.
I think your setting is "relative to project" or something similar. Try changing the build location to Xcode default (Unique) and try again. You can use a custom location for derived data if you want to.
In any case, if the output location path of build products ends up being somewhere in the app project folder (in this case: BuildTest) then ld won't be able to find dependencies because they're not all in the same folder. If you do require this you could add a pre-link step that copies the .a files to the correct location. But it's best to avoid this because it'll be prone to breaking.
My script includes
xcodebuild -workspace Bulge.xcworkspace -scheme Bulge-iOS -sdk ${sdk} archive || die "Archive failed"

Launching Springsource tool giving some error

Fow the last few days I used to work on STS. But today it is not launching and giving following window. So, I reinstalled STS. But the problem still exits. Can some one help in sorting it out?
I found the solution after few hours. Some guy had same problem and solved
here:
Eclipse is trying to get the version of java that is installed on system. you might have installed that latest one but there are possibilities that any upgradation of later softwares has replaced the java.exe files in system32 folder with older version. All you need to do is to run eclipse with clean parameters. Create a batch file in the directory where eclipse.exe is and write this line in it eclipse -clean -vmargs -Xmx256m

Xcode 4 (final version) error when building

I can't seem to find the answer.
I've just used Xcode 4 final version and built an existing project that was built ok with Xcode 3, but got this error:
ld: library not found for -lSystem.B
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
But another project was built OK with Xcode 4.
I installed Xcode 4 by choosing the default options.
Do I miss to include a library or framework somewhere?
Could somebody please help. Thank you.
Here's my solution for Xcode 4.0.2 with SDK 4.3 environment, but I believe it should also work on other setups.
libSystem.B.dylib is not present
under
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib,
however it is present for lower SDK
versions (e.g. iPhoneOS4.2.sdk)
most of the cases
libSystem.B.dylib is just a
symbolic link to libSystem.dylib
so in
iPhoneSimulator4.3.sdk/usr/lib
I've applied following command sudo
ln -s libSystem.dylib
libSystem.B.dylib and my simulator
builds started to work again :)
NOTE: libSystem.B.dylib is used by Flurry and Urban Airship so you better don't delete the reference in project file (of course Urban Airship does not work under Simulator, but I think Flurry does. libSystem.B.dylib may also be required by other libraries you included to your project.
UPDATE: solution still works for iOS5 Simulator after upgrading to Xcode 4.3
UPDATE, March 9th, 2k12: for Xcode installations via App Store, prefix above path with /Applications/Xcode.app/Contents or the path where you've installed Xcode.app.
Solved.
Turns out that there was a reference to libSystemB in my project (Don't know why it's there). After deleting the reference, it built well.
Thanks anyway guys!
-weak_library /usr/lib/libSystem.B.dylib breaks the iOS Simulator.
Use -weak-lSystem instead.
The quote belongs to gparker on the official dev forums.
-weak_library /usr/lib/libSystem.B.dylib breaks the iOS Simulator. Use -weak-lSystem instead.
nicktmro got it right, especially when you are developing cocos2d projects using xcode 4.x
I have the same problem since months and always kept making the symbolic link as described here everytime i updated xCode. Today I found a nice new way to fix this:
In your targets Build Phases go to 'Link Binary With Libraries' and search for:
libz.dylib
Set from 'Required' to 'Optional'
BUILD
BE HAPPY

Resources