Skip to content

Commit

Permalink
update: sandboxing and new lib (#3864)
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-pavlov authored Oct 30, 2023
1 parent fbf4b1f commit eee0740
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 23 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ have some other strong reason to do so.
kotlin {
cocoapods {
//..
pod("Alamofire") {
version = "5.7.0"
pod("FirebaseAuth") {
version = "10.16.0"
}
}
}
Expand All @@ -41,8 +41,8 @@ have some other strong reason to do so.
kotlin {
cocoapods {
//..
pod('Alamofire') {
version = '5.7.0'
pod('FirebaseAuth') {
version = '10.16.0'
}
}
}
Expand All @@ -63,7 +63,7 @@ have some other strong reason to do so.
To use the dependency in your Kotlin code, import the package `cocoapods.<library-name>`. For the example above, it's:
```kotlin
import cocoapods.Alamofire.*
import cocoapods.FirebaseAuth.*
```
### Without CocoaPods
Expand Down
18 changes: 9 additions & 9 deletions docs/topics/native/native-cocoapods-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ version of the library, you can just omit this parameter altogether.
summary = "CocoaPods test library"
homepage = "https://github.com/JetBrains/kotlin"

pod("Alamofire") {
version = "5.7.0"
pod("FirebaseAuth") {
version = "10.16.0"
}
}
}
Expand All @@ -54,7 +54,7 @@ version of the library, you can just omit this parameter altogether.
To use these dependencies from the Kotlin code, import the packages `cocoapods.<library-name>`:

```kotlin
import cocoapods.Alamofire.*
import cocoapods.FirebaseAuth.*
```

## On a locally stored library
Expand Down Expand Up @@ -89,8 +89,8 @@ import cocoapods.Alamofire.*
version = "1.0"
source = path(project.file("../subspec_dependency"))
}
pod("Alamofire") {
version = "5.7.0"
pod("FirebaseAuth") {
version = "10.16.0"
}
}
}
Expand All @@ -108,7 +108,7 @@ To use these dependencies from the Kotlin code, import the packages `cocoapods.<
```kotlin
import cocoapods.pod_dependency.*
import cocoapods.subspec_dependency.*
import cocoapods.Alamofire.*
import cocoapods.FirebaseAuth.*
```

## From a custom Git repository
Expand Down Expand Up @@ -141,9 +141,9 @@ import cocoapods.Alamofire.*

ios.deploymentTarget = "13.5"

pod("Alamofire") {
source = git("https://github.com/Alamofire/Alamofire") {
tag = "5.7.0"
pod("FirebaseAuth") {
source = git("https://github.com/firebase/firebase-ios-sdk") {
tag = "10.16.0"
}
}

Expand Down
21 changes: 13 additions & 8 deletions docs/topics/native/native-cocoapods-xcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
## Xcode project with one target

1. Create an Xcode project with a `Podfile` if you haven't done so yet.
2. Add the path to your Xcode project `Podfile` with `podfile = project.file(..)` to `build.gradle(.kts)`
2. Make sure to disable **User Script Sandboxing** under **Build Options** in the application target:

![Disable sandboxing CocoaPods](disable-sandboxing-cocoapods.png)

3. Add the path to your Xcode project `Podfile` with `podfile = project.file(..)` in the `build.gradle(.kts)` file
of your Kotlin project.
This step helps synchronize your Xcode project with Gradle project dependencies by calling `pod install` for your `Podfile`.
3. Specify the minimum deployment target version for the Pod library.
4. Specify the minimum deployment target version for the Pod library.

```kotlin
kotlin {
ios()
Expand All @@ -34,15 +39,15 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
summary = "CocoaPods test library"
homepage = "https://github.com/JetBrains/kotlin"
ios.deploymentTarget = "13.5"
pod("Alamofire") {
version = "5.7.0"
pod("FirebaseAuth") {
version = "10.16.0"
}
podfile = project.file("../ios-app/Podfile")
}
}
```

4. Add the name and path of the Gradle project you want to include in the Xcode project to `Podfile`.
5. Add the name and path of the Gradle project you want to include in the Xcode project to `Podfile`.

```ruby
use_frameworks!
Expand All @@ -54,7 +59,7 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
end
```

5. Re-import the project.
6. Re-import the project.

## Xcode project with several targets

Expand All @@ -76,8 +81,8 @@ dependency by calling `pod install` manually for each Xcode project. In other ca
ios.deploymentTarget = "13.5"
tvos.deploymentTarget = "13.4"
pod("Alamofire") {
version = "5.7.0"
pod("FirebaseAuth") {
version = "10.16.0"
}
podfile = project.file("../severalTargetsXcodeProject/Podfile") // specify the path to the Podfile
}
Expand Down
19 changes: 18 additions & 1 deletion docs/topics/native/native-cocoapods.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Try these workarounds to avoid this error:
name, specify it explicitly:
```kotlin
pod("Alamofire") {
pod("FirebaseAuth") {
moduleName = "AppsFlyerLib"
}
```
Expand All @@ -278,3 +278,20 @@ tasks.named<org.jetbrains.kotlin.gradle.tasks.DefFileTask>("generateDefNearbyMes
Check the [CocoaPods documentation](https://guides.cocoapods.org/) for more information. If nothing works, and you still
encounter this error, report an issue in [YouTrack](https://youtrack.jetbrains.com/newissue?project=kt).
### Rsync error {initial-collapse-state="collapsed"}
You might encounter the `rsync error: some files could not be transferred` error. It's a [known issue](https://github.com/CocoaPods/CocoaPods/issues/11946)
that occurs if the application target in Xcode has sandboxing of the user scripts enabled.
To solve this issue:
1. Disable sandboxing of user scripts in the application target:
![Disable sandboxing CocoaPods](disable-sandboxing-cocoapods.png){width=700}
2. Stop the Gradle daemon process that might have been sandboxed:
```shell
./gradlew --stop
```

0 comments on commit eee0740

Please sign in to comment.