Carson Holzheimer
09/01/2021, 5:53 AM* What went wrong:
Task 'Debug' not found in root project 'KotlinCommon'.`
Why is it looking for a task called Debug???Luis
09/01/2021, 6:20 AMLuis
09/01/2021, 6:21 AMLuis
09/01/2021, 6:21 AMDebug
configuration, so maybe try changing it to DEBUG
all capsCarson Holzheimer
09/01/2021, 7:50 AMxcodeConfigurationToNativeBuildType["CUSTOM_DEBUG"] = NativeBuildType.DEBUG
I have mapped all the configurations. Even "Debug" by itself, tho it is not one of my configsViacheslav Kormushkin
09/01/2021, 8:12 PMLuis
09/01/2021, 11:15 PMnoPodspec()
in your shared mmp build.gradle, then edit the podspec file script to do the string manipulation thereCarson Holzheimer
09/02/2021, 4:18 AMCarson Holzheimer
09/02/2021, 4:23 AMcocoapods {
// Configure fields required by CocoaPods.
summary = "Shared Kotlin code across iOS and Android"
homepage = "redacted"
ios.deploymentTarget = "12.0"
podfile = project.file("../Podfile")
framework {
baseName = "KotlinCommon"
isStatic = true
}
val apps = listOf("DMS", "WFM")
val schemes = listOf("Prod", "Beta", "Labs", "QA")
val listOfDebugConfigs = apps.flatMap { app ->
schemes.map { scheme ->
"$app Debug ($scheme)"
}
}
val listOfReleaseConfigs = apps.flatMap { app ->
schemes.map { scheme ->
"$app Release ($scheme)"
}
}
// Not sure why these are required but build fails without it
xcodeConfigurationToNativeBuildType["WFM"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
xcodeConfigurationToNativeBuildType["DMS"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
xcodeConfigurationToNativeBuildType["Debug"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
listOfDebugConfigs.forEach {
xcodeConfigurationToNativeBuildType[it] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
}
listOfReleaseConfigs.forEach {
xcodeConfigurationToNativeBuildType[it] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.RELEASE
}
}
Luis
09/02/2021, 4:26 AMLuis
09/02/2021, 4:26 AMLuis
09/02/2021, 4:27 AMLuis
09/02/2021, 4:27 AMCarson Holzheimer
09/02/2021, 4:28 AMCarson Holzheimer
09/02/2021, 4:28 AMLuis
09/02/2021, 4:28 AMval listOfDebugConfigs = apps.flatMap { app ->
schemes.map { scheme ->
"$app Debug ($scheme)"
}
}
val listOfReleaseConfigs = apps.flatMap { app ->
schemes.map { scheme ->
"$app Release ($scheme)"
}
}
Luis
09/02/2021, 4:29 AMCarson Holzheimer
09/02/2021, 4:42 AMPod::Spec.new do |spec|
spec.name = 'KotlinCommon'
spec.version = '1.0'
spec.homepage = 'redacted'
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
spec.authors = ''
spec.license = ''
spec.summary = 'Shared Kotlin code across iOS and Android'
spec.vendored_frameworks = "build/cocoapods/framework/KotlinCommon.framework"
spec.libraries = "c++"
spec.module_name = "#{spec.name}_umbrella"
spec.ios.deployment_target = '12.0'
spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':',
'PRODUCT_MODULE_NAME' => 'KotlinCommon',
}
spec.script_phases = [
{
:name => 'Build KotlinCommon',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$COCOAPODS_SKIP_KOTLIN_BUILD" ]; then
echo "Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\""
exit 0
fi
set -ev
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 \
-Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \
-Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \
-Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
SCRIPT
}
]
end
Carson Holzheimer
09/02/2021, 5:05 AM/bin/sh -c /Users/carsonholzheimer/Library/Developer/Xcode/DerivedData/RedEye-bnxkyzimuyxvsiczcehnvfezhktc/Build/Intermediates.noindex/Pods.build/WFM\\\ Debug\\\ \\\(QA\\\)-iphonesimulator/KotlinCommon.build/Script-B9E7066122875376ACF9D124F6326B2D.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 -Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" -Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" -Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
> Configure project :
Kotlin Multiplatform Projects are an Alpha feature. See: <https://kotlinlang.org/docs/reference/evolution/components-stability.html>. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
FAILURE: Build failed with an exception.
* What went wrong:
Task 'Debug' not found in root project 'KotlinCommon'.
Carson Holzheimer
09/02/2021, 5:06 AMCarson Holzheimer
09/02/2021, 5:14 AMCarson Holzheimer
09/02/2021, 5:32 AM/bin/sh -c /Users/carsonholzheimer/Library/Developer/Xcode/DerivedData/RedEye-ediatwizneiykycbhcshsflepmrj/Build/Intermediates.noindex/Pods.build/WFM\\\ Debug\\\ \\\(QA\\\)-iphonesimulator/KotlinCommon.build/Script-76194415D0376B6F6C5FC66A6A58DEE6.sh
APP_BUILD="$CONFIGURATION"
if [[ APP_BUILD == *"Debug"* ]]
then
APP_BUILD="DEBUG"
else
APP_BUILD="RELEASE"
fi
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/gradlew" -p "$REPO_ROOT" ::syncFramework -Pkotlin.native.cocoapods.target=$KOTLIN_TARGET -Pkotlin.native.cocoapods.configuration=$APP_BUILD -Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" -Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" -Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
> Configure project :
Kotlin Multiplatform Projects are an Alpha feature. See: <https://kotlinlang.org/docs/reference/evolution/components-stability.html>. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
The Kotlin source set androidAndroidTestRelease was configured but not added to any Kotlin compilation. You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
See <https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets>
> Task :compileKotlinIosX64
> Task :linkReleaseFrameworkIosX64
> Task :syncFramework
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD SUCCESSFUL in 29s
Luis
09/02/2021, 7:03 AM"$app Debug ($scheme)"
in your build.gradle, you should try to do something like "$app\\ Debug\\ ($scheme)"
or maybe "\"$app Debug ($scheme)\""
Luis
09/02/2021, 7:04 AM$CONFIGURATION
variable in the scriptCarson Holzheimer
09/02/2021, 7:04 AMLuis
09/02/2021, 7:05 AM$CONFIGURATION
with WFM Debug (QA)
but because it has spaces it breaks the scriptLuis
09/02/2021, 7:05 AMWFM
and then it tries to run the “task” Debug
because of the spacesLuis
09/02/2021, 7:05 AMCarson Holzheimer
09/02/2021, 7:07 AMLuis
09/02/2021, 7:10 AMCarson Holzheimer
09/03/2021, 3:02 AMnoPodspec
workaround in for the moment and make a Youtrack issue