Skip to content
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

Module compiled with Swift 4.0.2 cannot be imported in Swift 4.1 #20

Open
rohit9412 opened this issue Mar 31, 2018 · 12 comments
Open

Module compiled with Swift 4.0.2 cannot be imported in Swift 4.1 #20

rohit9412 opened this issue Mar 31, 2018 · 12 comments

Comments

@rohit9412
Copy link

Problem is with latest version of Xcode v9.3.
Please fix this issue ASAP.

@rohit9412
Copy link
Author

Is anyone going to fix this issue or not?

@adiahuja07
Copy link

Has InstaMojo stopped supporting iOS? I have found nothing online that can help me intergrate it in Xcode 9.

@tanalavijay
Copy link

Iam also facing with same issue ..if found any solution plz tell me

@adiahuja07
Copy link

I have talked to the support team at instamojo, they will be releasing an updated SDK in some time. Till then we will just have to wait.

@tanalavijay
Copy link

tanalavijay commented Jun 25, 2018 via email

@adiahuja07
Copy link

How do you know

@tanalavijay
Copy link

tanalavijay commented Jun 25, 2018 via email

@adiahuja07
Copy link

Not today... I'll let you know when it will be available

@tanalavijay
Copy link

tanalavijay commented Jun 25, 2018 via email

@RajuPrasad2
Copy link

hi adiahuja07. when will get that... ios

@mohsinalimat
Copy link

same error in Xcode 10.2 version
Error: Module compiled with Swift 4.2 cannot be imported by the Swift 5.0 compiler

@cybenauts
Copy link

After several days I found a solution the the existing issue (build on latest version of Xcode/Swift), follow the instructions below -
1- Install the pod from (https://docs.instamojo.com/page/ios-sdk) into your Project
2- Close the project and download the Git folder from (https://github.com/Instamojo/ios-sdk)
3- Unzip & open the folder & delete Instamojo.framework
4- Now open the Instamojo workspace in the latest version of Xcode
5- Build for any simulator (select any simulator and build) (if faced with issues like pod not found goto Project->Targets->Build Phases->Remove and re-add linked binaries i.e pod file)
6- Build for Generic iOS Device
7- Goto Build Phases & add the Run Script

UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal

if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"

xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build

cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"

cp -R "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/." "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule"

lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"

cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"

open "${PROJECT_DIR}"

fi

8- Build again, this will open your Instamojo folder locate Instamojo.framework copy it.
9- Go to your project -> Pods->Instamojo replace Instamojo.framework
10- Now clean & build your project, after this you can run your project on any simulator/device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants