-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
j2objc 0.9.8.2 and Xcode 7 not yet supported - "ld: library not found for -lj2objc_main" #466
Comments
What are the full errors in: |
I can't attach txt files so I'll have to plop them here, but it says essentially the same thing: See file:///Users/a/parati/java-core/build/tmp/linkDebugTestJ2objcExecutable/output.txt for all output for linkDebugTestJ2objcExecutable. Finished linkDebugTestJ2objcExecutable, see full log file:///Users/a/parati/java-core/build/tmp/linkDebugTestJ2objcExecutable/output.txt. Also in the directory [/Users/a/parati/java-core/build/tmp/linkDebugTestJ2objcExecutable/] is the "options.txt" that has this: -o |
What is the output of |
@andrewfunston : please do answer the above, but I think I know the problem. j2objc_main was moved into the Mac-only builds with 0.9.8.2 to support Xcode 7. The plugin only supports j2objc 0.9.8.1 and Xcode 6 at the moment. I've updated the title to reflect this. |
This is going to be a non-trivial amount of work. A lot of our tasks assume iOS and OSX use the same files. Let's discuss on Wednesday @brunobowden |
@andrewfunston - if you can use Xcode 6 / j2objc 0.9.8.1 you should try doing so; this will take a while to get working on Xcode 7 / j2objc 0.9.8.2. |
Sorry for the delay, as for the first request: as-MacBook-Pro:~ a$ ls -al /Users/a/install/j2objc-master/dist/lib/ Right now I only have it generating the sources which works well enough for my exploratory purposes. (i.e. setting j2objc.translateOnlyMode=true). Thanks for your help. |
Refactor of native compilation to support separate ios vs. osx libraries. Issue j2objc-contrib#466
Hello @andrewfunston - I believe this is fixed. Would you like to be a guinea pig for us? =) Please ensure you have Xcode 7 and j2objc 0.9.8.2.1. And please build the plugin directly from head (see https://github.com/j2objc-contrib/j2objc-gradle/blob/master/CONTRIBUTING.md sections "Local Development" and "Testing on your own Gradle project"). Let us know if you have any difficulties. |
cc @kirkvogen |
Verified against my own internal app that Xcode 7 support is now working for iOS device, iOS simulator, and OSX desktop apps. |
Hi @advayDev1 , thanks for the work on XCode 7 version support!
And as a result I have link errors for every j2objc class I use in the project. |
@maxbritto in your build.gradle's j2objcConfig section please add:
I'm intrigued as to what OS versions you are building for that i386 is relevant (we thought it was just for 32-bit simulators so removed it from the default set). This is unrelated to Xcode 7 though. |
It was for the iPhone 5 simulator. I did some more tests and without adding the modifications to the gradle file I can build for a real iPhone or for the simulators starting at iPhone 5S. The iPhone 4S and iPhone 5 simulator have the link error. |
To be clear:
So @maxbritto everything is working for you overall? |
That is exactly that and yes, everything is working for me know, thanks for your help :) |
np - @maxbritto thanks for being a guinea pig. |
I built it and tried out the new version locally. I can build my project with the new plugin version, but in Xcode I get linker errors saying that it cannot find my classes that were translated from Java. Also, if I add the -mios-version-min=8.0 as extraObjcCompilerArgs, I get additional build errors (error: 'CSSM_SAMPLE' is unavailable: not available on iOS). |
Apologies: I'm afk until Wednesday, I'll run through it when I get back On Mon, Oct 5, 2015, 2:08 AM Advay Mengle [email protected] wrote:
|
@kirkvogen, can you please paste the exact Xcode errors you get? Does your linker log have anything like:
If so add to the top of your build.gradle's j2objcConfig section: Also Instead of using -mios-version-min=8.0; you can now add to the top of your j2objcConfig: |
@advayDev1 Hey, success! I did need to add the |
@advayDev1 Also, I can now run the |
Thanks @kirkvogen ! Good to know everything's working for you. If any of you on this thread who have the basics working and need to try some of the more advanced stuff (multiple projects, custom external libraries, etc.), check out #490 and please provide any feedback directly on that PR regarding things that are unclear. @brunobowden - any luck getting your project working again with Xcode 7? |
It's working like a charm for me on Xcode 7. I've got it working for the
I was expecting the simulators to fail since it wasn't linking to the osx On Mon, Oct 5, 2015 at 8:37 PM Advay Mengle [email protected]
|
No the simulators need the appropriate architecture on iOS sysroot, not the OSX sysroot. I think the commit got that right. The only thing left for Xcode 7 is your bug #488 - which is for OSX based unit tests and apps, not for simulators |
I have experienced a couple of issues that it get in the way a bit. Sometimes Xcode crashes while the Gradle plugin is running. Also, build time is a bit of an issue. If I don't change any Java files, the build is a second or two. If I change a Java file, it often stays at the I've watched the CPU during this long pause and it is typically around 3% utilized. This makes me wonder if it is some kind of file or I/O issue. I've tried setting |
I think my performance issue might be due to a source JAR that I'm translating and building (hamcrest). I shouldn't need to translate and build it anyway, since the J2ObjC comes with hamcrest pre-built, right? |
I corrected the project to use the built-in JUnit and Hamcrest. The performance issue appears to have gone away. I can make a Java source change, rebuild, and takes about five seconds. I added the following into
|
Yeah you did everything right. @kirkvogen , I've filed #492; we might as well add the new 0.9.8.2.1 libraries since we've made that a minimum requirement now. |
It works for me! I had to reverted back to b7f4aad to get it functioning, the current head fails unable to link to the protobuf_runtime, but I assume that's part of a WIP. Let me know if I need to run through anything else. |
@andrewfunston - could you expand at #498? Protobuf runtime is neither known to work nor known not to work, as neither Bruno or I use them at the moment. |
I've searched a bit and found nothing that seems similar. I've also checked my build environment vs the docs + FAQ and haven't found anything out of line. I'm new to j2objc and was trying to get a minimal build environment running. I followed the recommendations for build environment setup from the j2objc docs.
j2objc version was a pull/build from master from today (9/26/2015), but I tried with the release version ".9.8.2" with the same results.
Sorry for the image of my build.gradle, it kept failing when I had it converted to a .txt, etc. Very odd.
The error is as follows:
:java-core:x86_64DebugJava-core-j2objcStaticLibrary
:java-core:linkDebugTestJ2objcExecutable
ld: library not found for -lj2objc_main
clang: error: linker command failed with exit code 1 (use -v to see invocation)
:java-core:linkDebugTestJ2objcExecutable FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':java-core:linkDebugTestJ2objcExecutable'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
The text was updated successfully, but these errors were encountered: