Build Apk file is not working same as debug APK file work in react-native - react-native

I have an existing project. I build an APK file a month ago for the first time. it was working the same as debugging APK file work in the emulator. But I have added some new features to my project and it works properly in the emulator. But when I build an APK it is not updating anything(any features). it looks like the same as before(previous build/version). Every feature appears and works properly in the emulator but after building APK file, not a single new feature is working on the mobile.

Related

Where can I source help for native crashes of an expo EAS apk build

I am building an app using react-native on Expo and making sure to build with EAS every few days or whenever I add a new dependency.
After every build, I install the apk on an Android device and run the ios build on a simulator.
On my latest build, the build completes successfully but after installing the apk on android 10, the app opens and crashes once I navigate to a certain page.
It works fine on 3 other android phones.
The code difference between the last successful build that doesn't crash to the current one is minimal however very necessary for the app.
How can I see logs from the native crash in order to find the cause of the problem and hopefully find a fix?
I tried to install sentry but at the bottom of the page, it explains it only follows js issues and is not native.
Any ideas will be helpful
Thanks

Not going to release apk after expo eject

I created a new project at Expo, after which I was already building it using expo buildbut over time I needed to move away from Expo a little and execute an expo eject, and then continue development on regular React Native.
I ran into the following situation: I am trying to build an apk file with the ./gradlew assembleRelease command, but I get a debug build instead of release, I don’t understand why this is happening, I tried to follow the build instructions specifically for the release version - unsuccessfully.
I also tried to create a new project without using Expo - the whole scenario described above worked correctly and I got a release build of my application, and with all that, I compared the android/app/build.gradle files in these two projects and they are almost identical in terms of their configuration.
My main task and problem is to build the release version of the apk file and understand why, with different attempts to build, I only get the debug apk.

compile apk on a folder "Android" already created previously in 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.

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

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).