Coder Social home page Coder Social logo

adevintaspain / leku Goto Github PK

View Code? Open in Web Editor NEW
754.0 33.0 175.0 14.19 MB

:earth_africa: Map location picker component for Android. Based on Google Maps. An alternative to Google Place Picker.

Home Page: https://adevintaspain.github.io/Leku/

License: Apache License 2.0

Shell 0.56% Kotlin 99.44%
location-picker android maps google-maps google location multi-language rtl event-tracking library

leku's Introduction

* The location Picker for Android *

Component library for Android that uses Google Maps and returns a latitude, longitude and an address based on the location picked with the Activity provided.


Features | Download | Permissions | Usage | Localization | Customization | Tracking | Extra | Who Made This | Apps using Leku | Contribute | Bugs and Feedback | License


Features

  • Search by voice
  • Search by text
  • Geo Location by GPS, network
  • Google Places (optional)
  • Google Time Zone API (optional)
  • Pick locations using "touch" gestures on the map
  • Customization (Theme and layout)
  • Events Tracking
  • Multi-language support (English, Spanish and Vietnamese supported by default)
  • RTL (Right-To-Left) layout support


Prerequisites

minSdkVersion >= 21
Google Play Services = 18.1.0
AndroidX

Download

Include the mavenCentral repository in your top build.gradle:

Enabled by default on AndroidStudio projects

allprojects {
    mavenCentral()
}

Include the dependency in your app build.gradle:

dependencies {
    implementation 'com.adevinta.android:leku:11.1.4'
}

Alternatively, if you are using a different version of Google Play Services and AndroidX use this instead:

implementation ('com.adevinta.android:leku:11.1.4') {
    exclude group: 'com.google.android.gms'
    exclude group: 'androidx.appcompat'
}
Troubleshoot

If you find this issue:

Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. com.android.build.api.transform.TransformException: Error while generating the main dex list: Error while merging dex archives: Program type already present: com.google.common.util.concurrent.ListenableFuture Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

The workaround for this is:

// Add this to your app build.gradle file
configurations.all {
	// this is a workaround for the issue:
	// https://stackoverflow.com/questions/52521302/how-to-solve-program-type-already-present-com-google-common-util-concurrent-lis
	exclude group: 'com.google.guava', module: 'listenablefuture'
}

Permissions

You must add the following permissions in order to use the Google Maps Android API:

  • android.permission.INTERNET Used by the API to download map tiles from Google Maps servers.

  • android.permission.ACCESS_NETWORK_STATE Allows the API to check the connection status in order to determine whether data can be downloaded.

The following permissions are not required to use Google Maps Android API v2, but are recommended.

  • android.permission.ACCESS_COARSE_LOCATION Allows the API to use WiFi or mobile cell data (or both) to determine the device's location. The API returns the location with an accuracy approximately equivalent to a city block.

  • android.permission.ACCESS_FINE_LOCATION Allows the API to determine as precise a location as possible from the available location providers, including the Global Positioning System (GPS) as well as WiFi and mobile cell data.

  • android.permission.WRITE_EXTERNAL_STORAGE Allows the API to cache map tile data in the device's external storage area.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false"  />

You must also explicitly declare that your app uses the android.hardware.location.network or android.hardware.location.gps hardware features if your app targets Android 5.0 (API level 21) or higher and uses the ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission in order to receive location updates from the network or a GPS, respectively.

Note: It supports runtime permissions for Android 6 (Marshmallow). You don't need to do anything, it will ask for permissions if needed.

Usage

To use the LocationPickerActivity first you need to add these lines to your AndroidManifest file:

<activity
    android:name="com.adevinta.leku.LocationPickerActivity"
    android:label="@string/leku_title_activity_location_picker"
    android:theme="@style/Theme.MaterialComponents.Light.NoActionBar"
    android:windowSoftInputMode="adjustPan"
    android:parentActivityName=".MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.SEARCH" />
    </intent-filter>
    <meta-data android:name="android.app.searchable"
        android:resource="@xml/leku_searchable" />
    <meta-data
        android:name="android.support.PARENT_ACTIVITY"
        android:value=".MainActivity" />
</activity>

Then you have setup the call to start this activity wherever you like, always as a ActivityResultLauncher. You can set a default location, search zone and other customizable parameters to load when you start the activity. You only need to use the Builder setters like:

val lekuActivityResultLauncher =
        registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result: ActivityResult ->
            if (result.resultCode == Activity.RESULT_OK) {
                Log.d("RESULT****", "OK")
                val latitude = data?.getDoubleExtra(LATITUDE, 0.0)
                Log.d("LATITUDE****", latitude.toString())
                val longitude = data?.getDoubleExtra(LONGITUDE, 0.0)
                Log.d("LONGITUDE****", longitude.toString())
                val address = data?.getStringExtra(LOCATION_ADDRESS)
                Log.d("ADDRESS****", address.toString())
                val postalcode = data?.getStringExtra(ZIPCODE)
                Log.d("POSTALCODE****", postalcode.toString())
                val bundle = data?.getBundleExtra(TRANSITION_BUNDLE)
                Log.d("BUNDLE TEXT****", bundle?.getString("test").toString())
                val fullAddress = data?.getParcelableExtra<Address>(ADDRESS)
                if (fullAddress != null) {
                    Log.d("FULL ADDRESS****", fullAddress.toString())
                }
                val timeZoneId = data?.getStringExtra(TIME_ZONE_ID)
                if (timeZoneId != null) {
                    Log.d("TIME ZONE ID****", timeZoneId)
                }
                val timeZoneDisplayName = data?.getStringExtra(TIME_ZONE_DISPLAY_NAME)
                if (timeZoneDisplayName != null) {
                    Log.d("TIME ZONE NAME****", timeZoneDisplayName)
                }
            } else {
                Log.d("RESULT****", "CANCELLED")
            }
        }

val activity = context as MainActivity
val locationPickerIntent = LocationPickerActivity.Builder(applicationContext)
    .withLocation(41.4036299, 2.1743558)
    .withGeolocApiKey("<PUT API KEY HERE>")
    .withGooglePlacesApiKey("<PUT API KEY HERE>")
    .withSearchZone("es_ES")
    .withSearchZone(SearchZoneRect(LatLng(26.525467, -18.910366), LatLng(43.906271, 5.394197)))
    .withDefaultLocaleSearchZone()
    .shouldReturnOkOnBackPressed()
    .withStreetHidden()
    .withCityHidden()
    .withZipCodeHidden()
    .withSatelliteViewHidden()
    .withGooglePlacesEnabled()
    .withGoogleTimeZoneEnabled()
    .withVoiceSearchHidden()
    .withUnnamedRoadHidden()
    .withSearchBarHidden()
    .build()

activity.lekuActivityResultLauncher.launch(locationPickerIntent)

That's all folks!

Google Places

Leku now supports Google Places queries using the search box. If you want to enable it these are the steps you need to follow:

  1. Enable Google Places API for Android on your google developer console.

  2. Add the key to the location picker builder

val locationPickerIntent = LocationPickerActivity.Builder(context)
      .withGooglePlacesApiKey("<PUT API KEY HERE>")

If you set up the same credential for both APIs (Geo - Places) you don't need this step

And you are good to go. :)

Localization

If you would like to add more language translations the only thing you have to do is:

  1. Crate a new strings resource folder and file for your language like "/values-ru".
  2. Add all text translations for those strings:
<string name="leku_title_activity_location_picker">Location Picker</string>
<string name="leku_load_location_error">Something went wrong. Please try again.</string>
<string name="leku_no_search_results">There are no results for your search</string>
<string name="leku_unknown_location">unknown location</string>
<string name="leku_voice_search_promp">Search by voice…</string>
<string name="leku_voice_search_extra_language">en-EN</string>
<string name="leku_toolbar_action_voice_title">Voice</string>
<string name="leku_search_hint">Search</string>

Note that you have the voice_search_extra_language that is used for the language of the voice recognition. Replace it with the allowed voice recognition locale for your language.

We encourage you to add these languages to this component, please fork this project and submit new languages with a PR. Thanks!

Transition Bundle

If you need to send and receive a param through the LocationPickerActivity you can do it. You only need to add an "Extra" param to the intent like:

locationPickerIntent.putExtra("test", "this is a test")

And parse it on onActivityResult callback:

val bundle = data.getBundleExtra(LocationPickerActivity.TRANSITION_BUNDLE)
val test = bundle.getString("test")

Customization

Theming

This library uses material components, so should use Theme.MaterialComponents or descendant in manifest.

<item name="colorPrimary">#E91E63</item>
<item name="colorPrimaryDark">#C51162</item>
<item name="colorAccent">#FBC02D</item>
<item name="colorControlActivated">#E91E63</item>

colorControlActivated is used to colorize Street title, if not set, it uses colorAccent by default

New activity images and button color customization

If you need to change theme colors for new activity map, you can do it with the below keys:

<color name="leku_ic_close">#000000</color>
<color name="leku_ic_gps">#000000</color>
<color name="leku_ic_satellite">#000000</color>
<color name="leku_ic_maps">#000000</color>
<color name="leku_location_accept_button_bg">#000000</color>

To customize map, use:

.withMapStyle(R.raw.map_style_retro)

Theme creator here: https://mapstyle.withgoogle.com/

Layout

It's possible to hide or show some of the information shown after selecting a location. Using tha bundle parameter LocationPickerActivity.LAYOUTS_TO_HIDE you can change the visibility of the street, city or the zipcode.

intent.putExtra(LocationPickerActivity.LAYOUTS_TO_HIDE, "street|city|zipcode")
Legacy Layout

If you want to use the old Leku layout design you need to add this line to the builder:

val locationPickerIntent = LocationPickerActivity.Builder(context)
    .withLegacyLayout()
Search Zone

By default the search will be restricted to a zone determined by your default locale. If you want to force the search zone you can do it by adding this line with the locale preferred:

intent.putExtra(LocationPickerActivity.SEARCH_ZONE, "es_ES")
Search Zone Rect

If you want to force the search zone you can do it by adding this line with the lower left and upper right rect locations:

intent.putExtra(LocationPickerActivity.SEARCH_ZONE_RECT, SearchZoneRect(LatLng(26.525467, -18.910366), LatLng(43.906271, 5.394197)))
Default Search Zone Locale

If you want to be able to search with the default device locale, you can do it by adding this line:

intent.putExtra(LocationPickerActivity.SEARCH_ZONE_DEFAULT_LOCALE, true)

Note: If you don't specify any search zone it will not search using any default search zone. It will search on all around the world.

Force return location on back pressed

If you want to force that when the user clicks on back button it returns the location you can use this parameter (note: is only enabled if you don't provide a location):

intent.putExtra(LocationPickerActivity.BACK_PRESSED_RETURN_OK, true)
Enable/Disable the Satellite view

If you want to disable the satellite view button you can use this parameter (note: the satellite view is enabled by default):

intent.putExtra(LocationPickerActivity.ENABLE_SATELLITE_VIEW, false)
Enable/Disable requesting location permissions

If you want to disable asking for location permissions (and prevent any location requests)

intent.putExtra(LocationPickerActivity.ENABLE_LOCATION_PERMISSION_REQUEST, false)
Enable/Disable voice search

Now you can hide the voice search option on the search view

intent.putExtra(LocationPickerActivity.ENABLE_VOICE_SEARCH, false)
Hide/Show "Unnamed Road" on Address view

Now you can hide or show the text returned by the google service with "Unnamed Road" when no road name available

intent.putExtra(LocationPickerActivity.UNNAMED_ROAD_VISIBILITY, false)
Hide/Show the Search Bar

Now you can hide or show the search bar that helps you to search for locations

intent.putExtra(LocationPickerActivity.SEARCH_BAR_HIDDEN, false)
Custom Autocomplete Results Adapter

You can define your custom autocomplete results adapter.

class SearchViewHolder(
  val textView: TextView,
) : LekuViewHolder(textView)

class CustomLocationsAdapter : SuggestSearchAdapter<SearchViewHolder>() {
  override fun onCreateViewHolder(
    parent: ViewGroup,
    viewType: Int
  ): SearchViewHolder {
    val view = LayoutInflater
      .from(parent.context)
      .inflate(
        R.layout.leku_search_list_item,
        parent,
        false
      ) as TextView

    return SearchViewHolder(view)
  }

  override fun onBindViewHolder(holder: SearchViewHolder, position: Int) {
    super.onBindViewHolder(holder, position)
    holder.textView.text = items[position].description
  }
}
val locationPickerIntent = LocationPickerActivity.Builder(context)
    ...
    .withAdapter(CustomLocationsAdapter())
    .build(requireContext())
Custom Data Source

You can define your custom data source. By default there are 2 DataSources which ask for information based on the user input, but you can add a third one.

Leku will priories your data source looking for information. If no result is provided, Leku data sources will complete the information.

This implementation shows how to only implement the Place API resolution. You can omit your repository from performing any query by returning null or emptyList().

class LocationDataSource(val locationRepository: LocationRepository) : GeocoderDataSourceInterface {
    
  override suspend fun autoCompleteFromLocationName(query: String): List<PlaceSuggestion> {
    return locationRepository.autoComplete(query)
  }

  override suspend fun getAddressFromPlaceId(placeId: String): Address? = try {
    locationRepository.geocode(placeId)
  } catch (e: Exception) {
    null
  }

  override suspend fun getFromLocation(latitude: Double, longitude: Double): List<Address> { 
    return emptyList()
  }

  override suspend fun getFromLocationName(query: String): List<Address> {
    return emptyList()
  }

  override suspend fun getFromLocationName(
    query: String,
    lowerLeft: LatLng,
    upperRight: LatLng
  ): List<Address> {
    return emptyList() 
  }
}
val locationPickerIntent = LocationPickerActivity.Builder(context)
    ...
    .withDataSource(LocationDataSource(myLocationRepository))
    .build(requireContext())

Tracking

Optionally, you can set a tracking events listener. Implement LocationPickerTracker interface, and set it in your Application class as follows:

LocationPicker.tracker = <<YourOwnTracker implementing LocationPickerTracker>>()

Available tracking events are:

TAG Message
GOOGLE_API_CONNECTION_FAILED Connection Failed
START_VOICE_RECOGNITION_ACTIVITY_FAILED Start Voice Recognition Activity Failed
ON_LOAD_LOCATION_PICKER Location Picker
ON_SEARCH_LOCATIONS Click on search for locations
ON_LOCALIZED_ME Click on localize me
ON_LOCALIZED_BY_POI Long click on map
SIMPLE_ON_LOCALIZE_BY_POI Click on map
SIMPLE_ON_LOCALIZE_BY_LEKU_POI Click on POI
RESULT_OK Return location
CANCEL Return without location

Geocoding API Fallback

In few cases, the geocoding service from Android fails due to an issue with the NetworkLocator. The only way of fixing this is rebooting the device.

In order to cover these cases, you can instruct Leku to use the Geocoding API. To enable it, just use the method '''withGeolocApiKey''' when invoking the LocationPicker.

You should provide your Server Key as parameter. Keep in mind that the free tier only allows 2,500 requests per day. You can track how many times is it used in the Developer Console from Google.

Extra

If you would like to use the Geocoder presenter (MVP) used for this use case you are free to use it! GeocoderPresenter has three methods:

  • getLastKnownLocation: Which obviously returns the last known user location as a Location object.

  • getFromLocationName(String query): Returns a List<Address> for the text introduced.

  • getFromLocationName(String query, LatLng lowerLeft, LatLng upperRight): Returns a List<Address> for the text and the Rectangle introduced.

  • getDebouncedFromLocationName(String query, int debounceTime): Returns a List<Address> for the text introduced. Useful if you want to implement your own search view with auto-complete.

  • getDebouncedFromLocationName(String query, LatLng lowerLeft, LatLng upperRight, int debounceTime): Returns a List<Address> for the text and the Rectangle introduced. Useful if you want to implement your own search view with auto-complete.

  • getInfoFromLocation(double latitude, double longitude): Returns a List<Address> based on a latitude and a longitude.

To use it first you need to implement the GeocoderViewInterface interface in your class like:

class LocationPickerActivity : AppCompatActivity(), GeocoderViewInterface {

Then you need to setup the presenter:

private val geocoderPresenter: GeocoderPresenter

override fun onCreate(savedInstanceState: Bundle?) {
  super.onCreate(savedInstanceState)
  ***
  val placesDataSource = GooglePlacesDataSource(Places.getGeoDataClient(this, null))
  val geocoder = Geocoder(this, Locale.getDefault())
  apiInteractor = GoogleGeocoderDataSource(NetworkClient(), AddressBuilder())
  val geocoderRepository = GeocoderRepository(AndroidGeocoderDataSource(geocoder), apiInteractor!!)
  val timeZoneDataSource = GoogleTimeZoneDataSource(
          GeoApiContext.Builder().apiKey(GoogleTimeZoneDataSource.getApiKey(this)).build())
  geocoderPresenter = GeocoderPresenter(
          ReactiveLocationProvider(applicationContext), geocoderRepository, placesDataSource, timeZoneDataSource)
  geocoderPresenter?.setUI(this)
  ***
}

And besides filling the interface methods you have to add some things to your activity/fragment lifecycle to ensure that there are no leaks.

override fun onStart() {
    super.onStart()
    geocoderPresenter?.setUI(this)
}

override fun onStop() {
    geocoderPresenter?.stop()
    super.onStop()
}
Tests

Note: If you need to execute the Espresso test you will need to add the Google Maps Key into the Tests AndroidManifest.xml

Now you have all you need. :)

Important

Searching using the "SearchView" (geocoder) will be restricted to a zone if you are with a Locale from: US, UK, France, Italy and Spain. If not, the search will return results from all the world.

Sample usage

We provide a sample project which provides runnable code samples that demonstrate their use in Android applications. Note that you need to include your Google Play services key in the sample to be able to test it.

Who made this

Ferran Pons
Ferran Pons

Contributors

Diego Millán Gerard Pedreny Marc Serra Sergio Castillo Bernat Borras Cristian García
Diego Millán Gerard Pedreny Marc Serra Sergio Castillo Bernat Borras Cristian García

Apps using Leku

The following is a list of some of the public apps using Leku and are published on the Google Play Store.

Want to add your app? Found an app that no longer works or no longer uses Leku? Please submit a pull request on GitHub to update this page!

vibbo Worksi Domoticz

Contribute

  1. Create an issue to discuss about your idea
  2. [Fork it] (https://github.com/AdevintaSpain/leku/fork)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request
  7. Profit! ✅

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.

License

Copyright 2016-2023 Adevinta Spain S.L.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

leku's People

Contributors

ahaverty avatar albertvilacalvo avatar alorma avatar artjimlop avatar braisgabin avatar chihung93 avatar cristiangm avatar davidftrujillo avatar denysnovoa avatar devbalo93 avatar efraespada avatar etorralbo avatar ferranpons avatar galadril avatar gvsharma avatar huikaihoo avatar jffiorillo avatar marcserrascmspain avatar muhammad-naderi avatar nucliweb avatar null45 avatar regulosarmiento avatar rocboronat avatar romadespub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leku's Issues

Option to disable voice search (enhancement)

Description

Option into the Builder to disable voice search

**and another option to disable the Coordinates box, and only to show the result box when the address is selected (valid address)

Info Required

  • Which version of the library do you actually use?

    compile 'com.schibstedspain.android:leku:3.4.3'

  • Do you have the localization permission granted?

Yes!

  • Are you sending parameters to the activity through the bundle?

With builder and sending the intent to the activity.

  • Could you describe what are the actions do you make to raise that error?

Is not an error, more like an enhancement.

  • Android monitor shows any log related to the library when the error is shown?

Is not an error, more like an enhancement.

  • Any other thing that could help me to reproduce the error?

Is not an error, more like an enhancement.

LocationPickerActivity.SEARCH_ZONE not working!!!

I want to show the LocationPickerActivity to only display place searches and location results within UAE. I tried to set SEARCH ZONE as mentioned below.

Intent placePickerIntent = new Intent(this, LocationPickerActivity.class);
placePickerIntent.putExtra(LocationPickerActivity.SEARCH_ZONE, "ar_AE");
placePickerIntent.putExtra(LocationPickerActivity.BACK_PRESSED_RETURN_OK, true);
startActivityForResult(placePickerIntent, PLACE_PICKER_REQUEST);

But is not working. Instead of showing the results within UAE, t is showing the rresults from all around. Please help.

facing the same issue of #48

#48

Am facing with same issue with Activity!
java.lang.NoSuchMethodError: No static method create(Lrx/Observable$OnSubscribe;)Lrx/Observable; in class Lrx/Observable; or its super classes (declaration of 'rx.Observable' appears in /data/data/in.pnplabs.babyonboard/files/instant-run/dex/slice-slice_6-classes.dex)
Let me know the solution!

onDestroy is calling by startActivityForResult

Description

onDestroy is calling by startActivityForResult, how to avoid calling OnDestroy

Info Required

  • Which version of the library do you actually use?
    3.4.5

  • Do you have the localization permission granted?
    Yes

  • Are you sending parameters to the activity through the bundle?
    No

  • Could you describe what are the actions do you make to raise that error?

  • Android monitor shows any log related to the library when the error is shown?

Any other thing that could help me to reproduce the error?

Screenshots

OnActivity result always returns RESULT_OK.

Hi, thanks for this library, I'm having a problem:

When I press the back arrow or the phisical back button, onActivity result is detecting RESULT_OK, why?

Thanks in advance

Search Api

Hi sir,
firstly, this is a great lib that i need. Because i need for user to pick freely the position on map, and not like google placepicker that only limits to a place (can't move pin position when search).

But the problem is, the search function seems not showing the good results like place picker does.
It has so limited results. Is there any way to improve so the search is like on place picker?

Thanks

java.lang.NoSuchMethodError: No static method com_schibstedspain_leku_LocationPicker...

Description

using jack compiler, when trying to start LocationPickerActivity getting
java.lang.NoSuchMethodError: No static method com_schibstedspain_leku_LocationPicker$$Lambda$1_lambda$static$0(Lcom/schibstedspain/leku/tracker/TrackEvents;)V in class Lcom/schibstedspain/leku/LocationPicker; or its super classes (declaration of 'com.schibstedspain.leku.LocationPicker' appears

  • Which version of the library do you actually use?
    v3.0.0

  • Do you have the localization permission granted?
    yes

  • Are you sending parameters to the activity through the bundle?
    no

  • Could you describe what are the actions do you make to raise that error?
    starting LocationPickerActivity

  • Android monitor shows any log related to the library when the error is shown?

 java.lang.NoSuchMethodError: No static method com_schibstedspain_leku_LocationPicker$$Lambda$1_lambda$static$0(Lcom/schibstedspain/leku/tracker/TrackEvents;)V in class Lcom/schibstedspain/leku/LocationPicker; or its super classes (declaration of 'com.schibstedspain.leku.LocationPicker' appears in /data/app/in.co.c24customer-1/base.apk)
                                                                       at com.schibstedspain.leku.LocationPicker$$Lambda$1.onEventTracked(Unknown Source)
                                                                       at com.schibstedspain.leku.LocationPickerActivity.setTracking(LocationPickerActivity.java:142)
                                                                       at com.schibstedspain.leku.LocationPickerActivity.onCreate(LocationPickerActivity.java:132)
                                                                       at android.app.Activity.performCreate(Activity.java:6679)
                                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                       at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                       at android.os.Looper.loop(Looper.java:154)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Can't customize colors...

can_change_color

i've seen the resource "ic_gps_lime.png", and i can't change color.

style.xml

<style name="Base.Theme.F4M" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">#3F51B5</item>
    <item name="colorPrimaryDark">#303F9F</item>
    <item name="colorAccent">#498dfb</item>
</style>

manifest.xml







Filter address

Applies once #56 is merged:

With new autocomplete, it should be great if we can have a way of filter the provided addresses

Please include timezone...

When I select Place it returns Latitude, Longitude, Address, etc
But it is necessary to get timezone by selecting any place from google map..
If you include timezoneId it will be more beneficial for me and other peoples who uses your library...
Please reply...
One more thing,.. how can I get CountryName from FullAddress?
.....................................
Finally I get timezone via latitude and longitude by using google API

Same problem as #61, but with cloned repo

Hi! I'm trying to use this library and have the same problem that the issue #61 (can't select a position, can't search)

I cloned this repo, thinking that maybe I'm doing something wrong in my app, but I have the same problem in the repo app, where I just modify the GoogleMap API_KEY.

I have a Samsung Grand Prime... What can be the problem?

Thanks!

Bug in Background

I upgraded your library from 3.2.0 to 3.4.4

problem is that when I run the app then the app crashes after some times later in background thread.

But When I uninstall the app and install again then it's ok.

I updated my apps to google play store..

Those persons who upgraded my apps from playstore all of them are fallen the same problem... Not for fresh Installers..

Huge Bug Report: Please fix it...

java.lang.AbstractMethodError:
at com.google.android.gms.internal.zzaac.zzas (Unknown Source)
at com.google.android.gms.internal.zzaac.onTrimMemory (Unknown Source)
at android.app.Application.onTrimMemory (Application.java:152)
at android.app.ActivityThread.handleTrimMemory (ActivityThread.java:5702)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1977)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:145)
at android.app.ActivityThread.main (ActivityThread.java:6934)
at java.lang.reflect.Method.invoke (Native Method)
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1199)

Location Search via Text Input

Description

Hey, amazing lib!
If you search for a location via the Text Input the marker is set correctly to the new location but the "Check button" disappears. It reappears again if the user clicks onto the map.
It would be great if you could check this out. Thank You!

Info Required

  • Which version of the library do you actually use?
    3.4.0
  • Do you have the localization permission granted?
    Yes
  • Are you sending parameters to the activity through the bundle?
    No
  • Could you describe what are the actions do you make to raise that error?
    see Description
  • Android monitor shows any log related to the library when the error is shown?
    Nothing
  • Any other thing that could help me to reproduce the error?
    "Bug" occurs on Android 7.0

Screenshots

screenshot_20170703-125835

Permission really mandatory?

As described on the readme":

android.permission.WRITE_EXTERNAL_STORAGE Allows the API to cache map tile data in the device's external storage area.

Is this really needed??

My app only uses the maps for the location picker.. which they setup maybe once.
So can't this location picker also run without caching?

Unable to start activity

hello thanks for your work it's very cool :)

I have a problems when i click on my button i have an error :

java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.wildcodeschool.hobbyhobbo/com.schibstedspain.leku.LocationPickerActivity}: android.view.InflateException: Binary XML file line #53: Error inflating class android.support.design.widget.FloatingActionButton

my code :

Manifest :

`

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false"  />


<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version"
        />

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="@string/google_maps_key"
        />

    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>



    <activity
        android:name="com.schibstedspain.leku.LocationPickerActivity"
        android:label="@string/title_activity_location_picker"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"
        android:windowSoftInputMode="adjustPan"
        android:parentActivityName=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
            android:resource="@xml/searchable" />
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".MainActivity" />
    </activity>
</application>

`

MainActivity :

`
import android.content.Intent;
import android.location.Address;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.schibstedspain.leku.LocationPicker;
import com.schibstedspain.leku.LocationPickerActivity;
import com.schibstedspain.leku.tracker.LocationPickerTracker;
import com.schibstedspain.leku.tracker.TrackEvents;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Button goMarker = (Button) findViewById(R.id.button2);

    goMarker.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MainActivity.this, LocationPickerActivity.class);
            startActivityForResult(intent, 1);
        }
    });
    initializeLocationPickerTracker();
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (requestCode == 1) {
        if(resultCode == RESULT_OK){
            double latitude = data.getDoubleExtra(LocationPickerActivity.LATITUDE, 0);
            Log.d("LATITUDE****", String.valueOf(latitude));
            double longitude = data.getDoubleExtra(LocationPickerActivity.LONGITUDE, 0);
            Log.d("LONGITUDE****", String.valueOf(longitude));
            String address = data.getStringExtra(LocationPickerActivity.LOCATION_ADDRESS);
            Log.d("ADDRESS****", String.valueOf(address));
            String postalcode = data.getStringExtra(LocationPickerActivity.ZIPCODE);
            Log.d("POSTALCODE****", String.valueOf(postalcode));
            Bundle bundle = data.getBundleExtra(LocationPickerActivity.TRANSITION_BUNDLE);
            Log.d("BUNDLE TEXT****", bundle.getString("test"));
            Address fullAddress = data.getParcelableExtra(LocationPickerActivity.ADDRESS);
            Log.d("FULL ADDRESS****", fullAddress.toString());
        }
        if (resultCode == RESULT_CANCELED) {
            //Write your code if there's no result
        }
    }
}

private void initializeLocationPickerTracker() {
    LocationPicker.setTracker(new LocationPickerTracker() {
        @Override
        public void onEventTracked(TrackEvents event) {
            Toast.makeText(MainActivity.this, "Event: " + event.getEventName(), Toast.LENGTH_SHORT)
                    .show();
        }
    });
}

}
`

I have add dependencies, Google map api key

Can you tell me what is wrong please ?
Thank's you so mutch and sorry for my english ahah

The `Done` button not showing in small screen

Hi,
My app is need to install on the small screen size device.
But when I open picker activity, the Done button not showing.
It there any parameter to set Done button position ?
leku

And another problem is the buttons color are always gray.

Thanks,

Info Required

  • Which version of the library do you actually use?
    3.4.0
  • Do you have the localization permission granted?
    no
  • Are you sending parameters to the activity through the bundle?
    N
  • Could you describe what are the actions do you make to raise that error?
    N
  • Android monitor shows any log related to the library when the error is shown?
    N
  • Any other thing that could help me to reproduce the error?
    N

Screenshots

ENABLE/DISABLE SATELLITE VIEW NOT WORKING

Description

intent.putExtra(LocationPickerActivity.ENABLE_SATELLITE_VIEW, false);
parameter not working in bundle passing

Info Required

  • Which version of the library do you actually use?
    3.1.0
  • Do you have the localization permission granted?
    YES
  • Are you sending parameters to the activity through the bundle?
    YES
  • Could you describe what are the actions do you make to raise that error?
    LocationPickerActivity.ENABLE_SATELLITE_VIEW not found while library import.
  • Android monitor shows any log related to the library when the error is shown?
    Editor show the error that variable not found.
  • Any other thing that could help me to reproduce the error?

Screenshots

image

Crash 3.2.0 to 3.4.1

After I upgraded the version of this library from 3.2.0 to 3.4.1 the application shows me following types of bugs in Applications onpause Method in every activity:

java.lang.AbstractMethodError: abstract method "void com.google.android.gms.internal.zzaac$zza.zzas(boolean)"
at com.google.android.gms.internal.zzaac.zzas(Unknown Source)
at com.google.android.gms.internal.zzaac.onTrimMemory(Unknown Source)
at android.app.Application.onTrimMemory(Application.java:134)
at android.app.ActivityThread.handleTrimMemory(ActivityThread.java:4632)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
08-08 15:24:35.075 818-878/? E/WifiConfigStore: updateConfiguration freq=2412 BSSID=6c:19:8f:c8:87:88 RSSI=-51 "TopOfStack Link3 2.4"WPA_PSK

Proguard Help

It would be great to know what to put in proguard rules, I've tried putting these:
-dontwarn com.schibstedspain.leku.**
-dontwarn rx.internal.util.unsafe.**

It's not working.

Thanks in advance.

List place or address from my country by search, not showing

Hello, I'm from indonesia. I use this library for my apps. But i get something bugs. List place or address from my country by search, not showing. I type "Pamulang", this is place name in my country, but now show.

This is my code:
LocationPickerActivity.Builder pick = new LocationPickerActivity.Builder()
.withGeolocApiKey(getString(R.string.google_maps_key))
.withStreetHidden()
.withCityHidden()
.withSearchZone("es_ES")
.withZipCodeHidden()
.withSatelliteViewHidden();

so how to solve it ? thanks

Search View not working properly.

Hi, I'm from India. I used your library and it is working pretty awesome. But the problem is that the search view isn't working properly. It only shows some results. I have also set the search zone to India but still no luck. Well it is not that important to my application so I was thinking of removing it. Is there any way to remove it?

Point to my location when just accepted the location permission dialog

Right now, if the phone has the location permission, it points to your location. But, if it doesn't have it, it prompts the user for that permission. If the user accepts it, it doesn't point to the user's location automagically, but the user has to tap the "my location" button.

That's not a big issue but something to improve :·)

ClassNotFoundException

Description

Some classes dependencies did't find: pl.charmas.android.reactivelocation2.ReactiveLocationProvider.

Info Required

  • Which version of the library do you actually use?
    Leku: 3.6.1
    PlayServices: 11.6.0

  • places

  • location

  • Do you have the localization permission granted?
    yes

  • Are you sending parameters to the activity through the bundle?

val intent = LocationPickerActivity.Builder()
                .withLocation(LocationPreference.locationLatitude.toDouble(), LocationPreference.locationLongitude.toDouble())
                .withGeolocApiKey(activity?.getString(R.string.google_geo_api_key))
                .withSearchZone("pt_BR")
                .withSatelliteViewHidden()
                .build(activity)
        activity?.startActivityForResult(intent, Constants.IntentCodes.LOCATION_PICKER)
  • Android monitor shows any log related to the library when the error is shown?
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: br.com.samples.location, PID: 5030
                  java.lang.NoClassDefFoundError: Failed resolution of: Lpl/charmas/android/reactivelocation2/ReactiveLocationProvider;
                      at com.schibstedspain.leku.LocationPickerActivity.setUpMainVariables(LocationPickerActivity.java:166)
                      at com.schibstedspain.leku.LocationPickerActivity.onCreate(LocationPickerActivity.java:140)
                      at android.app.Activity.performCreate(Activity.java:6679)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                      at android.app.ActivityThread.-wrap12(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:154)
                      at android.app.ActivityThread.main(ActivityThread.java:6119)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                   Caused by: java.lang.ClassNotFoundException: Didn't find class "pl.charmas.android.reactivelocation2.ReactiveLocationProvider" on path: DexPathList[[zip file "/data/app/br.com.samples.location-2/base.apk", zip file "/data/app/br.com.samples.location-2/split_lib_dependencies_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_0_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_1_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_2_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_3_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_4_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_5_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_6_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_7_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_8_apk.apk", zip file "/data/app/br.com.samples.location-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/br.com.samples.location-2/lib/x86, /data/app/br.com.samples.location-2/base.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_dependencies_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_0_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_1_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_2_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_3_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_4_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_5_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_6_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_7_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_8_apk.apk!/lib/x86, /data/app/br.com.samples.location-2/split_lib_slice_9_apk.apk!/lib/x86, /system/lib, /vendor/lib]]
                      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                      at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
                      at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                      at com.schibstedspain.leku.LocationPickerActivity.setUpMainVariables(LocationPickerActivity.java:166) 
                      at com.schibstedspain.leku.LocationPickerActivity.onCreate(LocationPickerActivity.java:140) 
                      at android.app.Activity.performCreate(Activity.java:6679) 
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) 
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618) 
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
                      at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:154) 
                      at android.app.ActivityThread.main(ActivityThread.java:6119) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:0
E/GoogleCertificates: Failed to load com.google.android.gms.googlecertificates
                      pt: No acceptable module found. Local version is 0 and remote version is 0.
                          at com.google.android.gms.dynamite.DynamiteModule.a(:com.google.android.gms.DynamiteModulesB@11743470:11)
                          at hx.a(:com.google.android.gms.DynamiteModulesB@11743470:12)
                          at hx.a(:com.google.android.gms.DynamiteModulesB@11743470:31)
                          at hx.b(:com.google.android.gms.DynamiteModulesB@11743470:30)
                          at ii.a(:com.google.android.gms.DynamiteModulesB@11743470:35)
                          at ii.a(:com.google.android.gms.DynamiteModulesB@11743470:20)
                          at com.google.maps.api.android.lib6.impl.ew.a(:com.google.android.gms.DynamiteModulesB@11743470:141)
                          at com.google.maps.api.android.lib6.impl.fc.run(:com.google.android.gms.DynamiteModulesB@11743470:27)
                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                          at java.lang.Thread.run(Thread.java:761)

Requesting location permissions

v3.1.0

I'm using Leku as a fallback to allow users to select their location if it wasn't found or if they deny location permissions in a previous activity.

Right now my flow is:
MyActivityNeedingLocationExample.java

if permissions granted: use location/fused and continue without Leku
if permissions denied: start Leku

It seems that Leku always ask for permissions on start. I couldn't see any documentation on preventing this. It would be great if that was possible, or if anyone knows whether a PR to fix would need a lot of changes? Thanks

View transition names

In order to make transitions between activities, views should contain android:transitionName properties.

It should be great to have Leku activity views with this field.

Example:

2 FAB buttons
Street name
City name
Postal Code
Search bar
Info layout
Map (?)

Fab is not positioned correctelly

At first time It's good but when i move the tracker to another place
the FAB looks like this

screenshot 2f e2 80 8f 2f - -

Hope you fix it ASAP
Many Thanks.
(Samsung Galaxy S6)

Reduce method counts

Hello There, Could you please make a separate builds for the library? the soon i add it to my project, i got

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

by analysing the library in Methods Count
it says that it has 38540 methods the library itself has 433 and 16 dependency, if you could make two separate builds a one with Rx, lambda & one without them to reduce the method count that had be great.

Thanks

Search button

Please add custom button for apply text search.
Some blonde girls not known about default search button on keyboard.

Google play services 9.6.1

I have a problem when compiling my project. After updating all my google dependencies to 9.6.1, an error is shown:

All com.google.android.gms libraries must use the exact same version. (9.6.1)

I think this is caused because Leku uses maps:9.4.0

Is there any solution without needing to update Leku library?

Thanks in advance

Locale support PRs not working for locales not existing in java.util.Locale

Description

The recent PRs for locale support don't appear to be working. It looks like we are trying to create Locale object's from country codes and then later querying the locale.getCountry()
However, this will only work for countries listed in java.util.Locale (Which is a very small amount).
For example, when I followed the latest PR format to add support for Ireland (IE), LocationPickerActivity.retrieveLocationFromZone() creates new Locale("IE") but then later queries locale.getCountry() in CountryLocaleRect.getLowerLeftFromZone() which actually returns null

I'm going to personally go with a hack workaround for now, but I feel like we should come up with a better solution for locales? Surely some library is already doing this (getting lat/lng bounds) for the majority of countries?

screen shot 2017-08-19 at 00 05 47

Info Required

  • Which version of the library do you actually use?
    v3.4.3

Build failing when I use this library

Description

Gradle error:
app:transformDexArchiveWithExternalLibsDexMergerForDebug

Info Required

  • Which version of the library do you actually use?
    6.4.5
  • Do you have the localization permission granted?
    Not relevant
  • Are you sending parameters to the activity through the bundle?
    Not relevant
  • Could you describe what are the actions do you make to raise that error?
    Just add the library
  • Android monitor shows any log related to the library when the error is shown?
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
  • Any other thing that could help me to reproduce the error?
    Android Studio 3.0
    Gradle 4.3

Screenshots

Crash

Instructions unclear. dick stuck in freezer

java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzab; or its super classes (declaration of 'com.google.android.gms.common.internal.zzab' appears in /data/app/mypackagename-2/base.apk) at com.google.android.gms.maps.model.CameraPosition.<init>(Unknown Source) at com.google.android.gms.maps.model.CameraPosition.<init>(Unknown Source) at com.google.android.gms.maps.model.CameraPosition$Builder.build(Unknown Source) at com.google.android.gms.maps.model.CameraPosition.createFromAttributes(Unknown Source) at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source) at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source) at android.support.v4.app.Fragment.onInflate(Fragment.java:1174) at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2414) at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:120) at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:376) at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:33) at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:75) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.view.LayoutInflater.inflate(LayoutInflater.java:365) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.schibstedspain.leku.LocationPickerActivity.onCreate(LocationPickerActivity.java:112) at android.app.Activity.performCreate(Activity.java:5975) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5264) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:900) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:695)

I followed the steps on main page. Is this happens because I try to start it from a fragment? Thx

edit: About that google-services stuff. I got this line at the bottom of my gradle file :
apply plugin: 'com.google.gms.google-services'

classpath 'com.google.gms:google-services:3.0.0' // and this is in the other gradle file. Called project-level gradle file I think.

that was needed for firebase setup

Conflicting dependecies

Please, update sdk tools versions to latest version 26 or exclude com.android.support libs from yoour project, because I can't use this module with my apps target sdk = 26;
Gradle build error code:
`Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:design:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:appcompat-v7:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:25:5-27:34 to override.`

Confirm Location Button missing

Hello, I get the error message as a Toast: "Something went wrong. Please try again." This equals the string key "load_location_error". I can start the intent. I can press the "GPS"-FAB to move to my current location. I can write into the Search bar and speak into the microphone. But: I don't have the Confirmation-FAB to actually get the chosen location and return to my previous activity. When typing into the Search bar, on every key press a new "Something went wrong. Please try again." spawns, as well as after finishing a voice input. If it put this into the intent:
intent.putExtra(LocationPickerActivity.BACK_PRESSED_RETURN_OK, true);
And I press back, it does NOT return OK, but instead RESULT_CANCELED.

My Google Developer Console shows the incoming requests for "Google Maps Android API", without any errors.

Important parts of my AndroidMainfest.xml:

            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/>
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="@string/google_maps_key"/>
        <activity
            android:name="com.schibstedspain.leku.LocationPickerActivity"
            android:label="@string/title_activity_location_picker"
            android:parentActivityName=".view.activity.PreInfoActivity"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH"/>
            </intent-filter>
            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable"/>
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".view.activity.PreInfoActivity"/>
        </activity>

My module-level build.gradle:

    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
repositories {
    maven { url 'https://maven.fabric.io/public' }
    jcenter()
}
android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'
    defaultConfig {
        applicationId "my.application.name.id"
        vectorDrawables.useSupportLibrary = true
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
}
dependencies {
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.google.android.gms:play-services-auth:10.0.1'
    compile 'com.android.support:design:25.1.0'
    compile 'com.android.support:support-v4:25.1.0'
    compile 'com.android.support:cardview-v7:25.1.0'
    compile 'com.android.support:gridlayout-v7:25.1.0'
    compile 'com.android.support:support-vector-drawable:25.1.0'
    compile 'com.android.support:animated-vector-drawable:25.1.0'
    compile 'com.android.support:percent:25.1.0'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.schibstedspain.android:leku:3.0.0' 
    [...]
}
apply plugin: 'com.google.gms.google-services'

Screenshot:
leku-screencap

Devices: LG G3 (API 21) as well as Nexus 5X API 25 Emulator.

Also, I don't really get how SEARCH_ZONE works exactly. If I don't pass it as an Extra, is this equal to a global search zone? And what exactly does the search zone do? I want the user to be able to choose a location globally.

I hope it is just a stupid, obvious mistake.

The address / location is not found.

Description

At some phones, they are not able to select a location. Also the address is not found.
See screenshots, the same address works on different phones.

Info Required

  • Which version of the library do you actually use?
    3.1.0

  • Do you have the localization permission granted?
    yes

  • Are you sending parameters to the activity through the bundle?
    yes, it works on most of the phones

  • Could you describe what are the actions do you make to raise that error?
    It doesn't work on a zte axon 7 with android 7.1.

Screenshots

ffac5a280ac1291fa8c7f33c2dda58ef
12e7698199d7bafdb266506056534ca9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.