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.1 cannot be imported in Swift 4.1.2 #26

Open
adiahuja07 opened this issue Jun 18, 2018 · 8 comments
Open

Comments

@adiahuja07
Copy link

Is there anything that can be done from my side to fix this issue? or do the developers need to update their code?

@mohsinalimat
Copy link

mohsinalimat commented Aug 31, 2018

I have also same problem and I also ask his/her support but no reply from him/his...

screen shot 2018-08-29 at 3 31 23 pm

@vivektakrani
Copy link

Did anyone find the solution for this?

@mohsinalimat
Copy link

mohsinalimat commented Nov 15, 2018 via email

@vivektakrani
Copy link

Actually, I just spoke to their customer care executive & she said there's some technical glitch in their iOS SDK, a team is working towards fixing it, but don't know when it will be resolved...

@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

@ajaysaini58
Copy link

@mohsinalimat I'm also getting the same error. It seems the support is not available for Swift 5 or Swift 4.1.2.

@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.

@karthi-ios
Copy link

Thanks @cybenauts for the updates.

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