I have a react-native app with ios and android versions. Both versions use a webview to access a web site. The ios version works when pointed to either the production web site or local development version. The web site uses ruby on rails and the development server is pow.
When I run the android app, it loads but when it tries to access a local version of the web site, it returns the following error:
console.error: "Encountered an error loading page", {"canGoForward":false,"code":-2,"canGoBack":false,"description":"net::ERR_ICANN_NAME_COLLISION","loading":false,"title":"","url":"http://my_app.dev/,"target":69}
The same happens if I use localhost rather than the my_app.dev. It does however work when pointed to the external production url i.e my_app.com.
I have tried using a different android device, and the error changes to ERR_CONNECTION_REFUSED. The first device used the android browser whereas the second looks like it uses chrome. So it does appear to be a browser specific problem. Reading this link, I used nslookup my_app.dev to work out the ip address as 127.0.53.53 and entered
127.0.53.53 my_app.dev
into the /private/etc/hosts file. However this still gives same error. How do I fix this?
A work around for this problem is to find out the ip address of the development machine, say 192.168.0.33, configure the server to allow external access at my_app.192.168.0.33.xip.io, and then in the react app, configure the host url as http://my_app.192.168.0.33.xip.io. However this means running the server in special mode, so it would be better to find a direct answer to this question.
Related
I have set-up my ESP32 cam and it runs fine in the local network. However, I want to integrate it with my android app where the user can see the livestream even if outside the network. I have looked into Ngrok and figured I can use it to host my local web server to the ngrok domain. Then I thought I could use a webview that has the ngrok url so that the app would display it on the front-end. However, I am faced with the issue "Header fields are too long for server to interpret" on the app even if the livestream or url can be viewed using the same device, but on a browser. I am unsure if this issue is from Ngrok or the Application side.
I did not use the specific error as my question's title because others might suggest a more optimal way of implementing this other than Ngrok. However, any input is appreciated and it would also be nice if anyone knows how to fix the issue stated.
I develop web/phone app that uses Google Endpoints.
App properly works from localhost and when deployed to GAE.
App also properly works in Intel XDK emulator and when debugged in Intel XDK App Preview on device.
App doesn't works when run on Android device as .apk. Looks like it cannot make call to Google Endpoints.
It also doesn't works when running in browser from file system. In this case I see the exception:
Failed to execute 'postMessage' on 'DOMWindow': The target origin
provided ('file://') does not match the recipient window's origin
('null').
Some answers (Google API in Javascript) provide information that issue can be solved by changing configuration on Google Console, but I cannot found anything in Google Console that related to origin.
I am new to mobile development, so I can had miss something obvious.
Any help will be very appreciated.
As it was supposed by konqi problem had solved by domain whitelistening
In Intel XDK it can be done by following next steps:
Open Projects Tab
Expand Build Settings
Enter "*" (without quotes) to Domain List field.
I am a developer of DisciplineXgames! We are developing a mobile app. We have downloaded the Cordova test suite from here (https://github.com/apache/cordova-mobile-spec). When I upload this on DisciplineXgames server it shows an error in alert box "Error: Apache Cordova did not initialize. Demo will not run correctly." but when we upload the same folder on Phonegap server it works perfectly fine. Unfortunately this doesn't solve our problem as we are building our mobile app on our server and just using Phonegap to redirect the user to the page hosted on DisciplineXgames server if there's Internet in the user's mobile.
First error which I got in the console area in Google Chrome is cordova.js missing when I provided that than it outputs another error that is cordova/channel is required.
Hope you can guide us through how we can use Cordova's amazing features on our server instead of Phonegap's local server.
I am a bit confused as to what you are trying to accomplish here but I am going to take a stab.
You want to develop an app that when the app launches, it checks to see if the device has internet connectivity. If it does, then the app just opens the mobile website hosted on your servers. if there is no internet connectivity then the app ???
Since this is a very simple use case for an app, I would avoid using cordova and instead use PhoneGap Build. Simply write an index.html page and a .js file to check for the connectivity and then use the inappbrowser plugin to open your mobile site if there is connectivity. Once that is done, zip your package, upload to phonegap build and then download your compiled apps.
phoneGap Build allows you to avoid the app building overhead and the need to install things BUT prevents you from taking advantage of some of the deeper configurations and some plugins. But again, for your simple use case, PhoneGap Build sounds like the way to go.
I have been trying to get some people to test an android app and needed a friendly way to delivery it since it is not currently on the marketplace. I had uploaded it to my website and found that mostly every attempt to download failed. This was wither through the android emulator or actual devices.
I was only able to successfully download on 1 device personally and the rest of the users reported download unsuccessful/failed.
I put the file on 2 different webservers and and I was successfully able to download via android browser from the other servers.
What should I tell my primary host so I can resolve this problem?
They need to add the mine type for ".apk" to "application/vnd.android.package-archive"
I had a similar problem and fix it by adding the mime type to the site configuration in IIS. On Apache I haven't encountered the problem.
I have developed a mobile application using jQuery Mobile. I have it working in the emulator using the default web browser engine. Now, I want to test the app using the different browsers engines available on mobile devices. I have seen this accomplished from other developers, such as Opera, Chrome, or Safari. What is happening is these different browsers are being pointed to the Android emulator that is running the application.
Can anyone provide a link on how this is accomplished so I may follow the steps? I have searched the net and I can seem to find any solid information that explains this well enough for me to follow.
Thank you for reading my post.
You can use the emulator to browse the web and go to websites with browser packages for you to install other apps in your virtual phone.
Alternatively you can use DDMS to transfer the .apk files to your virtual mobile phone, and then install them without using internet on emulator.
Then, when you have some application associated with a specific file type or operation, typically Android asks you which one you want to use, with a popup, and allows you to also set a default one for that file type/action.