Errors in JS console with sample Android app

16 views
Skip to first unread message

Paul Blair

unread,
Sep 27, 2012, 6:33:14 PM9/27/12
to websh...@googlegroups.com
Hello,

I recently created and ran the Android application created with the default WebSharper Android application template. If I do nothing to modify the application, no pages show up inside the application in the emulator. If I add a few lines of console logging, I can see the application pages, but I get errors in the log. Details as follows:

I create the project and build the app in Visual Studio, then go into the android directory on the command line, where I set the ANDROID_SDK environment variable. While running the emulator, I then run 

android --clear-cache update project -p "`pwd`"
ant debug install

The installation to the emulator is successful. I then run 

adb shell
# logcat

to see the console output. When I launch the application, it starts but I get a completely black window inside the main application frame (the application name does show up at the top). If I click on the black part of the window, I get: 

W/WindowManager(   60): No window to dispatch pointer action 0

I then added the following two lines of code to the application in the Main function in Main.fs:

        | Some ctx ->

+          JavaScript.Log("Starting the mobile app with context:")

+          JavaScript.Log(ctx)

            ctx.Trace(Mobile.Priority.Info, "Website", "Starting the mobile app..")


When I run the application I now can see the pages and click on the links. However, logcat is showing a considerable number of the following error:

E/JavaScriptConsole(  277): undefined:1: ReferenceError: Can't find variable: AndroidWebSharperReceiver

Any help or suggestions welcome.

Adam Granicz

unread,
Sep 27, 2012, 6:38:25 PM9/27/12
to websh...@googlegroups.com
Hi Paul,

You probably get more responses if you post on FPish
(http://fpish.net) - and be sure to tag your question with
"WebSharper" - this sets off a trigger for many of us who monitor that
feed directly.

What Android version is your emulator running?
--
Adam Granicz, IntelliFactory
www.intellifactory.com

Paul Blair

unread,
Sep 27, 2012, 6:52:50 PM9/27/12
to websh...@googlegroups.com
Thanks, Adam. I will re-post over there. Right now I'm running the 2.2 emulator.  (Also, I just determined that adding the two lines of debug code was not in fact responsible for the change in behavior. More details to follow on fpish.)
Reply all
Reply to author
Forward
0 new messages