Skip to content
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

[Android][expo-modules-core] Cannot use @TaskAction annotation on method AbstractKotlinCompile.execute() #23537

Closed
thefranfran opened this issue Jul 14, 2023 · 12 comments
Labels
needs review Issue is ready to be reviewed by a maintainer stale

Comments

@thefranfran
Copy link

Minimal reproducible example

https://github.com/thefranfran/expo-modules-example

Summary

I work on a bare react native project with the Expo SDK 49.0.0, everything works fine on IOS but not on Android.

I use this packages from expo:

"expo": "~49.0.3",
"expo-font": "~11.4.0",
"expo-haptics": "~12.4.0",
"expo-linear-gradient": "~12.3.0",
"expo-splash-screen": "~0.20.4",
"expo-status-bar": "~1.6.0",
"expo-system-ui": "~2.4.0",

Android Configuration

android/build.gradle

dependencies {
classpath("com.android.tools.build:gradle:7.4.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("com.google.gms:google-services:4.3.15")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10")
}

distributionUrl=https://services.gradle.org/distributions/gradle-8.0.1-all.zip

Trace Stack

Script '/Users/francoiscipriani/Desktop/poke/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 356

  • What went wrong:
    A problem occurred evaluating project ':expo'.

A problem occurred configuring project ':expo-modules-core'.
Failed to notify project evaluation listener.
> Could not create task ':expo-modules-core:compileDebugAndroidTestKotlin'.
> Cannot use @TaskAction annotation on method AbstractKotlinCompile.execute() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.
> KotlinJvmAndroidCompilation with name 'debugAndroidTest' not found.

Environment

System:
OS: macOS 13.3.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.4.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.7.2 - /opt/homebrew/bin/npm
Watchman: 2023.07.10.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.0 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.9971841
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
npmPackages:
expo: ~49.0.3 => 49.0.3
react: 18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
react-native: 0.72.3 => 0.72.3
npmGlobalPackages:
eas-cli: 3.8.1
expo-cli: 6.3.10
Expo Workflow: bare

@thefranfran thefranfran added the needs validation Issue needs to be validated label Jul 14, 2023
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Jul 14, 2023
@Guiladg
Copy link

Guiladg commented Jul 17, 2023

Same here

@Sannijiv
Copy link

+1

@ferixinder
Copy link

same

@ryanBuzzni
Copy link

same here!!
please check this issue !!!!!!!!!  😭

@burakgokcinarr
Copy link

I have this problem too. It was created with Expo SDK 49. Is there any solution? Needs to be fixed asap

@burakgokcinarr
Copy link

burakgokcinarr commented Aug 1, 2023

Hello, I think I found the solution.

I had created a project via Expo (expo prebuild). The package.json content of my project is as follows.

"dependencies": {
"expo": "~49.0.5",
"expo-splash-screen": "~0.20.4",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.3"
},

There is no problem for the iOS part. But I was getting the following error for Android.

image

The default gradle 8.0.1 is used and I think there is a problem with the kotlin version (1.8.10) for this version. I did not have a problem by making the following change.

In the build.grandle file;

kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'

in its place

kotlinVersion = '1.9.0'

and then by doing "sync gradle project file" there was no problem.

@github-actions
Copy link
Contributor

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Oct 30, 2023
@igorskiter
Copy link

igorskiter commented Oct 30, 2023

I have same issue.I used expo-build-properties and set "kotlinVersion": "1.9.0" but in gradle.properties set android.kotlinVersion=1.6.10. Anyone have a solution?

@github-actions github-actions bot removed the stale label Oct 30, 2023
@xkelxmc
Copy link

xkelxmc commented Nov 2, 2023

same problem with kotlinVersion 1.8.10, 1.8.22, 1.9.0

@7dp
Copy link

7dp commented Nov 22, 2023

Having the same problem too.
But thanks to @burakgokcinarr , my Android app now builds by setting the Kotlin version to 1.9.0.
Something like:

ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 23
        compileSdkVersion = 33
        targetSdkVersion = 33

        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"

        kotlinVersion = "1.9.0" //  <--- Add this line.
    }

Have a nice day! 🙌

Copy link
Contributor

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Feb 20, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer stale
Projects
None yet
Development

No branches or pull requests

10 participants