0

I have just generated a release APK of my React Native app and installed it in my device but it seems not being able to communicate with my API. If I run it through CLI using [react-native run-android] everything works fine but when it comes to the generated APK I can't even authenticate in the app.

I don't know if it has something to do with Secure Sockets Layer or even cors. I'll be pleased if you guys could help me out with it.

That's my app config:

import express from 'express';
import cors from 'cors';
import routes from './routes';

import './database';

class App {
  constructor() {
    this.server = express();

    this.middlewares();
    this.routes();
  }

  middlewares() {
    this.server.use(cors());
    this.server.use(express.json());
  }

  routes() {
    this.server.use(routes);
  }
}

export default new App().server;

Context Information: APK installed in Galaxy S10 (android 10)

  • Sorry but this is nowhere near enough information to try and help you with your problem. – Andre Jun 05 '20 at 14:28
  • I'm sorry Andre. That's all I know about the problem. But I'm open to give any additional information you might think it is relevant. – edilsonlm217 Jun 05 '20 at 15:16

1 Answers1

0

It could be better if you provided more information about your test environment (emulator) and the device you use for testing generated APK.

however, I guess it's a network security issue in new android versions, so take a look at this answer.

Mohammad
  • 792
  • 1
  • 7
  • 15