while bulding apk file it throws error

hi while building apk file it throws errors

Running 'gradlew :app:assembleRelease' in /home/expo/workingdir/build/android

2

Downloading https://services.gradle.org/distributions/gradle-7.5.1-all.zip

3

10%.

4

20%.

5

30%.

6

40%.

7

50%.

8

60%.

9

70%.

10

80%.

11

90%.

12

100%

13

Welcome to Gradle 7.5.1!

14

Here are the highlights of this release:

15

 - Support for Java 18

16

 - Support for building with Groovy 4

17

 - Much more responsive continuous builds

18

 - Improved diagnostics for dependency resolution

19

For more details see https://docs.gradle.org/7.5.1/release-notes.html

20

To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.

21

Daemon will be stopped at the end of the build

22

> Task :react-native-gradle-plugin:pluginDescriptors

23

> Task :react-native-gradle-plugin:processResources

24

> Task :react-native-gradle-plugin:compileKotlin

25

> Task :react-native-gradle-plugin:compileJava NO-SOURCE

26

> Task :react-native-gradle-plugin:classes

27

> Task :react-native-gradle-plugin:inspectClassesForKotlinIC

28

> Task :react-native-gradle-plugin:jar

29

> Configure project :expo-application

30

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

31

> Configure project :expo-constants

32

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

33

> Configure project :expo-device

34

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

35

> Configure project :expo-file-system

36

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

37

> Configure project :expo-font

38

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

39

> Configure project :expo-keep-awake

40

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

41

> Configure project :expo-location

42

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

43

> Configure project :expo-modules-core

44

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

45

Checking the license for package NDK (Side by side) 23.1.7779620 in /home/expo/Android/Sdk/licenses

46

License for package NDK (Side by side) 23.1.7779620 accepted.

47

Preparing "Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)".

48

"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" ready.

49

Installing NDK (Side by side) 23.1.7779620 in /home/expo/Android/Sdk/ndk/23.1.7779620

50

"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" complete.

51

"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" finished.

52

Checking the license for package CMake 3.22.1 in /home/expo/Android/Sdk/licenses

53

License for package CMake 3.22.1 accepted.

54

Preparing "Install CMake 3.22.1 (revision: 3.22.1)".

55

"Install CMake 3.22.1 (revision: 3.22.1)" ready.

56

Installing CMake 3.22.1 in /home/expo/Android/Sdk/cmake/3.22.1

57

"Install CMake 3.22.1 (revision: 3.22.1)" complete.

58

"Install CMake 3.22.1 (revision: 3.22.1)" finished.

59

> Configure project :expo-splash-screen

60

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

61

> Configure project :expo

62

Using expo modules

63

  - expo-application (5.1.1)

64

  - expo-constants (14.2.1)

65

  - expo-device (5.2.1)

66

  - expo-file-system (15.2.2)

67

  - expo-font (11.1.1)

68

  - expo-keep-awake (12.0.1)

69

  - expo-location (15.1.1)

70

  - expo-modules-core (1.2.7)

71

- expo-splash-screen (0.18.2)

72

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

73[stderr]

FAILURE: Build failed with an exception.

74[stderr]

* Where:

75[stderr]

Build file '/home/expo/workingdir/build/node_modules/react-native-geocoder/android/build.gradle' line: 19

76[stderr]

* What went wrong:

77[stderr]

A problem occurred evaluating project ':react-native-geocoder'.

78[stderr]

> Could not find method compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

79[stderr]

* Try:

80[stderr]

> Run with --stacktrace option to get the stack trace.

81[stderr]

> Run with --info or --debug option to get more log output.

82[stderr]

> Run with --scan to get full insights.

83[stderr]

* Get more help at

84[stderr]

https://help.gradle.org

85[stderr]

BUILD FAILED in 2m 16s

86

5 actionable tasks: 5 executed

87

Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

the below is link

The problem is that the latest version of react-native-geocoder was released 6 years ago and line 19 (that it’s complaining about in the error message) and also line 20 in the build.gradle are using “compile”, which is no longer supported. These days you should use “implementation”.

I think something like this should get around that particular error:

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "com.facebook.react:react-native:+"
}

You could try it out by using patch-package to change the react-native-geocoder build.gradle file under your node_modules directory. But given that it hasn’t been updated in so long there might be other problems getting it to work in a current version of React Native (and therefore Expo).

e.g. it was released before React Native autolinking existed, so I’m not sure if that will work.