Open aykutmehmetd opened 4 months ago
Thank you for your interest and first issue. I don't know much about the Expo ecosystem, and I haven't used it recently, so I can't say for sure, but it seems like it would be pretty hard to use React Native's new architecture (Turbo Modules and Fabric Components) in an Expo-managed workflow app. You can consider the following approaches to resolve the issue:
Transition to Expo Bare Workflow: Only limited native modules are available in the Expo Managed workflow, so you can switch to the Expo Bare workflow to give you access to native code and libraries.
Creating a pure React Native project: How to create a pure React Native project using the npx react-native init command, without using Expo, to include the @dongminyu/react-native-step-counter library.
I didn't use new architecture, so i can't say for sure about how can be hard to use the new architecture in Expo workflow.
Ok then, I'll keep trying to find an solution. If i do, I'll let you know.
I got same error without expo and new architecture, but before this error i got this:
`e: /Users/macbook/Documents/projects/project/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt: (38, 26): Property getter or setter expected e: /Users/macbook/Documents/projects/project/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt: (64, 9): Unresolved reference: sensorManager e: /Users/macbook/Documents/projects/project/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt: (68, 38): Unresolved reference: sensorManager e: /Users/macbook/Documents/projects/project/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt: (70, 40): Unresolved reference: sensorManager e: /Users/macbook/Documents/projects/project/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt: (105, 38): Unresolved reference: sensorManager e: /Users/macbook/Documents/projects/project/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt: (107, 40): Unresolved reference: sensorManager Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build completed with 2 failures.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction`
Original error looks like "StepCounterModule.kt: (38, 26): Property getter or setter expected" Im not good at kotlin, but looks like kotlin version error, but i tried change 1.6.0-1.7.0-1.8.0, but still got error...
Maybe it will help with issue
same problem
android
buildToolsVersion = "34.0.0"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34
kotlinVersion = "1.9.0"
react-native: 0.73.5
@dongminyu/react-native-step-counter: 0.2.5
I thought it was simply an issue with trying to use this module in expo, but it looks like there's something wrong with the kotlin area. I'll try a few more things to reproduce and resolve this issue and let you know what I find.
same here, in Bare workflow.
Newest react native using kotlin '1.9.23', can you upgrade this library kotlin version? Maybe this will resolve the issue
I got the same error. I upgraded React Native from 0.72 to 0.74 in the Expo Bare Workflow. It was actually stable in React Native 0.72, but when I upgraded, an error appeared:
Task :dongminyu_react-native-step-counter:compileDebugKotlin FAILED e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:38:26 Property getter or setter expected e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:64:9 Unresolved reference: sensorManager e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:68:38 Unresolved reference: sensorManager e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:70:40 Unresolved reference: sensorManager e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:105:38 Unresolved reference: sensorManager e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:107:40 Unresolved reference: sensorManager
FAILURE: Build failed with an exception.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction Compilation error. See log for more details
Newest react native using kotlin '1.9.23', can you upgrade this library kotlin version? Maybe this will resolve the issue
I got the same error. I upgraded React Native from 0.72 to 0.74 in the Expo Bare Workflow. It was actually stable in React Native 0.72, but when I upgraded, an error appeared:
Task :dongminyu_react-native-step-counter:compileDebugKotlin FAILED e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:38:26 Property getter or setter expected e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:64:9 Unresolved reference: sensorManager e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:68:38 Unresolved reference: sensorManager e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:70:40 Unresolved reference: sensorManager e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:105:38 Unresolved reference: sensorManager e: file:///project_folder/node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt:107:40 Unresolved reference: sensorManager
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':dongminyu_react-native-step-counter:compileDebugKotlin'.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction Compilation error. See log for more details
I've successfully run the library on Expo Bare Workflow (React Native 0.74) with the following modifications:
Changes Made:
Edited the gradle.properties file
Path: node_modules/@dongminyu/react-native-step-counter/android/build.gradle
Updated the following lines:
StepCounter_compileSdkVersion=34
StepCounter_kotlinVersion=1.9.23
StepCounter_targetSdkVersion=34
StepCounter_minSdkVersion=24
StepCounter_ndkversion=26.1.10909125
Edited the sensorManager variable
Path: node_modules/@dongminyu/react-native-step-counter/android/src/main/java/com/stepcounter/StepCounterModule.kt
Changed this line:
private val lateinit sensorManager: SensorManager
to:
private var sensorManager: SensorManager
Update the minSdkVersion
in android/build.gradle
to 24
.
Then yarn android
React Native Step Counter New Issue
Expected Behavior
Actual Behavior
Steps to Reproduce the Problem
npx create-expo-app my-app --template tabs@50
npx expo install @dongminyu/react-native-step-counter
eas init
Create eas.json:
app.json:
eas build -e development -p android
Specifications