I have one iPhone app but I want create a second one in xCode, which will use the first apps classes.
I create the second app and drag and drop classes from first app to second one ( i have not selected "Copy items into destination group's folder" because I want the first app to work as reference )
everything seems to be ok, but when I build my second app I have errors
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Message", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Has anyone experienced this same issue? Is anyone aware of a fix?
when u drag and drop the first app's data folder
You should check for "Create folder reference for any added folder" ,
Also then the color of dragged folder must change to BLUE instead of default yellow
Related
I am trying to implement the SVProgressHUD activity indicator. I copied the classes to my project and added the following code to my appDelegate but can't figure out why it crashes.
I get they following error and am not sure where to look to fix it:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SVProgressHUD", referenced from:
objc-class-ref in QuotesAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is the code:
#import "SVProgressHUD.h"
#implementation QuotesAppDelegate
- (void)startLoading
{
//call this in your app delegate instead of setting window.rootViewController to your main view controller
//you can show a UIActivityIndiocatorView here or something if you like
[SVProgressHUD show];
[self performSelectorInBackground:#selector(loadInBackground) withObject:nil];
}
- (void)loadInBackground
{
//do your loading here
//this is in the background, so don't try to access any UI elements
[self populateFromDatabase];
[SVProgressHUD dismiss];
[self performSelectorOnMainThread:#selector(finishedLoading) withObject:nil waitUntilDone:NO];
}
- (void)finishedLoading
{
//back on the main thread now, it's safe to show your view controller
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[self copyDatabaseIfNeeded];
[self startLoading];
}
Edit
The answer I provided (see My original answer) only fixes the problem, but it's not the correct solution. For correct solutions see Jim answer
It sounds like SVProgressHUD.m isn't enabled for your target. Click on
it in the project navigator in the left-hand pane, then look in the
file inspector in the right-hand pane to make sure there's a tick next
to the target you are building.
or Parth Bhatt link.
For the sake of completeness
Experimenting a little bit, I found that when you drag and drop file or directory within your project, Xcode (4.3.1) asks you to select the right option to add those files or dir to your project. Make sure that that "Add to targets" option is checked.
If you have missed to check that option, you need to following these steps:
Select YourProjectName
Select TARGETS
Select Build Phases
Add .m classes in Compile Sources section
My original answer
If you dragged those classes in your project, it could be the problem.
To avoid that compiling error, use "Add Files to YourProjectName" instead.
Suppose you have a directory that contains .h and .m files called "SVProgressHUD" in your desktop.
Now you have to:
Remove previous files (both .h and .m)
Click with right click in your project
Select "SVProgressHUD" dir with "Add Files to YourProjectName" (select the following check box options: Destination Copy items... and Folders Create groups for any...)
Hope it helps.
It sounds like SVProgressHUD.m isn't enabled for your target. Click on it in the project navigator in the left-hand pane, then look in the file inspector in the right-hand pane to make sure there's a tick next to the target you are building.
Checkout this link. Refer to accepted answer in this link:
Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error
If it still doesnt help then refer to Allen Pike's answer in the above link. try removing and adding back QuartzCore framework in your app.
Hope this helps you.
check if you have any objects that you could previously delete without knowing it
check if your all objects are connected , for example if you have a MapView but without a connection, it crashes down
if this doesn't work, try with cleaning the app, or just restarting your iPhone and Xcode
I resolved this issue by changing in Player Settings in the Unity Editor.
menu path:
PlayerSettings > OtherSettings > Scripting Backend change to IL2CPP from Mono2x.
Second change was to change the Architecture to universal.
I am trying to integrate dejalactivityview indicator view in my application, and I am running into this error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_DejalActivityView", referenced from:
objc-class-ref in WelcomeMessage.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This library is pretty easy to integrate and I am pretty sure I did everything correctly: added the .m and .h files, my project is ARC enabled and thats how I call the method:
[DejalActivityView activityViewForView:self.view];
Pretty simple, no? Still doesn't work...thanks for the help!
UPDATE:
I tried this:
DejalActivityView *testvc;
[testvc activityViewForView:self.view];
But I am getting an error (before compiling) that "no visible #interface for "DejalActivityView" declares selector 'activityViewForView:self.view'"
OK, I got the same thing just now. It seems if you simply drag the .m and .h files into your project, the .m file won't be added as source to link to your project, hence the link errors. What solved this for me was adding the DejalActivityView.m source file into the "Compile Sources" section under "Build Phases" of the project target. In other words, go to the Project Navigator and click on the uppermost item, then select the "Build Phases" tab, and then add the .m file to the "Compile Sources" section. Build and run your project again, and this time it should not have the linker errors!
what's your class name? make sure u spell correctly if again not work then change the class name. cz it some times that your class name matches with some built in name or some method name in project already in use
Check if you have actually copied the .m and .h files or you are just referencing them. Compiler might not be able to compile these files if you have not copied them to your project folder.
check this for
"no visible #interface for "DejalActivityView" declares selector 'activityViewForView:self.view'"
reply:- No need for a property for the DejalActivityView
please import this file in your viewcontroller .m
#import "DejalActivityView.h"
and write this code in viewdidload and check
[DejalActivityView activityViewForView:self.view];
if you have any error after that implement the download this from this link and implement , i use and work my code
I am trying to implement the SVProgressHUD activity indicator. I copied the classes to my project and added the following code to my appDelegate but can't figure out why it crashes.
I get they following error and am not sure where to look to fix it:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SVProgressHUD", referenced from:
objc-class-ref in QuotesAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is the code:
#import "SVProgressHUD.h"
#implementation QuotesAppDelegate
- (void)startLoading
{
//call this in your app delegate instead of setting window.rootViewController to your main view controller
//you can show a UIActivityIndiocatorView here or something if you like
[SVProgressHUD show];
[self performSelectorInBackground:#selector(loadInBackground) withObject:nil];
}
- (void)loadInBackground
{
//do your loading here
//this is in the background, so don't try to access any UI elements
[self populateFromDatabase];
[SVProgressHUD dismiss];
[self performSelectorOnMainThread:#selector(finishedLoading) withObject:nil waitUntilDone:NO];
}
- (void)finishedLoading
{
//back on the main thread now, it's safe to show your view controller
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[self copyDatabaseIfNeeded];
[self startLoading];
}
Edit
The answer I provided (see My original answer) only fixes the problem, but it's not the correct solution. For correct solutions see Jim answer
It sounds like SVProgressHUD.m isn't enabled for your target. Click on
it in the project navigator in the left-hand pane, then look in the
file inspector in the right-hand pane to make sure there's a tick next
to the target you are building.
or Parth Bhatt link.
For the sake of completeness
Experimenting a little bit, I found that when you drag and drop file or directory within your project, Xcode (4.3.1) asks you to select the right option to add those files or dir to your project. Make sure that that "Add to targets" option is checked.
If you have missed to check that option, you need to following these steps:
Select YourProjectName
Select TARGETS
Select Build Phases
Add .m classes in Compile Sources section
My original answer
If you dragged those classes in your project, it could be the problem.
To avoid that compiling error, use "Add Files to YourProjectName" instead.
Suppose you have a directory that contains .h and .m files called "SVProgressHUD" in your desktop.
Now you have to:
Remove previous files (both .h and .m)
Click with right click in your project
Select "SVProgressHUD" dir with "Add Files to YourProjectName" (select the following check box options: Destination Copy items... and Folders Create groups for any...)
Hope it helps.
It sounds like SVProgressHUD.m isn't enabled for your target. Click on it in the project navigator in the left-hand pane, then look in the file inspector in the right-hand pane to make sure there's a tick next to the target you are building.
Checkout this link. Refer to accepted answer in this link:
Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error
If it still doesnt help then refer to Allen Pike's answer in the above link. try removing and adding back QuartzCore framework in your app.
Hope this helps you.
check if you have any objects that you could previously delete without knowing it
check if your all objects are connected , for example if you have a MapView but without a connection, it crashes down
if this doesn't work, try with cleaning the app, or just restarting your iPhone and Xcode
I resolved this issue by changing in Player Settings in the Unity Editor.
menu path:
PlayerSettings > OtherSettings > Scripting Backend change to IL2CPP from Mono2x.
Second change was to change the Architecture to universal.
I am patching upp an application from iOS 4.2 to 4.3 using new xcode4.
With no changes made, except setting iOS to 4.3, I created entitlements and go!
Message I get is:
Undefined symbols for architecture armv6:"function", referenced from:
Ive tried to Clean the project, reinstalling xcode.
I uninstalled also the xcode4 demo version.
I also tried to set to Optimized armv7.
I would be very happy for some help, I'm stuck. Really.
Thanks very much in advance!
Here's how I got this problem:
I added a .h, .m and NIB from another project by dragging them onto my project navigator. Xcode didn't add them to the Build Phases properly.
My solution for this problem:
Click on the Project icon
Go to the Target in the navigator menu
Click on the "Build Phases" tab
Add the .m file to "Compile Sources" (either drag it across, or use the + button)
Add the .xib or Storyboard file to "Copy bundle resources"
Clean and build
For this type of error, this is what I typically see:
Undefined symbols for architecture armv6:
"_OBJC_CLASS_$_MyCustomController", referenced from:
objc-class-ref in SomeOtherController.o
ld: symbol(s) not found for architecture armv6
Almost every time I see this error it is caused by hidden/invisible characters in the import statement in SomeOtherController.h or SomeOtherController.m. So, look at both your .h and .m file, find the line that looks like this:
#import "MyCustomController.h"
Delete this line and retype it (do not copy/paste it -- you'll just repaste the offending hidden character).
Click on your Project name in the navigation window, choose the target you're building against, go to build phases, make sure the one Xcode's telling you that's missing is in there.
I had the same problem in Xcode5 for iOS7 with the TestFlight SDK. My issue was that the 'Build Active Architecture Only' was set to Debug only.
You can find the setting under 'YourProject'->'Build Settings'->'Architectures' Set the 'Release' option to 'Yes'.
This solved my problem - I hope it helps you, too! :)
I had this problem and I have just solved it.
It was a simple typo in the function name (forgot one letter) that caused the problem in my case.
I had the same problem in Xcode5 for iOS7 with the TestFlight SDK. My issue was that the 'Build Active Architecture Only' was set to Debug only.
You can find the setting under 'YourProject'->'Build Settings'->'Architectures' Set the 'Debug ' option to 'architecure arm7 arms7s'.
This solved my problem - I hope it helps you, too! :)
I had a similar issue popping-up all suddenly - more specifically, I was getting Undefined symbols for architecture armv6: "_OBJC_CLASS_$_CLLocationManager", referenced from: objc-class-ref in MyCLController.o
Note that I had CoreLocation.framework listed in my frameworks (in xcode' Project left nav, under the Frameworks folder); and had previously geolocation working just fine.
I got rid of the issue by re-installing CoreLocation.framework.
If you're not sure how to do that in xcode:
* click on your project in xcode left nav bar
* Go in the General tab of your project settings
* Navigate down - you'll see the list of frameworks installed under Linked Frameworks and Libraries
* Click on the + icon to add the CoreLocation.framework
In my case, I was doing this in a viewcontroller.m
#import <MediaPlayer/MediaPlayer.h>
Without doing Link Binary With Libraries with MediaPlayer.framework. After adding it, it compiled fine
recently I've been given a project which need to display a spherical panorama view. Normally on iphone i've been using panoramaGL for some time but for ipad, i dont have any luck to use it any more.
I can compile the lib with some minor warnings. but when i try to link the lib to my real project, it just keep telling me that PLTexture is not there. it says
Undefined symbols:
"_OBJC_CLASS_$_PLTexture", referenced from:
objc-class-ref-to-PLTexture in panoTestViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Please anybody can help me out of this?
I had the same problem, and noticed that although I included PanoramaGL xcode project, its lib (libPanoramaGL.a) was not selected to build with the target (that little checkbox in the top right list of XCode).
Once I selected the checkbox, the problem went away, but the bulider was stuck on a similar error with PLResources as the current trouble maker. But this might be only my problem, cause I went to the PanoramaGL project, and noticed that PLResources.c and .h were not included in the project.
Once I included them and rebuilt everything - the build succeeded.
Hope this helps,
Oded.