Updated to latest version and now get _OBJC_CLASS_$_UIDevice error

262 views
Skip to first unread message

in...@uppersetting.com

unread,
Mar 16, 2016, 8:54:54 PM3/16/16
to j2objc-discuss
I have a OS X application which previously worked.  I'm not sure I have added J2ObjC correctly to my project.  First I convert my Java code to Objective-C.  Next I add the code to my project.  Finally I follow these steps which previously worked.  Any help would be greatly appreciated.

1. Download J2ObjC from GitHub, create a target directory then extract the contents of the zip file.

2. From the Project navigator view, click on the HelloClient node then select the  Build Settings  tab. Make the following changes (substitute the directory you extracted the J2ObjC files too for $distribution-path):
a.In User Header Search Paths, add $distribution-path/include

b.In Library Search Paths, add $distribution-path/lib.

c.In Other Linker Flags, add -ljre_emul. (jre_emul is J2ObjC's JRE emulation library).

Finally, select the Build Phases tab, open the Link phase and add:
a.The libz.dylib library, needed to support java.util.zip.

b.The Security Framework, to support secure hash generation.

c.The libicucore.dylib library, needed to support java.text.

Tom Ball

unread,
Mar 16, 2016, 11:22:22 PM3/16/16
to j2objc-...@googlegroups.com
Sounds like UIKit isn't being linked in -- Foundation.framework always needs to be linked into any j2objc app, and UIKit.framework with any iOS app. To check, select your app's target, select the Build Phases section and expand the "Link Binary with Libraries" section. It should look something like this:

frameworks.png

The libicucore.dylib library is no longer required, but it won't hurt to still include that in the list.

--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Ball

unread,
Mar 16, 2016, 11:23:00 PM3/16/16
to j2objc-...@googlegroups.com
Also, the framework order in this list doesn't matter.
Message has been deleted

in...@uppersetting.com

unread,
Mar 17, 2016, 3:53:50 AM3/17/16
to j2objc-discuss
OK I got my iOS application to work with your instructions.  In order to get my OS X application to compile I had to change the lib path to j2objc/lib/macosx. 
Thank you

Tom Ball

unread,
Mar 17, 2016, 10:14:22 AM3/17/16
to j2objc-discuss
Right -- Xcode started checking the device as well as architecture info of .o files in 7.0, so we could no longer share the x86_64 arch between the iOS simulator and OS X. Instead of just dropping OS X support, we instead moved the libraries for it to their own library path.

vishnusa...@gmail.com

unread,
Jan 31, 2017, 3:54:01 AM1/31/17
to j2objc-discuss
Yes, cleared my issues.
Reply all
Reply to author
Forward
0 new messages