Add the appropriate “Tag” based on what Expo library you have a question on.
Node Version: 16.19.0
Npm Version: 8.19.3
Expo Version: 6.1.0
Eas-Cli Version: 3.3.1
When I build the app by running the ‘eas build --local’ command selecting Android, at build time it fails with the following error:
[RUN_GRADLEW] gradlew: 154: Syntax error: “(” unexpected
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the “Run gradlew” phase for more information.
Old gradle could have bash scripts, but you shouldn’t use those versions, especially if you are on sdk45. Most likelly you have that old file for a while and it never go updated. You can run ./gradlew wrapper, it should update gradlew script to be inline with your gradle wrapper version.
If so, I believe that would have built the app as if it were a managed app, but you seem to have an android directory, making it a bare app. Could you clarify?
If the app is supposed to be using the managed workflow, you should probably get rid of the android directory (and ios if you have it.) But of course if you have made changes in the native projects you might not be able to just delete them… but if that’s the case, then expo build:android would not have worked for you.
When I execute this command ‘./gradlew wrapper’ in android file this is the error:
Could not read script ‘${App_directory}/app/node_modules/react-native-unimodules/gradle.groovy’ as it does not exist.
So I install this deprecated dependency and run ./gradlew wrapper again and see this:
FAILURE: Build failed with an exception.
Where Build file ‘${App_directory}/app/node_modules/expo-application/android/build.gradle’ line: 48
What went wrong:
A problem occurred configuring project ‘:expo-application’.
Exception thrown while executing model rule: PublishingPluginRules#publishing(ExtensionContainer)
Could not get unknown property ‘release’ for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
Deprecated Gradle features were used in this build, making it compatible with Gradle 5.0.
If you were using expo build:android before, then I suggest you rename android to android.bak and try building with eas build -p android --profile ...
If that works, then delete android.bak. Same for ios.
I see you also have both package-lock.json and yarn.lock. You should pick either npm or yarn to manage your dependencies. You should not use both.
If you’re using yarn, delete package-lock.json.
If you’re using npm, delete yarn.lock.
Great I’m glad you got it working. You should do the same for the ios directory. And probably delete them. And you should still get rid of one of the lock files if you have not yet done so.