-
Notifications
You must be signed in to change notification settings - Fork 44
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
Intergrate shared KMP module into the iOS app #313
base: kmp
Are you sure you want to change the base?
Conversation
Fails with /Users/bart/Library/Developer/Xcode/DerivedData/Runner-bulbrgiogyzifpfymlurhifkjoyp/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-5D12BEE52D57ED8100243610.sh: line 3: ./gradlew: No such file or directory |
After checking out gradle wrapper from master branch: Showing All Messages |
Hm, that's strange. I'll check it out |
It sounds like you have JDK 23 installed which the current version of Gradle/Kotlin doesn't support. I believe if you lower the JDK version Gradle is using to 17 you should be fine. You can change this in Android Studio via Settings | Build, Execution, Deployment | Build Tools | Gradle | Gradle JDK |
I am not using Android Studio. I am using Xcode. But yeah installing OpenJDK 17 and setting
Did the trick. That should be added to the README perhaps? |
Next error: Error: Could not find or load main class org.jetbrains.kotlin.cli.utilities.MainKtShowing All Messages
w: file:///Users/bart/src/mobile-app/android/build.gradle.kts:58:13: 'setter for buildDir: File!' is deprecated. Deprecated in Java w: file:///Users/bart/src/mobile-app/android/build.gradle.kts:60:13: 'setter for buildDir: File!' is deprecated. Deprecated in Java w: file:///Users/bart/src/mobile-app/android/build.gradle.kts:60:44: 'getter for buildDir: File!' is deprecated. Deprecated in Java w: file:///Users/bart/src/mobile-app/android/build.gradle.kts:65:24: 'getter for buildDir: File!' is deprecated. Deprecated in Java
WARNING: The option setting 'android.defaults.buildfeatures.buildconfig=true' is deprecated. The current default is 'false'. It will be removed in version 9.0 of the Android Gradle plugin. To keep using this feature, add the following to your module-level build.gradle files:
or from Android Studio, click: w: file:///Users/bart/src/mobile-app/android/app/build.gradle.kts:105:5: 'kotlinOptions(KotlinJvmOptionsDeprecated /* = KotlinJvmOptions */.() -> Unit): Unit' is deprecated. Please migrate to the compilerOptions DSL. More details are here: https://kotl.in/u1r8ln You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply w: file:///Users/bart/fvm/versions/3.22.3/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:107:40: Variable 'agpVersion' initializer is redundant w: file:///Users/bart/fvm/versions/3.22.3/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:108:40: Variable 'kgpVersion' initializer is redundant w: file:///Users/bart/fvm/versions/3.22.3/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:143:28: Parameter 'project' is never used w: file:///Users/bart/fvm/versions/3.22.3/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:152:40: Variable 'agpVersion' initializer is redundant w: file:///Users/bart/fvm/versions/3.22.3/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:167:55: 'Version' is deprecated. Deprecated in Java w: file:///Users/bart/fvm/versions/3.22.3/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:195:56: Unnecessary non-null assertion (!!) on a non-null receiver of type Any w: file:///Users/bart/fvm/versions/3.22.3/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:344:28: The corresponding parameter in the supertype 'Comparable' is named 'other'. This may cause problems when calling this function with named arguments. Warning: unable to detect project KGP version. Skipping version checking. This may be because you have applied KGP after the Flutter Gradle Plugin.
w: file:///Users/bart/src/mobile-app/android/shared/build.gradle.kts:22:13: 'kotlinOptions(KotlinJvmOptions.() -> Unit): Unit' is deprecated. Please migrate to the compilerOptions DSL. More details are here: https://kotl.in/u1r8ln
Can't find env_blacklist file at /Users/bart/.konan/kotlin-native-prebuilt-macos-aarch64-2.1.0-RC/tools/env_blacklist. Error: Could not find or load main class org.jetbrains.kotlin.cli.utilities.MainKt Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.cli.utilities.MainKt
FAILURE: Build failed with an exception.
Execution failed for task ':shared:kspKotlinIosArm64'.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.9/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 2m 20s |
This PR wires
android:shared
KMP module to the iOS app and makes it possible to open KMP screens. Should be noted that the locker screen opens as a modal above the flutter app and its not the proper navigation solution :)Changelog:
shared
module's gradle config to make Room work on iOSAppDatabase.ios.kt
shared:embedAndSignAppleFrameworkForXcode
gradle task during Xcode build to integrate kmp binary into the iOS app (build times are longer now)Here is a preview:
preview.mov