question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Screens don't compile with Kotlin 1.3.X

See original GitHub issue

Description

Building version 3.8.0 fails with the following error:

e: /Users/cameronbates/Developer/axios-app/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt: (124, 47): Smart cast to 'ScreenStackFragment' is impossible, because 'mTopScreen' is a mutable property that could have been changed by this time

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.

Screenshots

Screen Shot 2021-09-30 at 2 23 13 PM

Steps To Reproduce

  1. Install 3.8.0 and attempt to build

Platform

  • iOS
  • Android
  • Web
  • Windows
  • tvOS

Workflow

  • Managed workflow
  • Bare workflow

Package versions

package version
react-native 65.1
react-native-screens 3.8.0
react-native-safe-area-context 3.3.2
react-native-gesture-handler 1.10.3
react-native-reanimated 1.7.0
react-navigation 4.4.3
react-navigation-stack 2.10.4
react-navigation-tabs 2.10.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
mitesh-dbcommented, Oct 4, 2021

Thanks @kacperkapusciak , It worked! I changed my kotlin version to kotlinVersion = "1.4.10" in android/build.gradle

5reactions
kacperkapusciakcommented, Oct 1, 2021

@ilhamsa1 @zerbfra thank you for providing necessary information to reproduce this 🙏

Could you check if applying changes in https://github.com/software-mansion/react-native-screens/pull/1165 fixes your issue?

cc @ds8k

Read more comments on GitHub >

github_iconTop Results From Across the Web

Screens don't compile with Kotlin 1.3.X - Bountysource
Building version 3.8.0 fails with the following error: e: /Users/cameronbates/Developer/axios-app/node_modules/react-native-screens/android/src/ ...
Read more >
Module was compiled with an incompatible version of Kotlin ...
I experienced this issue while building an app that used my library. It appeared to be caused by an update of the Kotlin...
Read more >
The Dos and Dont's of Mobile Development with Kotlin ...
1. Lack of experience · 2. Libraries that support iOS strongly depend on the compiler version · 3. Gradle on iOS · 4....
Read more >
Kotlin 1.3.30 released - The JetBrains Blog
We're happy to announce the release of Kotlin 1.3.30, a new bug fix and tooling update for Kotlin 1.3. The main areas of...
Read more >
Compatibility guide for Kotlin 1.3
1.2.x: errors reported only by tooling, the compiler still ... Short summary: since Kotlin 1.3, setting non-constant values as vararg ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found