pod lib lint failed to validate a Kotlin multiplatform library - kotlin-multiplatform

we are following the KMM documentation to build a very simple library available for our IOS and Android apps.
Following the sample project generated by android studio for a KMM library, we were able to install and intergrate manually the library built, in a IOS project.
Now we are trying to publish this library on cocoapod and make it available for installation.
The lib is called shared.. a shared.podspec is generated..
if we run
pod lib lint shared/shared.podspec --verbose
we have an error
`Testing with xcodebuild.
-> shared (0.3)
- WARN | url: The URL (https://github.com/OUR_REPO_URL) is not reachable.
- WARN | http: The URL (``) doesn't use the encrypted HTTPS protocol. It is crucial for Pods to be transferred over a secure protocol to protect your users from man-in-the-middle attacks. This will be an error in future releases. Please update the URL to use https.
- WARN | [iOS] license: Unable to find a license file
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using new build system
- NOTE | xcodebuild: note: Using codesigning identity override: -
- NOTE | xcodebuild: note: Build preparation complete
- NOTE | [iOS] xcodebuild: note: Planning
- NOTE | [iOS] xcodebuild: note: Building targets in dependency order
- NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')`
Scrolling up to the error I got:
`
/bin/sh -c /Users/andreadg/Library/Developer/Xcode/DerivedData/App-aamafucqqbvtfsfaselpdjormnrg/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/shared.build/Script-46EB2E000002E0.sh
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME -Pkotlin.native.cocoapods.archs="$ARCHS" -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
FAILURE: Build failed with an exception.
* What went wrong:
Directory '/' does not contain a Gradle build.
A Gradle build should contain a 'settings.gradle' or 'settings.gradle.kts' file in its root directory. It may also contain a 'build.gradle' or 'build.gradle.kts' file.
To create a new Gradle build in this directory run 'gradlew init'
`
Project structure below
enter image description here
Any idea?
also
pod repo push fails
we tried to publish the library manually ignoring the lint , and it installed with no errors but it fails later during the build of the ios project.
kdoctor doesn't give any error. All good.

Related

Oracle JET : Unable to build ojet hybrid project after upgrading xcode to Version 12.0 (12A7209)

This morning I updated my xcode to Version 12.0 (12A7209) and since then I am not able to build the project for ios
Replication steps
ojet create testapp --template=navbar
cd testapp
ojet add hybrid
ojet build ios
Getting the below error
.........
In module 'Foundation' imported from /Users/hellonuh/Desktop/testapp/hybrid/platforms/ios/build/emulator/include/Cordova/CDVAppDelegate.h:20:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:595:1: note: 'stringByAddingPercentEscapesUsingEncoding:' has been explicitly marked deprecated here
- (nullable NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)enc API_DEPRECATED("Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.", macos(10.0,10.11), ios(2.0,9.0), watchos(2.0,2.0), tvos(9.0,9.0));
^
3 warnings and 3 errors generated.
Cordova compile finished.
Error: Error: Command failed: cordova compile ios --debug --emulator
** BUILD FAILED **
The following build commands failed:
CompileC /Users/hellonuh/Library/Developer/Xcode/DerivedData/testapp-hfsgwahghfnpzecdcshskgzlpyep/Build/Intermediates.noindex/testapp.build/Debug-iphonesimulator/testapp.build/Objects-normal/x86_64/CDVWKWebViewEngine.o /Users/hellonuh/Desktop/testapp/hybrid/platforms/ios/testapp/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
xcodebuild: Command failed with exit code 65
Please help

iOS file patterns: The `source_files` pattern did not match any file

I am trying to create a CocoaPod and when I try pod lib lint there's an error about ERROR | [iOS] file patterns: Thesource_filespattern did not match any file.
I am trying to follow BlinkingLabel pod as an example and using Gitlab for storage of my .git . I tagged it successfully 1.0.0 and it worked for it.
I used my CocoaPod in Example for Pod and its working but I got the error:
Ignoring unf_ext-0.0.7.5 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.5
-> BlinkingLabel (1.0.0)
- ERROR | [iOS] file patterns: The `source_files` pattern did not match any file.
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
- NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
[!] BlinkingLabel did not pass validation, due to 1 error.
You can use the `--no-clean` option to inspect any issue.
My source_file prop is:
s.source_files = 'BlinkingLabel/Classes/**/*'
But I've tried it with:
s.source_files = "BlinkingLabel/**/*"
s.source_files = 'BlinkingLabel/BlinkingLabel.swift'
s.source_files = 'BlinkingLabel/Classes/**/*.{h,m,c}'
No one has worked for me in lint.
And there's a strange thing.
In the article and examples it recommended to use with BlinkingLabel/Classes/**/* but there's nothing any directory as named Classes in BlinkingLabel, I guess because of new update of CocoaPod or maybe something is different in new CocoaPod. Can you explain this?
And how to solve this problem for pod lib lint at all?
Edit: I've searched over stackoverflow but nothing work for me.
Thanks in advance.
For anyone who stuck at - ERROR | [iOS] file patterns: Thesource_filespattern did not match any file., do not use source_files like below.
s.source_files = 'BlinkingLabel/Classes/**/*'
Use it with your inner directory name and exact file type.
For example if you have a Handler.swift file it must be.
s.source_files = 'Classes/**/*.swift'
If you have any .c file in your pod project that used
s.source_files = 'Classes/**/*.c'
or you can mix it with different file types.
Further I realized that the you must not trust to Classes directory.
You can create a Sources directory and can add all your source files into it and then you can try it with
s.source_files = 'Sources/**/*.swift'
This is the exact solution for me.
I hope it helps for anyone who stuck at.
I regret to ask the question.
It worked now.
s.source_files = 'BlinkingLabel/Classes/**/*'
I've not changed anything but it worked. That's strange.
You need to make sure that you have your files and source_files is appointed to that folder, and then check lint locally
pod lib lint YPlayer.podspec
if all ok, then you can push to cocoapods
pod trunk register email#domain.com 'Your Name' --description='Senior ios developer'
pod trunk push YPlayer.podspec
if it that failed again because of source_files then you need to make new tag, and need to push podspec file and your code relatively, because pod trunk push will check your your code using tag on git not locally like pod lib lint YPlayer.podspec

Unable to read the license file LICENSE.txt - Creating a cocoapod

I am trying to create a cocoapod and I keep getting this error:
Unable to read the license file `LICENSE.txt` for the spec
'WhiteFlowerFactory (0.0.1)'
My podspec code:
spec.name = "WhiteFlowerFactory"
spec.version = "0.0.1"
spec.license = { :type => "MIT", :file => "LICENSE.txt" }
spec.source_files = "WhiteFlowerFactory/*.{swift}"
spec.platform = :ios
spec.ios.deployment_target = '11.0'
spec.swift_version = "5.0"
And here is where it appears in my project directory:
What I have tried:
Moving the LICENSE.txt file to the second "WhiteFlowerFactory" subdirectory
Renamed to LICENSE.md
Renamed to LICENSE (no extension)
No matter what, I continually receive the same error.
I am also getting a separate error, and I am not sure if this error is related, but I will add it here just in case:
[iOS] unknown: Encountered an unknown error (Could not find a `ios`
simulator (valid values: ). Ensure that Xcode -> Window -> Devices has
at least one `ios` simulator listed or otherwise add one.) during
validation.
I've had both of these errors for several hours. I deleted Xcode 10.2 and 11.0 beta and all simulators and derived data and just freshly reinstalled Xcode 10.3 and its simulators. Still receiving both errors.
Edit: Just updated from cocoapods 1.6.1 -> 1.7.5, second error is solved, still receiving the license error:
Validating spec
-> WhiteFlowerFactory (0.0.1)
- WARN | [iOS] license: Unable to find a license file
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
[!] The `WhiteFlowerFactory.podspec` specification does not validate.
[!] Unable to read the license file `LICENSE.txt` for the spec `WhiteFlowerFactory (0.0.1)`
The podspec should include a source field that describes the location of the source. See docs here. Typically it describes a github repo along with a version based tag that has been pushed to that repo.
I had same issue, but my LICENSE file had no extension. So I've removed extension in podspec and it works
s.license = { :type => 'MIT', :file => 'LICENSE' }

validate fail when pushing AFNetworking to private cocoapods podspec

I'm trying to add AFNetworking to the private cocoapods spec by following steps.
clone AFNetworking from github and push to private gitlab
modify AFNetworking.podspec file and change the s.source attribute to the private url
run pod spec lint --verbose, fail with
** BUILD SUCCEEDED **
Testing with xcodebuild. -> AFNetworking (3.2.1)
NOTE | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: note: Using new
build system
NOTE | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: note: Planning
build
NOTE | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: note:
Constructing build description
NOTE | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: warning: Skipping
code signing because the target does not have an Info.plist file. (in
target 'App')
ERROR | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: Returned an
unsuccessful exit code.
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 1 error.
any guys know how to solve this issue?
Add AFNetworking pod name in your podspec file in dependency section.
s.dependency = 'AFNetworking, :path => ''
Solved my problem by running:
pod repo push MySpec AFNetworking.podspec --sources=MySpec,master --allow-warnings

#import "sqlite3.h" from a pod's source

I have a private podspec for a library that relies on Apple's sqlite3.h. Unfortunately, it fails lint:
- ERROR | xcodebuild: Returned an unsuccessful exit code. You can use `--verbose`
for more information.
- ERROR | xcodebuild: /Users/tewha/Library/Developer/Xcode/DerivedData
/App-cglpwsgirxhgugbbcytbhfqnbjrw/Build/Products/Release-iphonesimulator
/SQLPackRat/SQLPackRat.framework/Headers/SQLPRDatabase.h:10:9: error: include of
non-modular header inside framework module 'SQLPackRat.SQLPRDatabase':
'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
/Developer/SDKs/iPhoneSimulator10.3.sdk/usr/include/sqlite3.h' [-Werror,
-Wnon-modular-include-in-framework-module]
Unfortunately, there doesn't seem to be a modular include for sqlite3.h.
How do I fix this? It seems to work anyway, but I imagine this will cause trouble for me later (probably as I start to use Swift in this project).

Resources