-1

enter image description here

i can't build apk and I have this error

2 Answers2

0

Try clean build:

  1. Delete node_modules
  2. npm cache clean –force
  3. npm install
  4. cd android
  5. gradlew clean
  6. gradlew assembleRelease -x bundleReleaseJsAndAssets

if this fails: in root of project:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

You can track this issue here: https://github.com/facebook/react-native/issues/28510

Priyanshu Chauhan
  • 5,297
  • 5
  • 35
  • 34
  • it is still not working, here is another image of my logs, idk if it helps https://cdn.discordapp.com/attachments/942830353494728766/1021094418104721559/unknown.png – Adrien Senut Sep 18 '22 at 16:25
  • add ndk in build gradle: https://stackoverflow.com/questions/64372383/ndk-at-library-android-sdk-ndk-bundle-did-not-have-a-source-properties-file Also, these seems to be warnings not errors. Can you check if apk is there at android/app/build/outputs/apk/xyz.apk, or android/app/build/outputs/apk/release/xyz.apk – Priyanshu Chauhan Sep 19 '22 at 03:56
  • i did it and still get the error, and by the way there is a message "NDK at C:\Users\adrie\AppData\Local\Android\Sdk\ndk\21.4.7075529 did not have a source.properties file" and when I go to that directory there is indeed no source.properties file, idk if it helps https://cdn.discordapp.com/attachments/942830353494728766/1021431486899048458/unknown.png – Adrien Senut Sep 19 '22 at 14:44
0

I fixed it, it was because one of my folder had a space and it tryed to run it as a command