Xcode: command line error error: no such module 'XCTest' - ios

I'm trying implement unit test in some of my Swift Scripts but I'm getting this error:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XCTest.swiftmodule/x86_64.swiftinterface:6:19: error: no such module 'XCTest'
#_exported import XCTest
^
one.swift:3:8: error: failed to load module 'XCTest'
import XCTest
^
This is my script:
#!/usr/bin/swift
import Foundation
import XCTest
print("my script")
Any of you knows why I'm getting this error and if there is a work around this error?
I'll really appreciate your help.

Related

Error in importing ArraySliceDep from dask.layers

I got this error: ImportError: cannot import name 'ArraySliceDep' from 'dask.layers'
when I import stackstac. I have dask installed (2021.11.2 version) and my Python is 3.10 version

Getting errors when intl is imported

When i add intl: ^0.17.0 to pubspec.yaml
i get the following errors:
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib/intl_browser.dart:12:8: Error: Not found: 'dart:html'
import 'dart:html';
^
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib/intl_browser.dart:24:48: Error: Undefined name 'window'.
Intl.systemLocale = Intl.canonicalizedLocale(window.navigator.language);
^^^^^^
This only happens when the intl package is added.
How can i fix this?
The problem was that i had imported: package:intl/intl_browser.dart
instead of: package:intl/intl.dart

iOS KMP Command PhaseScriptExecution failed with a nonzero exit code

I have a Kotlin multiplatform project, I can build Android app, but I cannot build iOS app. The full error message below.
Exception in thread "main" java.lang.Error: /var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/9075457888541413881.m:1:9: fatal error: module 'FirebaseFirestore' not found
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:515)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:266)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)
:shared:firebase:messaging:cinteropFirebaseMessagingIos (Thread[Execution worker for ':' Thread 4,5,main]) completed. Took 6.427 secs.
Please help me on this, thank you so much.
If you dive deeper into the stacktrace you can find that cinterop fails with: module FirebaseFirestore not found
Possible solutions:
Make sure you reference firebase pods properly with the cocoapods gradle plugin: FirebaseFirestore instead of Firebase/Firestore for ex.
Check out the following issues if 1) is not a problem https://youtrack.jetbrains.com/issue/KT-42038 and
https://youtrack.jetbrains.com/issue/KT-47935

Unable to compile groovy script in Jenkins

The script is working fine in groovy console. But when I do check-syntax for the same script in Jenkins, the following error message is coming up -
Script1.groovy: 6: unable to resolve class groovyx.net.http.RESTClient
# line 6, column 1.
import groovyx.net.http.RESTClient
^
Script1.groovy: 4: unable to resolve class groovyx.net.http.ContentType
# line 4, column 1.
import groovyx.net.http.ContentType
^
Script1.groovy: 3: unable to resolve class groovyx.net.http.HTTPBuilder
# line 3, column 1.
import groovyx.net.http.HTTPBuilder....
How to get this issue resolved?
This exception is because you dont have these dependencies (Jars) that has these classes so you have two option :
1- if you currently using any dependency management framework like (maven,gradle) then just add these dependencies
2- in the groovy file at the top add #Grapes and then add the dependency here an example :
#Grapes(
#Grab(group='yourDependencyGroupID', module='yourDependencyArtifactID'
, version='theDesireVersion')
)
you can search for these dependencies in Maven Repository
i hope this will help :)

Imports failed in Config.groovy file (Grails 2.2.3)

I try to run a grails app thanks to grails run-app command. Version I use is grails 2.2.3.
All imports failed and I've got the "unable to resolve class" about all import line. For example :
unable to resolve class com.octo.captcha.component.image.backgroundgenerator.GradientBackgroundGenerator
Errors are about the following lines :
import com.octo.captcha.service.multitype.GenericManageableCaptchaService
import com.octo.captcha.engine.GenericCaptchaEngine
import com.octo.captcha.image.gimpy.GimpyFactory
import com.octo.captcha.component.word.wordgenerator.RandomWordGenerator
import com.octo.captcha.component.image.wordtoimage.ComposedWordToImage
import com.octo.captcha.component.image.fontgenerator.RandomFontGenerator
import com.octo.captcha.component.image.backgroundgenerator.GradientBackgroundGenerator
import com.octo.captcha.component.image.color.SingleColorGenerator
import com.octo.captcha.component.image.textpaster.NonLinearTextPaster
Here you can read these 2 files : Config.groovy and the return of "grails run-app" to help you : http://dl.free.fr/vPbCJEUnN
Thanks for your help !

Resources