31 Replies Latest reply on Sep 6, 2013 7:39 AM by Vidyaa Natarajan

    Map is not displaying in Android

      Hi All,

       

      In my Rhodes application, Map is not getting displayed in Android. I have changed the map api key also but its not displaying. Before the map displayed in Android but this issue arises now.

       

      Please help me to fix this issue. Its urgent.

       

       

      Thanks,

      Vidyaa.N

        • Re: Map is not displaying in Android
          Kutir Mobility

          Are you sure its built with proper map api key with google add-on? (as per the instructions at http://docs.rhomobile.com/rhodes/device-caps#mapview)

           

          What error you see when you see on the device log ?

           

          Visnupriya

          Kutir Mobility

          • Map is not displaying in Android

            Hi All,

             

            I have tried Google map display with V2 API key in Rhodes-3.3.3, Rhodes-3.5.1.12 and Rhodes-4.0.0.beta versions. For Android, the Map is not getting displayed.

            Is Google map V2 Api key will be supported in Rhodes?

            Please help me to fix this issue. Its urgent.

             

            Thanks in advance,

            Vidyaa.N

            • Re: Map is not displaying in Android

              Hi Alexey,

               

              Thanks for your support and help. I have cloned the Master Rhodes version from github using the url https://github.com/rhomobile/rhodes given by you. I have made the path changes in build.yml and rhobuild.yml. I have used Google Map V2 api key. When I runned the application for android device its not building the apk file.

               

              I am getting the following error in the build log,

               

              C:/mapcheck/Cashnowasync/bin/target/android/release/extensions/gmaps

              rake aborted!

              No such file or directory - C:/android-sdk_r11-windows(1)/android-sdk-windows/extras/android/support/v4/android-support-v4.jar

              C:/rhodes/lib/extensions/gmaps/ext/platform/android/Rakefile:80:in `block in <top (required)>'

              Tasks: TOP => default => copylibs

              (See full trace by running task with --trace)

              rake aborted!

              Cannot build C:/rhodes/lib/extensions/gmaps/ext/platform/android

              C:/rhodes/platform/android/build/android.rake:828:in `block (4 levels) in <top (required)>'

              C:/rhodes/platform/android/build/android.rake:812:in `each'

              C:/rhodes/platform/android/build/android.rake:812:in `block (3 levels) in <top (required)>'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/bin/rake:23:in `load'

              C:/MotorolaRhoMobileSuite4.0.0.beta.39/ruby/bin/rake:23:in `<main>'

              Tasks: TOP => run:android:device => device:android:debug => package:android => build:android:all => build:android:rhobundle => build:android:extensions

              ********* NOTE: You use sdk parameter in build.yml !****************

              To use latest Rhodes gem, run migrate-rhodes-app in application folder or comment sdk in build.yml.

              ************************************************************************

              ********* WARNING *****************************************************************************************************

              The following extensions do not have JavaScript API:

              gmaps

              Use RMS 4.0 extensions to provide JavaScript API

              ***********************************************************************************************************************

               

              Please help me to fix this issue.

               

              Thanks in advance,

              Vidyaa.N

              • Re: Map is not displaying in Android

                Hi,

                 

                I have installed the latest Rhodes 4.0 beta 59 version and while building for android device, I am getting error and the "apk" file in not getting build. The builds stops with error.

                 

                I have attached the build log with this post. I have added the 'gmaps' extensions in build.yml and also gave the Google V2 api key.

                 

                Please help me to fix the map issue. Map is an important functionality in our application.

                 

                Its Urgent. Please help me to solve this issue.

                 

                Thanks,

                Vidyaa.N

                  • Re: Map is not displaying in Android
                    Kutir Mobility

                    Vidyaa, you need to run the Android SDK Manager and install the "Android Support Library" (it's in the "Extras" folder) to solve that error


                    Thanks,

                    Javier

                    Kutir Mobility

                      • Re: Map is not displaying in Android

                        Hi Visnupriya,

                         

                        Thanks for your immediate support. I have installed the "Android Support Library" in Android SDK Manager. I got the apk file for android device.

                         

                        But the map is not getting displayed yet. I have added the Api key in build.yml as mentioned in the Rhomobile docs and also gave the 'gmaps' extension in build.yml.

                         

                        In my application log, I am getting the error as "Geocoding failed for address" on selecting map.

                        • Re: Map is not displaying in Android
                          charles plasse

                          Hi Javier,

                           

                          Thanks for your precious support.

                           

                          Could you please help us to fix this issue ? "Geocoding failed for address"

                           

                          Best

                           

                          Charles

                            • Re: Re: Map is not displaying in Android
                              Kutir Mobility

                              The error "geocoding failed for address" can be solved if you specify the latitude and longitude of your map annotations instead of the street address. For example:

                               

                                  map_params = {
                                      :provider => 'Google',
                                      :settings => {
                                              :map_type => "hybrid",
                                              :region => [40.67, -73.94, 4, 4],
                                              :zoom_enabled => true,
                                              :scroll_enabled => true,
                                              :shows_user_location => false
                                          },
                                      :annotations => [
                                          {
                                              :latitude => 40.67,
                                              :longitude => -73.94,
                                              :title => "New York",
                                              :subtitle => "My way"
                                          }
                                      ]
                                  }
                              
                              
                              1 of 1 people found this helpful
                        • Re: Map is not displaying in Android

                          Hi,

                           

                          Thanks for your timely support. I have tried removing the annotations part in the map_params and also tried by specifying  static latitude and longitude values instead of street address, but for me the map is not getting displayed. When I click on map icon, only grey background is displayed. In log, there are no errors.

                           

                          Please help me to fix this issue.

                           

                          Thanks,

                          Vidyaa.N

                            • Re: Map is not displaying in Android
                              charles plasse

                              Hi Rhomobile Team and Kutir

                               

                              Does anyone could help to fix this issue ?

                               

                              Does google map is style longer supported by Rhodes ? Unfortunately we are not able to use google map in Rhodes 3 and Beta 4 - since google moved to API V2. We have followed steps mentionned into this post, but still no map display

                               

                              Please help  we really appreciate

                               

                              Best

                               

                              Charles

                                • Re: Re: Map is not displaying in Android
                                  Kutir Mobility

                                  Hi Charles,

                                   

                                  I cannot speak for the RhoMobile team, but I imagine they will keep supporting Google maps in 4.0. I can confirm that maps currently work with Beta 59 (the latest one published).

                                   

                                  Here is my build.yml file:

                                   

                                  sdkversion: 4.0.0
                                  name: maptest
                                  version: 1.0
                                  vendor: rhomobile
                                  build: debug
                                  bbver: 6.0
                                  applog: rholog.txt
                                  iphone:
                                    configuration: Release
                                    sdk: iphonesimulator6.1
                                    provisionprofile:
                                    codesignidentity:
                                    entitlements:
                                    BundleIdentifier: com.rhomobile.maptest
                                    BundleURLScheme: maptest
                                  wp:
                                    productid: '029f7480-f6d0-0130-85f1-38f6b118e4ff'
                                  symbian:
                                    uid: '0xe6ef0276'
                                  android:
                                    version: 2.3.3
                                    mapping: yes
                                    apikey: "api key goes here"
                                  capabilities:
                                    - network_state
                                  

                                   

                                   

                                  And this is the relevant code:

                                   

                                      map_params = {
                                          :provider => 'Google',
                                          :settings => {
                                                  :map_type => "hybrid",
                                                  :region => [40.67, -73.94, 4, 4],
                                                  :zoom_enabled => true,
                                                  :scroll_enabled => true,
                                                  :shows_user_location => false,
                                                  :api_key => 'Google Maps API Key'
                                              },
                                          :annotations => [
                                              {
                                                  :latitude => 40.67, 
                                                  :longitude => -73.94,
                                                  :title => "New York",
                                                  :subtitle => "My way"
                                              }
                                          ]
                                      }
                                      MapView.create map_params  
                                  

                                   

                                  What device are you using? Can you post a screenshot of the result you are getting?

                                   

                                  Thanks,

                                  Javier

                                  Kutir Mobility

                                    • Re: Map is not displaying in Android

                                      Hi Kutir,

                                       

                                      Thanks for your timely support. I have implemented the map  code with reference to your code and I got the map display in Android 2.3.3 version.

                                       

                                      But when I checked the same code for Android 4.2.2 version, on selecting map the "Application crashes and exits". When I checked the application log, I am not getting the latitude and longitude values.

                                       

                                      I have used "GeoLocation.latitude" and "GeoLocation.longitude" to take the latitude and longitude values, which works in Android 2.3.3 version but didn't work in Android 4.2.2 and higher versions.

                                       

                                      I have checked by hardcoding the latitude and longitude values in the annotations part, but the map is not getting displayed in Android 4.2.2 version.

                                       

                                      Is that the Android 4.2.2 and higher versions will support Google map v2 api key or v3 api key?

                                       

                                      Please help me to solve this issue.

                                       

                                      Thanks in advance,

                                      Vidyaa.N

                                • Re: Map is not displaying in Android

                                  Hi All,

                                   

                                  Thanks for your support. The Map got displayed in Android 4.2.2 or higher version mobiles. The Location access in Settings should be "on" for higher version mobiles for map display.

                                   

                                   

                                  Thanks for your timely support.

                                   

                                  Thanks,

                                  Vidyaa.N