1 Reply Latest reply on Aug 1, 2014 6:02 AM by Kutir Mobility

    MapView crash in RMS 4.1

    Dir Moto

      Hi!

       

      I'm working with RMS 4.1 and trying to create a MapView with Google Maps (the other maps work fine) but got a weird issue:

       

      Here is the code:

       

      map_params = {

               :provider => 'Google',

               :settings => {:map_type => "hybrid",:region => [lat, long, 0.2, 0.2],

                             :zoom_enabled => true,:scroll_enabled => true,:shows_user_location => false,

                             :api_key => 'MyKey'},

               :annotations => [{:latitude => lat, :longitude => long, :title => "Current location", :subtitle => ""},

                                {:street_address => "Cupertino, CA 95014", :title => "Cupertino", :subtitle => "zip: 95014",

                                 :url => "/app/GeoLocation/show?city=Cupertino"},

                                {:street_address => "Santa Clara, CA 95051", :title => "Santa Clara", :subtitle => "zip: 95051",

                                 :url => "/app/GeoLocation/show?city=Santa%20Clara", :pass_location => true}]

          }

      MapView.create map_params

       

      Here is the log:

       

      I/APP     ( 7814): I 07/15/2014 23:07:56:408 00001e86    RhodesApplication| New UiState: MainActivityPaused

      D/AndroidRuntime( 7814): Shutting down VM

      W/dalvikvm( 7814): threadid=1: thread exiting with uncaught exception (group=0x415b5ba8)

      E/AndroidRuntime( 7814): FATAL EXCEPTION: main

      E/AndroidRuntime( 7814): Process: com.rhomobile.dirinfo, PID: 7814

      E/AndroidRuntime( 7814): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rhomobile.dirinfo/com.rhomobile.rhodes.gmaps.GMapActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment

      E/AndroidRuntime( 7814):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)

      E/AndroidRuntime( 7814):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)

      E/AndroidRuntime( 7814):  at android.app.ActivityThread.access$800(ActivityThread.java:135)

      E/AndroidRuntime( 7814):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)

      E/AndroidRuntime( 7814):  at android.os.Handler.dispatchMessage(Handler.java:102)

      E/AndroidRuntime( 7814):  at android.os.Looper.loop(Looper.java:136)

      E/AndroidRuntime( 7814):  at android.app.ActivityThread.main(ActivityThread.java:5001)

      E/AndroidRuntime( 7814):  at java.lang.reflect.Method.invokeNative(Native Method)

      E/AndroidRuntime( 7814):  at java.lang.reflect.Method.invoke(Method.java:515)

      E/AndroidRuntime( 7814):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)

      E/AndroidRuntime( 7814):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)

      E/AndroidRuntime( 7814):  at dalvik.system.NativeStart.main(Native Method)

      E/AndroidRuntime( 7814): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment

      E/AndroidRuntime( 7814):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)

      E/AndroidRuntime( 7814):  at android.view.LayoutInflater.inflate(LayoutInflater.java:469)

      E/AndroidRuntime( 7814):  at android.view.LayoutInflater.inflate(LayoutInflater.java:397)

      E/AndroidRuntime( 7814):  at android.view.LayoutInflater.inflate(LayoutInflater.java:353)

      E/AndroidRuntime( 7814):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)

      E/AndroidRuntime( 7814):  at android.app.Activity.setContentView(Activity.java:1929)

      E/AndroidRuntime( 7814):  at com.rhomobile.rhodes.gmaps.GMapActivity.onCreate(GMapActivity.java:117)

      E/AndroidRuntime( 7814):  at android.app.Activity.performCreate(Activity.java:5231)

      E/AndroidRuntime( 7814):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)

      E/AndroidRuntime( 7814):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)

      E/AndroidRuntime( 7814):  ... 11 more

       

      Note: I used to use rhodes 3.X with no problem.