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

No such module 'ClevertTapSDK' #115

Open
maxim-ivanchuk-idf opened this issue Sep 7, 2022 · 9 comments
Open

No such module 'ClevertTapSDK' #115

maxim-ivanchuk-idf opened this issue Sep 7, 2022 · 9 comments
Assignees

Comments

@maxim-ivanchuk-idf
Copy link

maxim-ivanchuk-idf commented Sep 7, 2022

No such module 'ClevertTapSDK'

In my project, I use various libraries (written in Objective-C as well as Swift). To be able to use libraries written in both languages, I have to use use_frameworks! directive in my Podfile. If I use this directive, I am not required to use bridging header for any other library written in Objective-C. I can just use import ModuleName and use it.

But, when I install CleverTap SDK via Podfile and try to do import CleverTapSDK, Xcode is giving me error as "No such module CleverTapSDK"

@maxim-ivanchuk-idf maxim-ivanchuk-idf changed the title **No such module 'ClevertTapSDK'** No such module 'ClevertTapSDK' Sep 7, 2022
@maxim-ivanchuk-idf
Copy link
Author

maxim-ivanchuk-idf commented Sep 12, 2022

this error only when run from xcode
running successfully from command line and from android studio

@akashvercetti
Copy link
Contributor

@maxim-ivanchuk-idf , would it be possible for you to create an empty sample mixed language app and link us to it for us to be able to debug the issue better?
Thanks

@SarojMaharjan
Copy link

I am experiencing this issue when the project is run using VSCode. But it is okay with Xcode.

Version used: clevertap_plugin: ^2.4.0

Here is debug console output:
`Launching lib/main_development.dart on iPhone 15 Pro in debug mode...
Xcode build done. 145.0s
Failed to build iOS app
Swift Compiler Error (Xcode): No such module 'CleverTapSDK'
.../ios/Runner/AppDelegate.swift:2:7
AppDelegate.swift:2

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.

Exited (1).`

The clevertapSDK is in folder: /ios/Pods/CleverTap-iOS-SDK-CleverTapSDK

Any idea how to fix this issue?

@gyan786fyers
Copy link

gyan786fyers commented Sep 14, 2024

I am also getting the same error. Please help us with this CleverTap Team!
@SarojMaharjan have you found any solution for this>?

Launching lib/main.dart on iPhone 15 Pro in debug mode...
Xcode build done. 37.6s
Failed to build iOS app
Swift Compiler Error (Xcode): No such module 'CleverTapSDK'
/Users/gyanprakash/Documents/mobile_main_flutter_v2/ios/NotificationService/NotificationService.swift:9:7
NotificationService.swift:9

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.

Exited (1).

@SarojMaharjan
Copy link

SarojMaharjan commented Sep 20, 2024

@gyan786fyers I have not been able to resolve this issue yet. I am currently using xcode to build the app.

@nishant-clevertap
Copy link
Contributor

HI @maxim-ivanchuk-idf @SarojMaharjan @gyan786fyers

Can you guys share the podfile and pubspec file which you are using for our SDK?

@gyan786fyers
Copy link

gyan786fyers commented Sep 20, 2024

@nishant-clevertap
Sure , Here it is
in the pubspec.yaml I am using
clevertap_plugin: ^2.4.0

podfile

Uncomment this line to define a global platform for your project

platform :ios, '12.0'

CocoaPods analytics sends network stats synchronously affecting flutter build latency.

ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), FILE)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

pod 'FBSDKCoreKit'

flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
config.build_settings['SWIFT_VERSION'] = '5.0'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end

target 'NotificationService' do

Comment the next line if you don't want to use dynamic frameworks

use_frameworks!

Pods for ct_integration

pod 'CleverTap-iOS-SDK'#, '~> 3.9.4'
pod 'CTNotificationService'
end

@SarojMaharjan
Copy link

@nishant-clevertap
Here is the clevertap entry in pubspec.
clevertap_plugin: ^2.1.0

And here is podfile:

Uncomment this line to define a global platform for your project

platform :ios, '14.0'

CocoaPods analytics sends network stats synchronously affecting flutter build latency.

ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Barberinos-mobile-app', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), FILE)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Barberinos-mobile-app' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
target 'Barberinos-mobile-appTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)',
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
'PERMISSION_LOCATION=1','PERMISSION_NOTIFICATION=1']
end
end
end

@gyan786fyers
Copy link

@nishant-clevertap @akashvercetti any update on the above issue we are not able to build the app on ios?

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

No branches or pull requests

6 participants