Flutter Web Application Not Loading In Mobile Browser - flutter

I have created a mobile application for my business using Flutter and it is published in PlayStore which is working fine.
Later I have converted the application to web-friendly and built it using Flutter Web and hosted it using Firebase Hosting. You can see the website here: https://youmenotes.com/immadekada/bambusa/#/
Now the problem which I am trying to resolve is, the website is loading as per expectation in desktop browsers, but if I try to open this URL using mobile phone browsers, it is stuck in a white screen. No clue on how to resolve it.
Please give me some light on the issue if anyone faced the same.
Thanks!
Note: I have another Flutter Web app (a demo app) that is hosted using the same way, and it is working perfectly alright on both PC and mobile browsers. The URL is this: https://youmenotes.com/immadekada/bambusa/game1/#/

This was happened to me-
step 1: check if it is running fine on local
for that run following command
flutter run -d web-server --web-port 8080 --web-hostname 0.0.0.0
and check form your mobile which is same network as your pc by
entering url <pc's ip address:8080/>
step 2: build web with canvaskit render which is more suitable for mobile brower,
command: flutter build web --web-renderer canvaskit --release and
release it.

Thanks, for spending your time to find a solution for the issue. Here I have found the solution.
It was a simple coding issue that caused the incorrect behavior in mobile browsers!
There were some mobile-only features in my application and which I handled using the following method:
bool isMobile() {
if (defaultTargetPlatform == TargetPlatform.iOS ||
defaultTargetPlatform == TargetPlatform.android) {
return true;
} else {
return false;
}
}
So it was working as expected when running from mobile as a mobile application, and running in a computer as a web application. But when it comes to running it from a Mobile device as a web application, the method returns true since the platform is Android/iOS. And that caused my business logic to misbehave.
I updated the if condition with a proper checking for the web by adding kIsWeb, and the method started to return values properly.
Now the URL is loading correctly in both web and mobile browsers.
https://youmenotes.com/immadekada/bambusa/#/
Thanks, for your time.
Update:
How did I identify the issue?
Using Remote Debugging on mobile devices.
You can navigate to this page on chrome by using the URL chrome://inspect/#devices
Thanks,
Midhun.

Related

reCaptcha v3 on mobile devices

Could someone help me please?
I'm implementing Google Recaptcha V3, for Android and iOS applications.
I use the following command to get a return:
bool ready = await GRecaptchaV3.ready("");
When running as a web application, it works normally because it is imported in index.html
< script src="https://www.google.com/recaptcha/api.js?render=">< /script>
But, when running on the emulator, mobile applications do not interpret this index.html file, so the javascript is not loaded and my request does not return as expected.
Any idea?
Thanks!
Unfortunately, g_recaptcha_v3 only supports the web platform. As you can see in the screenshot below, the pub.dev site only lists web as a platform for this plugin.

Mobile Safari/Chrome - flutter web - failing to load - blank

My Flutter app has successfully been deployed via Firebase. I can access to any laptop browsers
On Mobile Browsers, it is failing and not able to see any error messages.
What could be root cause of a flutter web not functioning on Mobiles web browser?

Using brave browser to debug flutter web app

I just started-off with flutter web and I want to use brave browser to debug my flutter apps not chrome or edge.
When I use flutter devices command, it gives the following result.
No devices detected.
Run "flutter emulators" to list and start any available device emulators.
I'm using brave by using the link provided by web-server and it does not support hot reload.
So, how to configure browsers other than chrome or edge with flutter web for complete functionality.
I found this:
All you have to do, based on your Linux operating system (for Windows
and macOS the process is similar), is to modify your .bashrc file and
insert this line:
#Put your Brave installation location here
export CHROME_EXECUTABLE="/opt/brave.com/brave/brave-browser"
For MacOs,
export CHROME_EXECUTABLE="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
You can use flutter run -d web-server to run your app like a server.
This means that you can just enter the URL on any browser of your choice to access your Flutter app !
Drawbacks:
Hot Restart/Reload from the terminal is not possible. You must refresh the page on your browser instead.
Advantages:
You can use any browser for developing flutter apps.
You can even use ngrok to forward your port to a HTTPS URL, and access your flutter app from anywhere (your phone, your desktop , someone else's device etc.)
PS: Credits to the Issue #77229 for helping me find this solution. I am aware that this workaround has already been suggested on this thread.
I just wanted to put out a simpler answer for the general viewer.
I've been diving in the same issue, it's known Brave it's Chromium-based, this will help u https://github.com/flutter/flutter/issues/77229

How can I debug a Flutter Web App on Safari using the inspector?

I am using flutter to write a simple app, everything works fine on Android, iOS, and Chrome. (I've also tested on Firefox & Brave Browser, all's well).
However, on Safari (Mac & iOS), the flutter app gets stuck on the index.html file and does not load the PWA.
The error from the console on Safari Inspect
How can I know what the anonymous function in js_helper is, or what main.dart.js:57063 refers to?
Is there any way of building for web without minifying?
Has anybody encountered a scenario where everything works on all platforms except Safari?
Flutter Doctor
Log from console when running on local server
debug for safari is not supported yet
but for anyone with the same problem you could solve it by running the app on release mode
flutter run -d chrome --release
after that open with the same port on safari and everything should be fine
You won't be able to debug it directly on Safari, but if you just want to test your app in safari with localHost, you can use these steps :
Enable 'developer' menu in Safari from settings of Safari :
Then check on 'Disable Cross-Origin restrictions"
Now after running release version of web app in chrome, use same app's address in Safari, you will be able to test it. Ex. http://localhost:51155/
to run in release mode : flutter run -d chrome --release
Hope this helps!

Debugging Servlets in Eclipse

I have created a web application using the Google Web Toolkit that is able to receive some data by a mobile client via Http Post. The transmission of the data works well and also the server / client communication using GWT RPC is no problem at all.
However, I need to debug the webserver when receiving data from the mobile device. As I am using Hibernate and MySQL within the web application I do not use the Google App Engine. So if I deploy the web application in local host mode it is only accessible on the localhost:8888.
Now, if I send data from the mobile phone, I have to send it to the locally assign IP address as the localhost of the mobile phone emulator is not the localhost of the computer, where the web application is running. To ensure that everything works, I tried to do some posts outside the emulator (on the machine the emulator is running on). This works, but how can I post from the emulator to my web application?
How can I get access to debug my system? I've already tried to deploy the final application to a tomcat server and use remote debugging, but that fails too.
Best regards,
Florian
Well if I understand your question correctly, the real problem isn't debugging the app on the servlet, the real problem that you're looking at is debugging from a mobile phone. When the mobile phone hits your local network (I'm guessing you're pointing at 192.168..?) you are accessing the compiled GWT code that does not communicate with the debugger.
Put another way, when you debug locally using a browser, you are actually not running compiled GWT code, but instrumented code that is executed with the GWT Debugging Plugin, that happens to work exactly like compiled GWT code. (mostly). So while your local version has "?gwt.codesvr=127.0.0.1:9997" or the like, your mobile phone version cannot do the same, and cannot thus communicate with the debugger.
The best that I've been able to do is to use logging extensively. If you're using an iOS device and change the settings are your safari, it can output logs for you from mobile safari. Also, if you're using the Android debugger with a WebView app, you can attach a listener for log messages and then ferry them on to the ADB and view those in Eclipse. Definitely not as good as a debugger, but that's the best I've come up with so far, and if anyone has a better solution I would love to know it :)
Hope that helps!