helium / maker-starter-app

Apache License 2.0
36 stars 39 forks source link

Android build error: Execution failed for task ':helium_react-native-sdk:compileDebugKotlin'. #48

Closed LeoUbl closed 1 year ago

LeoUbl commented 1 year ago

Up to a month ago I could build my android app, but since two weeks ago I get this error without editing anything in my project. I also just tried to build the app from your current github project and I still get the error. I'm using ubuntu terminal to build the app.

Steps to reproduce the error: 1) Clone the project from your github 2) I assume you have already set up react native on your machine, so skip to "Installing" section and follow those steps. 3) cd ~/maker-starter-app ; mkdir android/app/src/main/assets (this folder is used during android building) 4) Build android app. These are the commands I use in the terminal 5) cd ~/maker-starter-app ; cd android ; ./gradlew clean ; cd .. 6) react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res 7) react-native run-android

Steps 5 and 6 return some warnings, step 7 returns errors like: e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors e: /home/my_ubuntu_username/.gradle/caches/transforms-3/2cfe106a332c6a6f2245988cf5920bcb/transformed/jetified-kotlin-stdlib-common-1.6.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.

The final error says:

FAILURE: Build completed with 2 failures.

1:Task failed with an exception.
What went wrong:
Execution failed for task ':helium_react-native-sdk:compileDebugKotlin'.
Compilation error. See log for more details

Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

2: Task failed with an exception.
What went wrong:
java.lang.StackOverflowError (no error message)

Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

Get more help at https://help.gradle.org/

BUILD FAILED in 1m

I found a similar issue on github which seems got fixed, here's the link: https://github.com/segmentio/analytics-react-native/issues/645

Can you please fix this problem on your github project too? Thanks in advance

matthewcarlreetz commented 1 year ago

@LeoUbl Could you try this #49 branch and let me know if you are still facing the issue? https://github.com/helium/maker-starter-app/tree/feature/upgrade-rn-0.70.6

LeoUbl commented 1 year ago

@matthewcarlreetz I just tried to clone your branch with VSCode but I get this error: "Git: fatal: repository 'https://github.com/helium/maker-starter-app/tree/feature/upgrade-rn-0.70.6' not found."

I think your branch is private because when I click on the branches menu of this project I can see only these 3 branches: main, feature/theme and feat/ci.

Let me know when I will be able to clone your branch. For this week I'm at work until 9 hours from now (so until 6 p.m. at UTC+1), in case you will give me news later I will be able to check this on Monday. Thanks

Corniot commented 1 year ago

@LeoUbl I solved the problem First, download the latest code Second, Add kotlinVersion = "1.6.10" and classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" these code in build.gradle. Look at the picture below. image

LeoUbl commented 1 year ago

Thank you very much!!! @Corniot . Using the latest code and adding the kotlinVersion fixed the problem. @matthewcarlreetz I think you should include the kotlinVersion in the next code version as soon as possible because the current version isn't enough to fix the problem. Thanks.

cagataykula commented 1 year ago

@LeoUbl I solved the problem First, download the latest code Second, Add kotlinVersion = "1.6.10" and classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" these code in build.gradle. Look at the picture below. image

this is solving the issue, thanks @Corniot 👍

LeoUbl commented 1 year ago

I'm closing this since the latest version seems to compile correctly. Thanks everyone