compile apk on a folder "Android" already created previously in react-native - react-native

I'm new to react-native, I've seen tutorials but everyone uses expo. I downloaded this project where they don't use expo. I want to compile this application for android, to finally get an .apk
This application already has a folder called "Android" but inside it does not have its respective .apk. How can I generate it?
this is the repository:
https://github.com/zsajjad/BusinessCard
It would be great if you can attach screenshots of how I should do it
Note. I have the latest version of android studio and I don't see the option of "build"
commands like "gradlew" from the console, they don't work, it's as if I didn't have that command installed

Following instructions for build apk using android studio
Hope you installed node and react native on your machine. If not
please follow the link to install it.Install node and react native
open your command prompt or terminal and redirect to your download project - cd /Businesscard Master (change it according to your project location)
Now enter - npm install
Enter - react-native link
Follow the android related linking instructions on following link react native camera
Hope you know about android camera and storage permissions.
same thing for react native text detector. Because your downloaded project have that packages in package.json
Now open your project android folder in android studio using open existing android project.
Then select build your project from android studio build menu and run it also
Generate apk using build menu- same process you have to follow for native android project

You don't need to use the CLI, that's needlessly complicated and it obscures what Android Studio is actually doing. Here's all you need to do.
Open the whole /Android/ folder in Android Studio. This is your "project" similar to how you open a *.xed file in XCode. Except in Android Studio, you just open up the whole folder to get the build.
Android Studio will now prepare your project using Gradle. If there are any errors in the preparation it will tell you about them. Assuming your gradle and Android Studio versions are compatible and you got no errors, you're now ready to emulate, debug and create a production build. At this point the workflow is similar to using XCode. You'll see emulators under Tools -> AVD Manager.
In the file menus go to Build->Generate APK. You can choose between signed APKs, debug APKs and so on. You'll need the key file if you're signing the APK on your computer, otherwise there's also Google Play signing after you upload the APK.
TL;DR: Just open your /Android/ folder in Android Studio.
Side note: When Android Studio gives you popups to upgrade stuff don't do it. NEVER upgrade Gradle or Android Studio unless the RN / Expo team specifically ask you. This will break your whole project and you will need to rebuild the platform.

Related

Impossible to update expo project inside Expo Go after switching to EAS Build

I have the need to run a project from Expo Go without being connected to PC. We are developing an app that require GPS and needs to be tested in open field.
Before EAS became the standard to create projects i used
expo build:android
ad this created not only the apk, but uploaded the project to my account and i was able to start it from Expo Go projects section just like the app was installed on phisical device. That worked also fo iOS and was a great testing feature.
After i moved to EAS Build
eas build -p android --profile preview --clear-cache
my project inside Expo Go does not update anymore and its stucked at sdk 44 even if now i'm working (and creating builds) with sdk 46.
I went through the official documentation many times but i don't get how to make the app start from Expo Go (project sction) as i did before. Maybe i'm missing some configuration.
Thank you all for any kind reply.
Have a good day.
EDIT
I found the solution to this problem and now my builds are working and uploading to Expo Go.
Check out this information: https://github.com/expo/fyi/blob/main/eas-build-archive.md
Basically EAS Updates will not bundle anything inside your .gitignore, in my case it needed specific config files. Did a quick test by taking them off the .gitignore and now it's working. Will move to GitHub SECRETS in the future.
Hope that helps.

How do I compile a react native project to Android apk file

I wrote the code for the app in Visual basic. I was also using the cygwin terminal for making files, folders, installing packages etc. Expo also so that I can run the emulator. I now have the folder in Visual basic so how do I convert it to an apk file? Please help.

Why is IOS folder too huge when compared to android folder in React-Native?

I have developed an app in react native, but the project folder is too large(1.2GB) to upload into git and the IOS folder itself holding 0.9GB.I have done the following steps to overcome the issue
Steps Followed :-
Deleted Android and IOS folders from project folder.
Uploaded and Downloaded the project code using git.
Later run the commands like npm install and react-native upgrade
After running the above commands to generate IOS and Android folders, we are supposed to run Android version, but facing issue with IOS.
So...I request you to let me know the proper process of uploading code into git such that i can run both Android and IOS.
Make sure you have a .gitignore and make sure at a minimum that the build and node_modules folders are not included. For me 95% of the size is from that.
example gitignore

Unable to Config Android sdk in Mobile First Foundation 7.1

I am working on hybrid Apps over IBM Mobile First Foundation on eclipse,I want to build an android app of the project, but when i configure the android SDK location and click on apply, nothing happens
Help!
The question is not clear enough... what are you applying? where? are you getting any errors, if yes, what are they?
When using MobileFirst Studio in Eclipse, the Android project can be generated in two ways.
By using the Google ADT tools.
Install the Eclipse plug-in and re-build the project by right-clicking the application folder and selecting Run As > Run on MobileFirst Development Server
By providing the path to Android Studio.
First install Android Studio and then, in Eclipse, navigate to File > Preferences > MobileFirst. Provide the path to the folder containing the executable. For example in Mac OS X that would be /Applications.
Then right-click on the Android environment folder and select Run As > Android Studio project.
Note: be sure not to convert the project to Gradle structure - this is currently not supported.

Tips/help to debug no apk file

My environment :
Eclipse sdk 3.7.2
Worklight pluin 5.0.5
Android sdk 2.2
First I tried a simple Hello World, everything works fine, android native project was created and I see the corresponding apk file was generated after a build and deploy.
Next I imported a sample project, successfully got it run on the test (localhost) server, able to see the expected result on the android Mobile Browser Simulator but the problem now is I am not seeing the corresponding android apk file got generated (the android native project was created). No errors on the logs, Any idea what could be the problem? How one debug such a problem.
APK will be generated under \bin\ folder once you run your app for the first time.
Connect your Android device to dev machine via USB cable (assuming you got Android SDK etc installed), right click on Android project and do Run as->Android app.
The app will be installed and started on Android device. APK will be generated in \bin folder.
In general, you don't need the device, same thing can be done with emulator.
You can also do an export on the android application project. This is what you would do if you are looking at doing some key signing. This is the way you would want to export it if you are uploading to Google play or an enterprise app store.
Keep in mind, Worklight doesn't build your .ipa, .apk, or etc. It builds you compile ready resources. It will build you the folder structure and the project layers needed to build in the corresponding Native Environment (for apple, you would export to xcode, build it, and run).