Skip to content

fix: [SDK-4511] fix Android build with Kotlin stdlib 2.2.x - #20

Merged
fadi-george merged 11 commits into
mainfrom
fadi/sdk-4511
May 14, 2026
Merged

fix: [SDK-4511] fix Android build with Kotlin stdlib 2.2.x#20
fadi-george merged 11 commits into
mainfrom
fadi/sdk-4511

Conversation

@fadi-george

@fadi-george fadi-george commented May 14, 2026

Copy link
Copy Markdown
Contributor

One Line Summary

Fix Android builds where kotlin-stdlib 2.2.x is on the app classpath but the OneSignal Capacitor plugin was compiled with Kotlin 1.9.25.

Fixes #18.

Motivation

Apps using newer Android/Kotlin tooling can fail to build when the plugin brings or assumes incompatible Kotlin/AGP versions. This PR makes the Android build setup clearer and aligns the plugin/demo with host build tooling expectations so Capacitor 7 projects can validate the fixed path.

Scope

  • Updates Android Gradle/Kotlin/AGP handling so the plugin can inherit or own compatible host build tooling.
  • Adds documentation explaining the Android build-tooling version rationale and compatibility behavior.
  • Adds examples/demo_cap7 with Angular, Capacitor config, iOS project files, Android project files, and a simple OneSignal integration surface to reproduce and validate Capacitor 7 builds.

Testing

  • vp check
  • vp test (177 tests passed)
  • Manual iOS demo run
  • Manual Android demo run validating the Kotlin stdlib/classpath issue

Affected Code Checklist

  • Android build tooling
  • Documentation
  • Example app / demo project
  • iOS/Android plugin runtime behavior
  • Public TypeScript API

Checklist

  • Branch includes Linear ticket SDK-4511
  • PR title follows repo convention
  • Links the GitHub issue this is meant to address
  • No unrelated working-tree changes included

@fadi-george
fadi-george requested a review from a team May 14, 2026 19:25
@fadi-george fadi-george changed the title feat: [SDK-4511] add Capacitor 7 demo app fix: [SDK-4511] resolve Android Kotlin stdlib classpath mismatch May 14, 2026
@fadi-george fadi-george changed the title fix: [SDK-4511] resolve Android Kotlin stdlib classpath mismatch fix: [SDK-4511] fix Android build with Kotlin stdlib 2.2.x May 14, 2026
Comment thread examples/demo_cap7/ios/App/App.xcodeproj/project.pbxproj
Comment thread examples/demo_cap7/README.md Outdated
- README: fix button count (three -> four) and `cd` path (demo-cap7 -> demo_cap7).
- Remove ExampleInstrumentedTest.java and ExampleUnitTest.java; they were at
  the wrong package path with a guaranteed-fail assertion. Matches
  examples/demo which ships neither.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george

Copy link
Copy Markdown
Contributor Author

@claude review

Match Android applicationId/namespace/strings and capacitor appId
to com.onesignal.example so the cap7 demo shares bundle id with
the existing iOS demo configuration.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread android/build.gradle.kts Outdated
project.hasProperty matches every Gradle property source, but
rootProject.extra only sees ext { ... } values, so a host that
pinned kotlin_version or the SDK levels via gradle.properties
or -P flags would crash at configuration with
UnknownPropertyException (or ClassCastException in the Int case).

Switch the buildscript kotlin_version reader and the
propertyOrCatalog / intPropertyOrCatalog helpers to
findProperty(...).toString(), and update the Android README to
document the full set of supported override sources.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread examples/demo_cap7/android/variables.gradle Outdated
Match the plugin catalog (minSdk = "24"); 23 would fail manifest
merger since the library requires a higher floor than the host.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george
fadi-george merged commit 21bef15 into main May 14, 2026
5 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-4511 branch May 14, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android build fails: kotlin-stdlib 2.2.x on classpath but plugin compiled with Kotlin 1.9.25

2 participants