opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

Random jquery mobile / angular internal errors on android 4.2 #225

Open mato2000 opened 10 years ago

mato2000 commented 10 years ago

Hi, I know this issue is not directly related with the adapter, but as we use these libs, you might have seen something like. The problem appears when loading the app, usually the first time runs ok, but next time it loads (full refresh of the same url) throws errors like "# has no method 'addClass'" in the jqm file, or "# has no method 'data'" in angular file.

Have any of you seen something like this? This is very weird since in desktop browsers doesn't happen at all, neither iPhone nor lower versions of android.

Any help would be appreciated.

Thanks in advance. Matias.

normalerweise commented 10 years ago

+1 We also experience this issue. For us it is reproducible from Android 4.1 to 4.3 using the default angular adapter.

What I understand from debugging is that it the root cause is calling pages.page() in function markPagesAndWidgetsAndApplyNonWidgetMarkup(), which is invoked by the precompile layer of the adapter.

Adding log statements I can see, that it randomly fails at a certain page (we have around 20). So sometimes its page 4,10,14...

I assume some internal weakness of the default Android browser, as at this point lots of jqm widgets will be created, which causes lots of "load".

So I questioned, whether creating all pages at the same time could be avoided. I tried to modify the adapter, unfortunately without success.

Some help from the authors would be appreciated. Did you find a solution/workaround Matias?

Thanks Bests Norman

mato2000 commented 10 years ago

Hi, I tried adding try/catch when the first exception raise, but then it came up on another exception in another line. I couldn't find any solution nor workaround. I had to drop Android support until I port it to a new app without jquery/jquery-mobile/jquery-mobile adapter with pure angular. This issue is blocking and since it only happens in some devices it's very hard to reproduce. Maybe if you could find a very small code that fails, the authors can take a look on that.

Good luck! Matias.

normalerweise commented 10 years ago

Hi Matias, thanks for your comment. I was able to reproduce it with a minimal example of two jqm pages on a Galaxy S3 mini. If one of the authors would have a look at it I can provide the code and a video how to reproduce it.

Bests Norman