2

I am following the tutorial to sign an apk for a native react app:

https://facebook.github.io/react-native/docs/signed-apk-android.html

But I can't locate the android/app where I am supposed to edit some files.

I tried using this path: ~project\node_modules\react-native\ReactAndroid I can see the files mentioned from the previous step, but then I run:

gradlew assembleRelease

And I get:

startup failed: build file '~project\node_modules\react-native\ReactAndroid\build.gradle': 8: unable to resolve class de.undercouch.gradle.tasks.download.Download @ line 8, column 1. import de.undercouch.gradle.tasks.download.Download

So my guess is, I am at the wrong path, could you point me to where is the android/app folder I'm looking for?

2
  • 1
    Did you create project via creact-react-native-app? Commented Feb 15, 2018 at 6:08
  • Yes, I even try to create another empty project with the same command, but I don't get that folder, it loads a bunch of node_modules only Commented Feb 15, 2018 at 13:46

2 Answers 2

2

Because create-react-native-app help to build app without configuration (no ios and android folder).

If you want to config more. run npm run eject or yarn eject in your project. After run that command folder ios and android will show up. But it will change your project structure.

Another way, you can build signed apk with expo (It's not change your project structure)

Sign up to request clarification or add additional context in comments.

1 Comment

Both answers are correct, I actually had expo (for testing in my device) I didn't know I could use it to sign and create an apk. If it helps someone, I actually tested both options by having a copy of my project and everything worked just fine.
0

did you run

cd android

command before running

gradlew assembleRelease

or you can run them in 1 command like

cd android && ./gradlew assembleRelease

1 Comment

I did, both separate and together, when together I get me the 'The system cannot find the path specified'. when I run only gradlew assembleRelease,I get the error from the question, please let me know if you have any other idea, thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.