axelra-ag / react-native-animateable-text

πŸ†Ž A fork of React Native's <Text/> component that supports Animated Values!
https://www.npmjs.com/package/react-native-animateable-text
MIT License
360 stars 27 forks source link

Module breaks Android build: Detected multiple Kotlin daemon sessions at build/kotlin/sessions & other errors #8

Closed brandtnewlabs closed 3 years ago

brandtnewlabs commented 3 years ago

Hi there,

I'm glad I found your package as it's exactly what I am looking for. But after installing the module, my Android build stops working. Here's the console output:

The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':expo-image-loader', ':react-native-animateable-text'

....

> Task :react-native-animateable-text:compileDebugJavaWithJavac FAILED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

... 

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
236 actionable tasks: 4 executed, 232 up-to-date
/Users/lennart/Projects/weburn/node_modules/react-native-animateable-text/android/src/main/java/com/reactnativereanimatedtext/JBTextViewManager.java:112: error: cannot find symbol
      TextAttributeProps.getTextAlignment(props, TextLayoutManager.isRTL(attributedString)),
                                                                  ^
  symbol:   method isRTL(ReadableMap)
  location: class TextLayoutManager
/Users/lennart/Projects/weburn/node_modules/react-native-animateable-text/android/src/main/java/com/reactnativereanimatedtext/JBTextViewManager.java:124: error: method does not override or implement a method from a supertype
  @Override
  ^
/Users/lennart/Projects/weburn/node_modules/react-native-animateable-text/android/src/main/java/com/reactnativereanimatedtext/JBTextViewManager.java:145: error: incompatible types: float[] cannot be converted to int[]
      attachmentsPositions);
      ^
Note: /Users/lennart/Projects/weburn/node_modules/react-native-animateable-text/android/src/main/java/com/reactnativereanimatedtext/JBTextShadowNode.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors

I'm using the following module versions:

"react-native-animateable-text": "^0.6.0" "react-native": "0.63.4", "react-native-reanimated": "^2.0.0-rc.3", "expo-image-picker": "~9.2.1", "react-native-unimodules": "~0.12.0"

Is there anything else you need to know?

UPDATE:

Commenting out the apply plugin 'kotlin-android' in the module's build.gradle and then running yarn again seems to resolve the first part of the error message. The build still fails because of the 3 other error messages.

...
apply plugin: 'com.android.library'
// apply plugin: 'kotlin-android'
...
JonnyBurger commented 3 years ago

Hey Lennart!

Looks like a version mismatch, see the compatibility table in the README:

Animateable Text Version RN Version
>= 0.6.0 >= 0.64
>= 0.5.9 >= 0.63

Can you try to pin to a lower version and see if you still get the error? If you do, I'll take a closer look.

brandtnewlabs commented 3 years ago

Hi Jonny,

oh yes, sorry for that! I just installed "react-native-animateable-text": "0.5.9" and now, the App just crashes on launch. Just to make sure, I then removed the module and it didn't crash without having react-native-animateable-text in my project.

The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal. Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects. If the parent project does not need the plugin, add 'apply false' to the plugin line. See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl The Kotlin plugin was loaded in the following projects: ':expo-image-loader', ':react-native-animateable-text'

Task :app:installDebug 10:22:16 V/ddms: execute: running am get-config 10:22:16 V/ddms: execute 'am get-config' on '97GAY10LMS' : EOF hit. Read: -1 10:22:16 V/ddms: execute: returning Installing APK 'app-debug.apk' on 'Pixel 3a - 10' for app:debug 10:22:16 D/app-debug.apk: Uploading app-debug.apk onto device '97GAY10LMS' 10:22:16 D/Device: Uploading file onto device '97GAY10LMS' 10:22:16 D/ddms: Reading file permision of /Users/lennart/Projects/weburn/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r-- 10:22:18 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk" 10:22:21 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on '97GAY10LMS' : EOF hit. Read: -1 10:22:21 V/ddms: execute: returning 10:22:21 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk" 10:22:21 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on '97GAY10LMS' : EOF hit. Read: -1 10:22:21 V/ddms: execute: returning Installed on 1 device. w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

brandtnewlabs commented 3 years ago

Nevermind. I just tried to find out why it crashes with adb logcat and suddenly the App starts again. Thanks a lot for helping me out! I hope this issue helps the next developer who's stuck with version missmatch :D

JonnyBurger commented 3 years ago

Ok, that's great to hear! 😊 We are running the same version. And although we get the same warning, it doesn't lead to a crash. I think I can remove the kotlin plugin, I'll try and remove it in the next version (I know you need to run an old version but hopefully you'll upgrade too when RN64 is officially out).

brandtnewlabs commented 3 years ago

I actually removed the kotlin plugin and then the App crashed πŸ˜… So I just ignored the warning.