Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

How can I debug my android device? App opens but page is blank after splash screen #217

Closed
arivera12 opened this issue Jul 18, 2020 · 29 comments

Comments

@arivera12
Copy link

arivera12 commented Jul 18, 2020

I tried watching the output console but don't see any error.

@Daddoon
Copy link
Owner

Daddoon commented Jul 18, 2020

Was your app working before ?
Do you have a blank page when doing remote debugging ?

Otherwise for Android, when you want to debug directly the device browser, you may use Firefox 69 on your PC and use the WebIDE debugger in order to see what happens internally.

WebIDE is deprecated on newer version of Firefox and GeckoView but this part is not yet updated. That’s why you may need Firefox 69. See WebIDE documentation for more information.

See this related also: #194

@Daddoon
Copy link
Owner

Daddoon commented Jul 18, 2020

Also do you have changed something recently in your app ?

@arivera12
Copy link
Author

Was your app working before ?
Yes
Do you have a blank page when doing remote debugging ?
Haven't done remote debugging yet need to try what you commented on the other post

Otherwise for Android, when you want to debug directly the device browser, you may use Firefox 69 on your PC and use the WebIDE debugger in order to see what happens internally.

WebIDE is deprecated on newer version of Firefox and GeckoView but this part is not yet updated. That’s why you may need Firefox 69. See WebIDE documentation for more information.

Let me give it a try.

See this related also: #194

@Daddoon
Copy link
Owner

Daddoon commented Jul 18, 2020

If your app does not work on your computer even with or without remote debugging available when launching your regular Blazor app, the problem is likely in your Blazor app.

In this case the best is to open your web browser console and see what happen.

Also check that there is no 404 error. Recently I have seen some regression with Visual Studio failing to load Razor Class Library file even if all seems correct.

@arivera12
Copy link
Author

My app works properly on browser. It just doesn't work on android device. I was unavailable to setup the remote debugging. I not sure if ports aren't configured properly or what else could be.

@Daddoon
Copy link
Owner

Daddoon commented Jul 18, 2020

Ok !

What have you changed recently ?
I don’t see any reason why it wouldn’t work anymore without any change.

If you have a blank page , this mean that things didn’t boot or loaded. Remote debugging not working at this point is not anormal in my opinion.

You should try to see what you changed, if any, and debug through WebIDE and / or use adb logcat in order to see what happen. Check that there is no Xamarin exception too.

@arivera12
Copy link
Author

Can I send you a demo which reproduces this error?

@Daddoon
Copy link
Owner

Daddoon commented Jul 18, 2020

I’ m on vacation and will be back only in 3 days. I will not be able to take a look before next Wednesday.

@arivera12
Copy link
Author

ok. I will keep trying to look around if not I will attach it on thursday or friday for you. Enjoy your vacations! =D

@Daddoon
Copy link
Owner

Daddoon commented Jul 29, 2020

Did you have solved your issue ?

@arivera12
Copy link
Author

I could not resolve.

@Daddoon
Copy link
Owner

Daddoon commented Jul 29, 2020

If you have a repro project I will look when I have some time

@arivera12
Copy link
Author

Ok let me delete bin stuff and shrink it.

@arivera12

This comment has been minimized.

@Daddoon
Copy link
Owner

Daddoon commented Jul 31, 2020

Sorry i cannot test your app, something is missing somehow.
There is errors, but mainly, it seems that HttpBaseUsersService class is missing.

@arivera12
Copy link
Author

Sorry i cannot test your app, something is missing somehow.
There is errors, but mainly, it seems that HttpBaseUsersService class is missing.

Let me revise it.

@arivera12
Copy link
Author

OneLineDemo.zip

@arivera12
Copy link
Author

Any news?

@Daddoon
Copy link
Owner

Daddoon commented Aug 6, 2020

I'm not available theses day yet.

@Daddoon
Copy link
Owner

Daddoon commented Aug 9, 2020

Still not available but be sure i will take a look in few days.

@arivera12
Copy link
Author

Ok, once you help me get this up a running I will give feedback for this #220 (comment)

@arivera12
Copy link
Author

@Daddoon I am having a demo in 2 weeks can you help me get this up and running? After this I need to contact you to show you and share as a reward for this? It's one interesting tool I talked to you some months ago.

@Daddoon
Copy link
Owner

Daddoon commented Aug 14, 2020

I have done some tests on your project.

In my opinion the error is not even related to BlazorMobile, there is different errors that need to be test and fixed on your side.
I have updated NuGet package versions for Blazor / BlazorMobile

While trying on the Blazor web project my first issue was:

System.MissingMethodException: Method not found: Microsoft.Extensions.Configuration.IConfigurationBuilder Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder.get_Configuration() blazor.webassembly.js:1:38061
  at OneLineDemo.Blazor.Program.Main (System.String[] args) <0x2a6e9d8 + 0x000be> in <filename unknown>:0 blazor.webassembly.js:1:38061
  at Microsoft.AspNetCore.Components.WebAssembly.Hosting.EntrypointInvoker.InvokeEntrypoint (System.String assemblyName, System.String[] args) <0x2a18c80 + 0x0011a> in <filename unknown>:0 

By adding some "logs", Console.WriteLine that you will see in Program.cs, i can see that the first exception is in the builder.AddEnvironmentConfiguration call. By reaching the "source" of this reference, it seem that this is an extension you have written yourself, i think something is wrong in it, or maybe it's referencing a different or outdated API version, or maybe you are doing reflections but the method does not exist on what you were expecting, i don't have the code on my eyes (neither want to debug it myself).

By commenting this call, we go further, still have a white page that prevent loading, but by looking on the exception, it seem that an exception is occuring in your BlazorWebStorage plugin, and depending how you have implemented your code, you may have missed how to fallback on a regular page in case of exception ?

There is also BlazorMobile exception occuring because there was no Device connection while starting during my test, but this seem normal in my opinion, as it was expected.

I think you should look at your code on theses 2 primary point.

  • Just an additional information, keep in mind that BlazorMobile, in it's current version, does clear cache and i think maybe local storage at app startup. This will not be a problem in your desktop browser test, but can be problematic on your Device test, as data will always be empty. This choice was initially by Design (avoiding cache issues or else) and maybe too agressive.

I will not do any modification on BlazorMobile soon on this particular case. I highly recommand you that you create an other service implementation of storage, that go instead on native for writing and reading values and datas.

For more informations about the data clearance implementations for each platform browser, if you want to take a look, search on ClearWebViewData in the source code, but it may be cumbersome and you will have to recompile your own version of the plugin in this case...Or maybe not if you inherit some WebView class's and do the right override, but this is out of scope of all of this.

Here is your project with my tests and changes:

OneLineDemo.zip

@arivera12
Copy link
Author

arivera12 commented Aug 14, 2020

Thanks for your valuable time. Did you got this up a running? I will try the attached project!

@Daddoon
Copy link
Owner

Daddoon commented Aug 14, 2020

No, i mean, there is an exception between a rendering process and your BlazorWebStorage. But i think that if you change some code you should be able to at least see the starting page of your app.

@arivera12
Copy link
Author

can you share the exception being thrown on BlazorWebStorage?

@arivera12
Copy link
Author

It seems I need to do some migrations under the hood. There are few things that were not available on older blazor versions and they have implementations I haven't migrated yet.

@arivera12
Copy link
Author

I got my app up and running partially. Thanks for giving me a starting point to debug this I was going crazy trying to fix this. I had a few of broken api's everywhere and still migrating some of them. Thank you so much. Let me get this up and running with some rigorous test and I will get in touch with you. Thank you again!

@Daddoon
Copy link
Owner

Daddoon commented Aug 15, 2020

Good luck in your fixing ! Keep me updated !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants