Instamojo/ios-sdk

Module compiled with Swift 4.0.2 cannot be imported in Swift 4.1

Opened this issue · 12 comments

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

Is anyone going to fix this issue or not?

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

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

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.

How do you know

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

hi adiahuja07. when will get that... ios

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

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.