简体   繁体   English

为什么我的应用程序在我的 android 仿真器上运行良好,但在我的真实 android 设备上运行不正常

[英]Why my app is working fine on my android emulator but its not working fine on my real android device

My app is working fine on my android emulator but its not working fine on my real android device my i am using react native & nodejs if anyone can has faced this same problem pls help me我的应用程序在我的 android 模拟器上运行良好,但在我的真实 android 设备上运行良好,我正在使用 react native 和 nodejs,如果有人遇到同样的问题,请帮助我

NOTE笔记

  • MY REAL PHONE resolution & screen size ARE SAME WITH MY android emulator BOTH ARE SAME我的真实手机分辨率和屏幕尺寸与我的 android 模拟器相同
  • MY ANDRIOD EMULTOR API IS 30我的安卓模拟器 API IS 30

ISSUE THAT I CAN SEE IN MY REAL ANDRIOD PHONE我可以在我的真实 ANDRIOD 手机中看到的问题

  • Some text are going their on the wrong position有些文字写错了 position
  • Some text are not even seeing to me but their onpress event is working有些文字甚至没有看到我,但他们的 onpress 活动正在运作
  • my backend is not connecting with my app.我的后端没有与我的应用程序连接。 I mean socketio is not connecting in my real phone but its connecting in my emulator i am using http://10.0.2.2:3000 in my base url to connect my app with backend i can't use localhost because emulator is not supporting it So the question is what url should i use to connect to my app with backend while using my real phone?我的意思是 socketio 没有在我的真实手机中连接,但它在我的模拟器中连接我在我的基础 url 中使用http://10.0.2.2:3000将我的应用程序与后端连接我无法使用 localhost 因为模拟器不支持它所以问题是我应该使用什么 url 在使用我的真实手机时使用后端连接到我的应用程序?

WHAT I HAVE TRIED我尝试过的

  • Deleted my app from my real phone than run npm start & npx react-native run-android从我的真实手机中删除我的应用程序而不是运行 npm start & npx react-native run-android

  • i have added android:usesCleartextTraffic="true" in android\app\src\main\AndroidManifest.xml我在 android\app\src\main\AndroidManifest.xml 中添加了 android:usesCleartextTraffic="true"

  • i have also done cd android./gradlew clean cd.. and than npx react-native run-android我也做过 cd android./gradlew clean cd.. 和 npx react-native run-android

  • NONE OF THESE SOLUTIONS WORKS IN MY CASE这些解决方案都不适用于我的情况

HOW IT LOOK LIKE IN MY ANDRIOD EMULTOR ITS LOOKING FINE AND THIS ONLY I WANT它在我的 ANDRIOD EMULTOR 中的样子 它看起来很好,这只是我想要的

在此处输入图像描述 在此处输入图像描述

BUT HOW IT IS LOOKING IN MY REAL PHONE但是在我的真实手机中看起来如何

在此处输入图像描述在此处输入图像描述

Add a this on your textinput to make your text visible.在您的文本输入上添加一个 this 以使您的文本可见。 This will make your placeholder text visible.这将使您的占位符文本可见。 placeholderTextColor="#808080" placeholderTextColor="#808080"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的反应原生应用程序无法正常运行,但在模拟器上运行良好 - Why my react native app is not working properly but its working fine on emulator PhoneGap设备准备就绪,无法在ios中触发,但在android模拟器和涟漪图中可以正常工作 - PhoneGap Device ready not firing in ios but working fine in android emulator and ripple 在我的Jquery中递增无法正常工作吗? - Increment In my Jquery No Working Fine? amp 应用程序横幅未显示在 android 和 IOS 设备中工作正常 - amp app banner does not show in android and IOS device working fine 我的 JS 不能在 codepen 中工作,但在控制台中工作正常 - My JS is not working in codepen but working fine in the console Ionic应用程序可在浏览器上正常运行,但在我的Android设备上无法正常运行 - Ionic app works true on browser but does not work fine in my android device 我的JavaScript代码无法在本地运行,但可以在jsfiddle上正常工作,为什么? - My JavaScript code is not working locally, but works fine on jsfiddle, why? 使用Canvas Signature pad我在模拟器中创建它工作正常但在Android设备中有两个签名板即将到来 - Using Canvas Signature pad i have created in emulator it is working fine but in android device two signature pad is coming 我的滚动功能在samsung android Mobile中不起作用,但在所有浏览器和设备上都能正常工作? - My scrolling is not working in samsung android Mobile but works fine in all browsers and devices? Myscript在我的本地主机中不起作用,但是如果在jsfiddle中很好 - Myscript not working in my localhost but if in jsfiddle it's fine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM