2

I have a simple shared project with a couple of Pojos

After running the gradle tasks:

./gradlew clean build j2objcXcode

and running pod install in my iOS app I get the below error when running the app in xcode:

ld: library not found for -lPods-iosApp-j2objc-shared

Am I missing a step here?

My machine details:

OSX 10.10.4 java version "1.8.0_40" gradle 2.4 xcode 6.4 CocoaPods 0.34.2

brunobowden
  • 1,492
  • 19
  • 37
metters_nz
  • 23
  • 3
  • Please let me know if this solved your issue. I'd appreciate the feedback. – brunobowden Jul 21 '15 at 18:11
  • Your original answer to delete the *.a file under Frameworks and then deleting the entries in the OTHER_LDFLAGS argument got me past my original error. Now the plugin is complaining that it cannot find the guava library - see the updated gradle issue -> https://github.com/j2objc-contrib/j2objc-gradle/issues/273 – metters_nz Jul 21 '15 at 21:59
  • I understand #273 was fixed by removing the slash? If this fix works without doing the workaround, please mark it correct so others can benefit in the future. – brunobowden Jul 22 '15 at 01:38
  • I will retest on a new project this evening and update this question – metters_nz Jul 22 '15 at 01:39

1 Answers1

1

You must open the MyProject.xcworkspace instead of the MyProject.xcodeproj file.

This is a requirement when working with CocoaPods, which the j2objc-plugin uses to configure Xcode. See answer: https://stackoverflow.com/a/28111728/1509221. If you mistakenly open the xcodeproj, then it will be missing the required "Pods" project. This is a screenshot you should see when opening the xcworkspace:

Community
  • 1
  • 1
brunobowden
  • 1,492
  • 19
  • 37