skip to Main Content

I have a simple react-native project when I try to build an android release version of the application, I face this error message:

Caused by: java.lang.RuntimeException:
org.gradle.api.InvalidUserDataException: NDK not configured. Download
it with SDK manager. Preferred NDK version is ‘21.4.7075529’

I made a Keystore and set password like android studio to get a release and debug apk.

I tried this until now:

  • I tried to set NDK in android studio but couldn’t build the project.
  • I also modified build.gradle to build the project but was unsuccessful.

I put my singingConfig and buildTypes and also stackTrace below.

my keystore data
singingConfig and buildTypes

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

A problem occurred configuring project ‘:expo-modules-core’.
Failed to notify project evaluation listener.
> org.gradle.api.InvalidUserDataException: NDK not configured. Download it with SDK manager. Preferred NDK version is ‘21.4.7075529’.
> Could not get unknown property ‘release’ for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

2

Answers


  1. Chosen as BEST ANSWER

    I solved this problem using another way to get release version of the apk. I used eas build -p android or expo build:android and finally after a really long time expo generates apk on his website. But it was too large application about 60mg and I'm trying to reduce it's size.

    eas build -p android this command is for abb version expo build:android this is for apk release. but unfortunately, I Couldn't use gradle in order to release apk.


    • Open root folder projectname > android > open local.properties > copy and paste below lines after sdk.dir (if you don’t have a local.properties file copy the below file and change SDK path according to your operating system.)
    sdk.dir=/Users/yourusername/Library/Android/sdk
    
    • ndk.dir=/Users/yourusername/Library/Android/sdk/ndk/21.4.7075529 (You should find this version in the NDK folder and the path will vary depending on your operating system.);
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search