Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
14 replies Latest Post - ‏2012-12-16T08:53:28Z by AntonAleksandrov
Somasundaramrk
Somasundaramrk
49 Posts
ACCEPTED ANSWER

Pinned topic application not working on android 4.x versions

‏2012-12-04T05:14:42Z |
Hi,
I have developed an application with android phones and tablets environment. And i have android sdk's for 2.3.3, 4.0.3 and 4.1.2. Now the problem is my application is working fine in android 2.3 version mobiles. If i tried to access my application apk in android 4.0.1 version devices, it doesn't work.

The home page it shows. From that i cannot go to the next page. The application stopped with a blank white screen. How can i overcome this issue?
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: application not working on android 4.x versions

    ‏2012-12-04T05:20:33Z  in response to Somasundaramrk
    This is not enough information to go with.
    Please provide any errors you get in LogCat.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • Somasundaramrk
      Somasundaramrk
      49 Posts
      ACCEPTED ANSWER

      Re: application not working on android 4.x versions

      ‏2012-12-04T05:47:21Z  in response to IdanAdar
      sorry for inconvenience. Here is the error log.
    • Somasundaramrk
      Somasundaramrk
      49 Posts
      ACCEPTED ANSWER

      Re: application not working on android 4.x versions

      ‏2012-12-05T12:09:35Z  in response to IdanAdar
      yes, i am using IBM® Worklight Studio, Version: 5.0.0.3.

      And now i'm created a new project for the same 4.x version. This works fine in 4.x device. Really don't know what goes wrong?

      I tried to attach the new project. but not able to attach. The connection has timed out. The LogCat file i've attached
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: application not working on android 4.x versions

    ‏2012-12-04T05:57:17Z  in response to Somasundaramrk
    I see a lot of conflicting messages in that error log... could it that it holds errors from several trials you've made?

    Lets try this:
    1. Please uninstall the app from the Android 4.x device that exhibits the issue
    2. Clear the log in LogCat
    3. Install app

    Provide the log that appears once the app is install and launched on the device.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • Somasundaramrk
      Somasundaramrk
      49 Posts
      ACCEPTED ANSWER

      Re: application not working on android 4.x versions

      ‏2012-12-04T10:28:13Z  in response to IdanAdar
      Did as you said. This is the error_logs got after installing the application in 4.x version mobile.
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: application not working on android 4.x versions

    ‏2012-12-04T10:33:16Z  in response to Somasundaramrk
    Something very strange is happening there... I can't pinpoint it.
    Can you share your project?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: application not working on android 4.x versions

    ‏2012-12-05T11:17:09Z  in response to Somasundaramrk
    Using your application, I get it as well:
    
    12-05 11:11:30.780: D/TestHTC(16906): wlclient init started 12-05 11:11:30.780: D/TestHTC(16906): Read cookies: 
    
    null 12-05 11:11:30.780: D/TestHTC(16906): CookieMgr read cookies: 
    {
    } 12-05 11:11:30.810: D/TestHTC(16906): ondeviceready event dispatched 12-05 11:11:30.810: D/TestHTC(16906): wlclient init started 12-05 11:11:30.810: D/TestHTC(16906): Read cookies: 
    
    null 12-05 11:11:30.810: D/TestHTC(16906): CookieMgr read cookies: 
    {
    } 12-05 11:11:31.021: D/TestHTC(16906): Request [http:
    //9.148.225.245:8080/apps/services/api/TestHTC/android/init] 12-05 11:11:31.071: E/TestHTC(16906): Cannot invoke WL.Client.connect 
    
    while it is already executing. 12-05 11:11:31.091: D/CordovaLog(16906): Uncaught TypeError: Cannot read property 
    'errorMsg' of undefined 12-05 11:11:31.091: D/CordovaLog(16906): file:
    ///data/data/com.TestHTC/files/www/default/wlclient/js/wlclient.js: Line 157 : Uncaught TypeError: Cannot read property 'errorMsg' of undefined 12-05 11:11:31.091: E/Web Console(16906): Uncaught TypeError: Cannot read property 
    'errorMsg' of undefined at file:
    ///data/data/com.TestHTC/files/www/default/wlclient/js/wlclient.js:157 12-05 11:11:31.091: E/TestHTC(16906): Cannot invoke WL.Client.connect 
    
    while it is already executing. 12-05 11:11:31.101: D/CordovaLog(16906): Uncaught TypeError: Cannot read property 
    'errorMsg' of undefined 12-05 11:11:31.101: D/CordovaLog(16906): file:
    ///data/data/com.TestHTC/files/www/default/wlclient/js/wlclient.js: Line 157 : Uncaught TypeError: Cannot read property 'errorMsg' of undefined 12-05 11:11:31.101: E/Web Console(16906): Uncaught TypeError: Cannot read property 
    'errorMsg' of undefined at file:
    ///data/data/com.TestHTC/files/www/default/wlclient/js/wlclient.js:157 12-05 11:11:31.101: E/TestHTC(16906): Cannot invoke WL.Client.connect 
    
    while it is already executing. 12-05 11:11:31.101: D/CordovaLog(16906): Uncaught TypeError: Cannot read property 
    'errorMsg' of undefined 12-05 11:11:31.111: D/CordovaLog(16906): file:
    ///data/data/com.TestHTC/files/www/default/wlclient/js/wlclient.js: Line 157 : Uncaught TypeError: Cannot read property 'errorMsg' of undefined 12-05 11:11:31.111: E/Web Console(16906): Uncaught TypeError: Cannot read property 
    'errorMsg' of undefined at file:
    ///data/data/com.TestHTC/files/www/default/wlclient/js/wlclient.js:157 12-05 11:11:31.301: D/TestHTC(16906): Request [http:
    //9.148.225.245:8080/apps/services/api/TestHTC/android/init] 12-05 11:11:31.351: D/TestHTC(16906): response [http:
    //9.148.225.245:8080/apps/services/api/TestHTC/android/init] success: /*-secure- 12-05 11:11:31.351: D/TestHTC(16906): 
    {
    "userPrefs":
    {
    },
    "WL-Authentication-Success":
    {
    "wl_antiXSRFRealm":
    {
    "userId":
    "antiXSRF",
    "attributes":
    {
    "savedInstanceId":
    "s0otk2sci97f4jrlag0sdkdldn"
    },
    "isUserAuthenticated":1,
    "displayName":
    "antiXSRF"
    },
    "wl_deviceNoProvisioningRealm":
    {
    "userId":
    "device",
    "attributes":
    {
    "mobileClientData":
    "com.worklight.core.auth.impl.MobileClientData@2e226d6"
    },
    "isUserAuthenticated":1,
    "displayName":
    "device"
    }
    },
    "gadgetProps":
    {
    "directUpdate":
    {
    "availableSkins":[
    "default"],
    "checksum":2109588254,
    "updateSize":389372
    },
    "ENVIRONMENT":
    "android"
    },
    "userInfo":
    {
    "wl_authenticityRealm":
    {
    "userId":null,
    "attributes":
    {
    },
    "isUserAuthenticated":0,
    "displayName":
    
    null
    },
    "SampleAppRealm":
    {
    "userId":null,
    "attributes":
    {
    },
    "isUserAuthenticated":0,
    "displayName":
    
    null
    },
    "wl_remoteDisableRealm":
    {
    "userId":
    "NullLoginModule",
    "attributes":
    {
    },
    "isUserAuthenticated":1,
    "displayName":
    "NullLoginModule"
    },
    "wl_antiXSRFRealm":
    {
    "userId":
    "antiXSRF",
    "attributes":
    {
    "savedInstanceId":
    "s0otk2sci97f4jrlag0sdkdldn"
    },
    "isUserAuthenticated":1,
    "displayName":
    "antiXSRF"
    },
    "WorklightConsole":
    {
    "userId":null,
    "attributes":
    {
    },
    "isUserAuthenticated":0,
    "displayName":
    
    null
    },
    "wl_deviceAutoProvisioningRealm":
    {
    "userId":null,
    "attributes":
    {
    },
    "isUserAuthenticated":0,
    "displayName":
    
    null
    },
    "wl_deviceNoProvisioningRealm":
    {
    "userId":
    "device",
    "attributes":
    {
    "mobileClientData":
    "com.worklight.core.auth.impl.MobileClientData@2e226d6"
    },
    "isUserAuthenticated":1,
    "displayName":
    "device"
    },
    "myserver":
    {
    "userId":
    "0b208d6d-2c35-4cef-a13d-36f052738789",
    "attributes":
    {
    },
    "isUserAuthenticated":1,
    "displayName":
    "0b208d6d-2c35-4cef-a13d-36f052738789"
    },
    "wl_anonymousUserRealm":
    {
    "userId":
    "0b208d6d-2c35-4cef-a13d-36f052738789",
    "attributes":
    {
    },
    "isUserAuthenticated":1,
    "displayName":
    "0b208d6d-2c35-4cef-a13d-36f052738789"
    }
    }
    }*/  12-05 11:11:31.351: D/TestHTC(16906): wlclient connect success 12-05 11:11:31.361: D/TestHTC(16906): before: app init onSuccess 12-05 11:11:31.371: D/TestHTC(16906): after: app init onSuccess 12-05 11:11:31.371: D/TestHTC(16906): wlclient init success
    
    It is quite strange. I have yet to figure out where this originates from.

    Is this an original 5.0.0.3 application, or an upgraded one from previous IBM Worklight releases?
    Can you try a blank application?
    There is nothing in your code that should cause this...

    I am currently stumped.
    Lets start with answering the above questions and progress from there...

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: application not working on android 4.x versions

    ‏2012-12-09T05:51:53Z  in response to Somasundaramrk
    I suspect the issue is with the use you handle jQuery Mobile there.
    What are the steps you take when you add jQuery Mobile? I think something there messes up the startup sequence.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • Somasundaramrk
      Somasundaramrk
      49 Posts
      ACCEPTED ANSWER

      Re: application not working on android 4.x versions

      ‏2012-12-14T08:26:47Z  in response to IdanAdar
      yes, jquerymobile causing problem. i need to solve this issue. how can i overcome this. i tried last 5 days. But can't find solution. Guide me....
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: application not working on android 4.x versions

    ‏2012-12-14T10:19:24Z  in response to Somasundaramrk
    Have you tried with Worklight 5.0.5?
    Please also detail the steps you have taken when creating the application.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • Somasundaramrk
      Somasundaramrk
      49 Posts
      ACCEPTED ANSWER

      Re: application not working on android 4.x versions

      ‏2012-12-14T10:27:42Z  in response to IdanAdar
      No. with 5.0.5 i didn't tried yet.

      Steps which i followed.
      1.build a hybrid application in worklight 5.0.0.3.
      2. download jquerymobile package and its css(jquery.mobile-1.2.0.min.css), js(jquery.mobile-1.2.0.min.js,jquery-1.8.2.min.js), images into my application.
      3. write js functions for navigation with some custom styles.
      4. deploy application and works fine in 2.3 android. while trying to execute the same in 4.x version application hanged up with white blank screen.

      This is how i followed.
      • AntonAleksandrov
        AntonAleksandrov
        55 Posts
        ACCEPTED ANSWER

        Re: application not working on android 4.x versions

        ‏2012-12-16T08:53:28Z  in response to Somasundaramrk
        From what I see in the logs you're calling WL.Client.init() multiple times.
        This might be because you're binding it to a wrong event.

        Regarding original issue - Android 4.x is much more strict about HTML code.
        E.g. <script src="..."/> worked in 2.x, but will fail in 4.x because you need to use <script src="..."></script>
        I'd recommend going through HTML and XML and making sure that you have a valid content, e.g. all opening tags are closed, no special chars are used etc.