Axios request app on android doesn't work, react native - android

I am having a problem that I do not know why this is happing, I am using axios to make request a api, it working fine on emulator, but when I build the apk and install it on the phone, looks like it is not getting the request, I installed the same apk on emulador bluestacks and is working fine, it is my first app react native, and I do not know why this happen, some one had a experience like it ? and could help

I fixed it, to work in Release Apk, I need to put
android:usesCleartextTraffic="true"
in the tag application on android manifest

Related

does react native release mode must have hosted api / db?

im quite new on react native and i want to build this app so it can run remotely on device , on debug everything went fine, it uses api and xampp mysql for db
when i try to build apk release and run npx react-native run-android --variant=Release the build is successful but when i open the app it instantly crashed
im wondering if it because my api and db still not hosted yet , must it hosted first and only then u can release it ? i kinda want to try it on device before hosting my db and api
i try adb logcat *:E and this is what i got
https://drive.google.com/file/d/1lv4X2U4QjMyeNMlNTo5jDe243pUMALbl/view
I've fixed it , it just need to use axios https instead of axios http
and i import usestate wrong , bcs its automatic
i've actually tried this before but i think i've tried this fix separately and i already reverted one of them with git , so i thought 2 of these things is not the solution
tried 2 of them again today bcs of desperate and thankfully it worked

Axios requests is not working in React-native released apk in android latest api level pie?

I am unable to send an API request with any library like Axios fetch to a server with released APK
in react-native in android pie
In debug APK everything is working fine but in released APK not working
I have deployed my server on digital ocean with https protocol and the server is written in flask
my react-native version is 0.59.1
react 16..8.3
android:usesCleartextTraffic="true" in AndroidManifest.xml is also not working
I really need an expert opinion and suggestion that what should I do now
it's been one month that I am unable to resolve this
Just change HTTP to HTTPS, Will solve the problem.
pass this android:usesCleartextTraffic="true" in application tag in AndroidManifest.xml file it work
/// add this line to android manifest to use http when releasing apk in react native

Expo app runs on ios and emulator but not on android device

The Expo app will build and run correctly on ios simulator, ios device, and android emulator. but when I build an apk and run on an android device the app freezes after login and will not respond. I'm fairly new to react-native and development in general so I'm not sure what I would be doing wrong?
Are you running the app on debug or release? You can trace the error using logcat on Android Studio or using react-native log-android in a terminal window. That should show you the error message. There are many ways to understand what is happening after you login. Check out https://facebook.github.io/react-native/docs/debugging
You can also show us some code, getting your login code would help shed some light on what is going on.
I had this issue with my code. It wasn't login related, but rather because I was using Google Maps API and I didn't have an API key set in app.json for Android.
https://github.com/brentvatne/growler-prowler/commit/3496e69b14adb21eb2025ef9e0719c2edbef2aa2
The comment of #letsGITstupid helped me out to figure out the issue, that's why +1.
However, the real problem was lack of API key in the AndroidManifest.xml:
<meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_KEY"/>

Cordova: HTTP requests seem to be blocked on android (production) application

I published yesterday a Cordova application on the Android market (aka Google Play Store) and I noticed a weird bug that I can't reproduce in dev environment.
In fact, all the HTTP requests seem to be blocked by the application (The Ads won't show, the inline images in the articles won't show, the video won't load, etc).
I properly set the access origin to "*" in my config.xml file and when I take a look at the app permissions I see it can receive information from the Internet. Of course the application works properly when I build/install it from my computer.
Also I don't see how I could fix this or even start debugging it.
Have you got any idea how I could debug this ?
Thanks
NB: The apps works great on iOS devices (dev and prod)
I solved my issue.
The problem was that I removed the plugin jsHybugger (before building and signing the app) with the following command
cordova plugin rm org.jshybugger.cordova
and did not regenerate the android platform afterward.
So I just did
cordova platform rm android
cordova platform add android
and all went fine.
Apparently Cordova keeps some files of plugins even after they're removed from the project. I guess those jsHybugger calls where making something crash on my app (because the plugin wasn't there anymore)...
NB: To debug the production version of my app, I simply installed the corresponding apk (found in platforms/android/bin/MY_PROD_APP.apk) on my phone (the one I sent to Google Play Store)

Issue with using ksoap jar, when install my app on a real android device

I have a problem with my android application.
That application which uses the kSOAP jar, in order to make connection with a webservice.
In the eclipse emulator everything works fine.
But when I extract the apk and install it on a real device, the application says that there isn't installed.
If I remove the kSOAP, I can open the application.
What should I do?
Regards
Resolved.
The problem was related to the use of: android:permission = "INTERNET", on every Activity.
And related to when i export the apk, i was not include the kSOAP jar.
My bad.

Categories

Resources