JetBrains / kotlin-native

Kotlin/Native infrastructure
Apache License 2.0
7.02k stars 564 forks source link

ld: framework not found AFNetworking #4749

Closed HorseFarmer-Ma closed 3 years ago

HorseFarmer-Ma commented 3 years ago

image

  1. cd shared, and then execute "gradlew podspec"

    cocoapods {
        // Configure fields required by CocoaPods.
        summary = "RealtimeDB-ServerLess"
        homepage = "XXXX"
    
        ios.deploymentTarget = "13.5"
    
        pod("AFNetworking") {
            source = git("https://github.com/AFNetworking/AFNetworking") {
                tag = "4.0.0"
            }
        }
    }
  2. cd iosApp, and then execute "pod init"

  3. my podFile is =>

target 'iosApp' do

  use_frameworks!
  use_modular_headers!
  platform :ios, '13.5'
  pod 'shared', :path => '../shared'
end
  1. cd iosApp, pod install

  2. After build in xcode, I receive the error

    
    Ld /Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Products/Debug-iphonesimulator/iosApp.app/iosApp normal (in target 'iosApp' from project 'iosApp')
    cd /Users/80238163/AndroidStudioProjects/CloudStoreKMM/iosApp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios13.2-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -L/Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Products/Debug-iphonesimulator -F/Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Products/Debug-iphonesimulator -F/Users/80238163/AndroidStudioProjects/CloudStoreKMM/iosApp/../shared/build/xcode-frameworks -filelist /Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/x86_64/iosApp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/x86_64/iosApp_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/x86_64/iosApp.swiftmodule -ObjC -lc++ -framework AFNetworking -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/iosApp.app-Simulated.xcent -framework Pods_iosApp -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/x86_64/iosApp_dependency_info.dat -o /Users/80238163/Library/Developer/Xcode/DerivedData/iosApp-aqnpdwxnfnxltcbhyxitjndbdwfj/Build/Products/Debug-iphonesimulator/iosApp.app/iosApp

ld: framework not found AFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)



How can i do! 
SvyatoslavScherbina commented 3 years ago

How did you create this issue?

"New issue" button on the kotlin-native issues page on GitHub website opens the following page for me: https://github.com/JetBrains/kotlin-native/issues/new/choose. It doesn't seem to have an option to create new issue on GitHub on my side.

So did you use a custom GitHub client or whatever?

HorseFarmer-Ma commented 3 years ago

How did you create this issue?

"New issue" button on the kotlin-native issues page on GitHub website opens the following page for me: https://github.com/JetBrains/kotlin-native/issues/new/choose. It doesn't seem to have an option to create new issue on GitHub on my side.

So did you use a custom GitHub client or whatever?

image I create this issue by click "new issue", so can you help me resolve this problem, thanks

SvyatoslavScherbina commented 3 years ago

Please ensure you open iosApp.xcworkspace in Xcode, not iosApp.xcodeproj.