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
I solved this problem using another way to get release version of the apk. I used
eas build -p android
orexpo 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 versionexpo build:android
this is for apk release. but unfortunately, I Couldn't use gradle in order to release apk.sdk.dir
(if you don’t have a local.properties file copy the below file and change SDK path according to your operating system.)