Code Monkey home page Code Monkey logo

android-places-demos's Introduction

Google Places SDK for Android Demos

GitHub contributors Apache-2.0 Discord

This repo contains the following apps that demonstrate use of the Google Places SDK for Android:

  1. demo-kotlin Kotlin demo app for the Places SDK.
  2. demo-java Java demo app for the Places SDK.

Note that each folder contains a distinct sample and must be imported separately. Each project also contains two Gradle product flavors:

  1. gms: Product flavor for samples using the Places SDK that uses Maps SDK for Android
  2. v3: Product flavor for samples using the Places SDK that uses Maps SDK V3 BETA for Android

Additionally, the snippets app contains code snippets used for documentation found in https://developers.google.com/places/android-sdk

Getting Started

These demos use the Gradle build system.

First download the demos by cloning this repository or downloading an archived snapshot. (See the options on the right hand side.)

In Android Studio, use the "Open an existing Android Studio project", and select one of the demo directories (demo-kotlin or demo-java).

Alternatively use the ./gradlew build command to build the project directly.

The demos also require that you add your own API key:

  1. Get an API Key.
  2. Open the local.properties file in either demo project
  3. Add a single line to local.properties that looks like PLACES_API_KEY=YOUR_API_KEY, where YOUR_API_KEY is the API key you obtained in the first step. You can also take a look at local.defaults.properties as an example.
  4. Build and run.

Support

If you've found an error in these samples, please file an issue: https://github.com/googlemaps/android-places-demos/issues

Patches are encouraged, and may be submitted according to the instructions in CONTRIBUTING.md.

License

Copyright 2019 Google, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.

android-places-demos's People

Contributors

amuramoto avatar arriolac avatar dependabot-preview[bot] avatar dependabot[bot] avatar dkhawk avatar googlemaps-bot avatar jpoehnelt avatar kikoso avatar stephenmcd avatar wangela 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

android-places-demos's Issues

Sessiontoken not working

Hi,

I have been struggling with the session token for a while, nothing seems to work.
Therefore I tried your demo app but enabling session token does not make a difference, they still charged me 18 requests for 1 address autocomplete.

Do you have any idea why it is not working or am I the only one for which this is not working? Do I need to edit something in my Google API Console?

Kind regards,
Luuk

Are there any plans on adding Address Components field to the Place detail interface?

I've noticed that the Android SDK for Places API is missing the Address Components field (as stated here: https://developers.google.com/places/android-sdk/place-data-fields), making it unfeasible to get the specific components of an address: we can only get a formatted address, which is the joined string of some of its components.

Are there any plans on making it available as it is already on the iOS SDK? It's a bummer having to rely on the web API just for a missing mapping on the mobile SDK.

Why i am getting this, i import as you described.

I am getting this, Please Help.

Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for androidx.recyclerview:recyclerview:1.0.0-rc01
Could not get resource 'https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.0.0-rc01/recyclerview-1.0.0-rc01.aar'.
Could not HEAD 'https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.0.0-rc01/recyclerview-1.0.0-rc01.aar'.
Connect to dl.google.com:443 [dl.google.com/172.217.160.238] failed: Connection timed out: connect
Connection timed out: connect

PlaceSelectionListener is not triggerred

Tried to follow your demo to use PlaceSelectionListener in AutocompleteTestActivity; but both onPlacesSelected and onError were never fired...

I thought it may be related to this, but still no luck trying to do something like this.


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

    super.onActivityResult(requestCode, resultCode, intent);
    autocompleteSupportFragment.onActivityResult(requestCode, resultCode, intent);

ProGuard rules

I try to add places library to my InstantApp and it works fine. The problem is that the library code is already obfuscated, and the library adds the next ProGuard rules:

# Proguard file to be exported as to proguard.txt in the 3P AAR release.
# The Places Library has already been obfuscated. This prevent further obfuscation.
-keep class com.google.android.libraries.places. ** {
    <fields>;
    <methods>;
}

For this reason I can disable this rule to allow ProGuard shrinks the code. The result of that is that library code size is about 326.8KB, whereas my application code is 213KB (or 363KB from all android code).

Is there any option to shrink the library code?
Do I need to open an issue into issuetracker of the library?

Thank you very much in advance!

Error: Program type already present: com.google.android.libraries.places.api.internal.impl.net.pablo.AutocompletePredictionResult$StructuredFormatting" after adding new libraries

I just added:

   implementation ('com.google.android.libraries.places:places:1.0.0') {
        exclude module: 'support-v4'
    }
    implementation ('com.google.android.libraries.places:places-compat:1.0.0') {
        exclude module: 'support-v4'
    }

And I got the following error:

AGPBI: {"kind":"error","text":"Program type already present: com.google.android.libraries.places.api.internal.impl.net.pablo.AutocompletePredictionResult$StructuredFormatting","sources":[{}],"tool":"D8"}

Any help will be appreciated.
Thanks in advance.

the only one related thing that I've found on entirely internet (using google of course) was:

http://qaru.site/questions/17030061/google-places-api-program-type-already-present-autocompletepredictionresult

and it is also answered.

Support display cutouts in Overlay mode

Environment details

Places: 3.0.0
Android 12
A device with a notch

Steps to reproduce

I'm using a theme (MD v3) without actionbar. All the activities displayed correctly out of the box without adding anything except for AutocompleteActivity it overlap with status bar due the notch as the overlay mode use the default insets set by theme for status bar

Same for demo app too for Java:
Screenshot_20230124-101316

Unable to get postal_code of the Place for some of the Locations

Hai
I'am trying get postal_code of the location for which i selected from autocomplete predictions, but if Address contains postal_code then only i'am able get it through Address Component, but i want postal_code for all the locations which i select from the autocomplete prediction.
Example:
search for RT Nagar, Bangalore
i'am getting some suggestions out of those some of them don't have Pin code like
RT Nagar, Bagalore, Karnataka, India don't has any pin code in Address component
[Please reply to my query ASAP]

Duplicate Classes issue

implementation "com.android.support:appcompat-v7:${support_library_version}"

implementation "com.google.android.gms:play-services-vision:${google_play_services_version_vision}"
implementation 'com.google.android.gms:play-services-maps:${google_play_services_version_map}'
implementation "com.google.android.gms:play-services-location:${google_play_services_version_location}"
implementation "com.google.android.gms:play-services-analytics:${google_play_services_version_firebase_core}"
implementation "com.google.firebase:firebase-core:${google_play_services_version_firebase_core}"
implementation "com.google.firebase:firebase-messaging:${google_play_services_version_firebase_messaging}"
implementation('com.google.android.libraries.places:places:1.1.0')
In My Project i am using above library's and before adding new Places SDK no issues were there but after adding i am getting below error.I dont know what i am missing. Please help to fix this

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkStagingDuplicateClasses'.

1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class androidx.core.graphics.drawable.IconCompatParcelizer found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class androidx.core.internal.package-info found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
Duplicate class androidx.versionedparcelable.CustomVersionedParcelable found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.NonParcelField found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.ParcelField found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.ParcelImpl found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.ParcelImpl$1 found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.ParcelUtils found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcel found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcel$1 found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcel$ParcelException found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcelParcel found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcelStream found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcelStream$FieldBuffer found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcelStream$InputBuffer found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcelable found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
Duplicate class androidx.versionedparcelable.VersionedParcelize found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)

Go to the documentation to learn how to Fix dependency resolution errors.

Your app contains exposed Google Cloud Platform (GCP) API keys

Your app contains exposed Google Cloud Platform (GCP) API keys, the Classes:
MainActivity->onCreate

Please refer to the following article on how to fix the issue:
https://support.google.com/faqs/answer/9287711

I am getting this alert from my google play store console. I have added restrictions to my apikey. but i have used same line as demo

**String apiKey = getResources().getString(R.string.google_api_key);

if (!Places.isInitialized()) {
Places.initialize(getApplicationContext(), apiKey);
}**

this is cause of this issue. How to rectify this. Can you please explain

Dependabot couldn't find a build.gradle for this project

Dependabot couldn't find a build.gradle for this project.

Dependabot requires a build.gradle to evaluate your project's current Java dependencies. It had expected to find one at the path: /compat/build.gradle.

If this isn't a Java project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

Search suggestions are invalid

Environment details

  • . 'com.google.android.libraries.places:places:2.4.0'
  • Android 29/30

Steps to reproduce

For the example from this library in the KOTLIN version (ProgrammaticAutocompleteToolbarActivity), I changed the data to search from my location. (you can see it in the attached code).
When I start typing the name of a street that is almost in the neighborhood, it doesn't find it.
When I almost enter the whole street name, it will find it in a different city.

It gives the impression that it is everywhere, but not where it should be.

Code example

val bias: LocationBias = RectangularBounds.newInstance(
        LatLng(18.55480, 54.34082),
        LatLng(18.72612, 54.42620)
)

val newRequest = FindAutocompletePredictionsRequest
        .builder()
        .setSessionToken(sessionToken)
        .setOrigin(LatLng(18.62556, 54.38044))
        .setLocationBias(bias)
        .setTypeFilter(TypeFilter.ADDRESS)
        .setQuery(query)
        .setCountries("PL")
        .build()

Looking at other implemented solutions that work very well my situation is very strange. I don't know where to look for the problem.

Can't load search results

Hello,

I am trying to implement the Google Places Autocomplete API sometimes I am able to get location list but sometimes I get "can't load search results" message. Even I tried the demo app there also I have the same issue. Can you please help whether I am missing any configurations or what I am doing wrong.

Thank you

Keyboard doesn't show up automatically in Android API 28

In Android APIs prior to 28, when you press the "OPEN ACTIVITY" button, the keyboard shows up automatically and the user can begin typing immediately. However, in API 28 the user has to click the search bar before they can begin typing. This is clearly an inferior user experience.

Session for autocomplete is not working

Environment details

  • 'com.google.android.libraries.places:places:2.4.0'
  • Android 29/30

I wanted to test in DEMO how sessions with Token for autocomplete work.

Whichever combination I take, I think the session isn't working.

When I type the address and look at the requests for the Places API, it is equal to the number of characters entered.

Shouldn't there be one session and one request?

Required File: LICENSE

The following file is missing from this repository: LICENSE

Do not edit below:
meta: [LICENSE]

Place picker not working

I have enabled billing in for my project , and enabled the place API and MAP SDK for android . Still my Place picker closes immediately when it opens .I have read about the deprecated methods and also seen your example that too have deprecated method. Can you please suggest some solution to overcome this issue .

Remove jcenter()

Remove jcenter() from the repository list and instead fetch dependencies from maven central.

java.lang.IllegalStateException: Places must be initialized.

Firebase Crashes Report:

Caused by java.lang.IllegalStateException
Places must be initialized.

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{com.islamuna.ramadan/com.google.android.libraries.places.widget.AutocompleteActivity}: java.lang.IllegalStateException: Places must be initialized.

SDK version:
implementation 'com.google.android.libraries.places:places:1.1.0'

Layout include


<fragment
                    android:id="@+id/place_autocomplete_fragment"
                    android:name="com.google.android.libraries.places.widget.AutocompleteSupportFragment"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@drawable/border_filled" />

Even i initialize Place sample code:

Places.initialize(getApplicationContext(), "mykey", Locale.US);

autocompleteFragment = (AutocompleteSupportFragment)
                    getSupportFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
            autocompleteFragment.setPlaceFields(Arrays.asList(Place.Field.ID, Place.Field.NAME,Place.Field.LAT_LNG));
            autocompleteFragment.setText(Global.getStoredStringValue(getApplicationContext(), getString(R.string.KEY_CITY)));

            autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
                @Override
                public void onPlaceSelected(Place place) {
                    try {

                        }
                    } catch (Exception e) {
                    }

                }

                @Override
                public void onError(Status status) {
                    // TODO: Handle the error.

                }
            });

Place picker with map UI not wokring

PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
startActivityForResult(builder.build(this), 1);

not working with compat library too

Where are the Android Places SDK Javadocs?

Hello, I'm having trouble finding the javadocs for this new library. Can someone please link me? It has always been the case for me that I have trouble downloading the source or javadocs in Android Studio , so I am wanting guidance on what is the best place to read the javadocs for this new Places SDK.

For example when I try to look up the javadocs in AS I get the following info:

Screen Shot 2019-04-23 at 2 59 42 PM

Note: I tried looking here: https://developers.google.com/android/reference/packages

Compat - PlacePicker closes immediately after launch

By installing the demo app ther is an issue on PlacePicker.
CurrentPlace and AutoComplete features works correctly but PP is shown and closed immediately without errors or warnings.
It can't be a API Key issue because 2/3 features works perfectly showing data.

Place Autocomplete for Compose

Thanks for the effort in the repo.

In the meantime, while the support of compose areas in the community and a lot of people are migrating to compose we still didn't have any support for Places Autocomplete in Compose.

I found this issue opened and I think it might take time to be implemented in Compse.

how about adding a Place Autocomplete Compose demo while using AndroidView inside Compose that will help us at least until the SDK migrated to Compse.

Leaked GCP API Keys - Places, Maps APIs

Environment details

  1. Specify the API at the beginning of the title - Places API, Maps API
  2. OS type and version - Android 11
  3. Library version and other environment information - secrets-gradle-plugin 2.0.0

The error

I've received the following error in Play Console:
Errors found. Fix before releasing to production.
Leaked GCP API Keys - Your app contains exposed Google Cloud Platform (GCP) API keys.

image

What I've tried

I've applied all the best practices mentioned in Securing an API key and of course I've added API key restrictions.

I'm using the secrets-gradle-plugin latest version as of now - 2.0.0, in order to hide my API key, I've followed the instructions in this video and my API key is stored inside the local.properties and the BuildConfig.java file. unfortunately this isn't enough for google and they still won't let me release my app because of this silly error.

How do I fix this error?

Does this prevent me from publishing my app on Internal Testing or Closed Testing?

Thanks.

Places: ProgrammaticPlacePredictions apiException: 9012 : INVALID_REQUEST

Hello,

ProgrammaticPlacePredictions not working when implementing programmatic place predictions.

I tried the exact same code programmaticPlacePredictions -> apiException: 9012 : INVALID_REQUEST
I tried setting minimum properties: Token, query, TypesFilter -> apiException: 9012 : INVALID_REQUEST
I tried working with widget/fragment and it worked.

I am using Android Studio Dolphin | 2021.3.1 Patch 1 and a physical device Google Pixel 6.

Kind regards,
Hamza

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

The property '#/update_configs/0/update_schedule' value "live" did not match one of the following values: daily, weekly, monthly
The property '#/update_configs/1/update_schedule' value "live" did not match one of the following values: daily, weekly, monthly
The property '#/update_configs/2/update_schedule' value "live" did not match one of the following values: daily, weekly, monthly

Please update the config file to conform with Dependabot's specification using our docs and online validator.

Autocomplete Address Form sample: soft keyboard covers map

In AutocompleteAddressActivity.java, once the address gets populated from the Autocomplete response, focus is placed on the Address Line 2 input field which causes the soft keyboard to engage and cover half the screen, including covering up the confirmation map. If a user doesn't need to fill in Address Line 2, they must scroll down to find the map and the submit button.

As discussed in the PR comments, we can try a couple of approaches to improve the UX.

Playstore shows "Leaked GCP API Keys" error

Google play store complains error when I upload package. Following initialising code has a problem.

    if (!Places.isInitialized()) {
        Places.initialize(getApplicationContext(), BuildConfig.MAPS_API_KEY);
    }

Screen Shot 2022-02-09 at 11 31 03 am

Closing the Overlay textfield

The error is kinda intermittent. When you load the Overlay Place textfield, and return to the calling screen, the original screen is greyed out and loses focus. You can get back the focus when you minimize the app and return to it. Users will not know that they have to do that to get back control on the screen.

Bug: all buttons in the sample of Kotlin&v3 cause a crash

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ...")
    v3

  2. OS type and version
    Emulator API 30

  3. Library version and other environment information
    // GMS
    gmsImplementation 'com.google.android.libraries.places:places:2.4.0'

    // V3
    v3Implementation name:'places-maps-sdk-3.1.0-beta', ext:'aar'
    v3Implementation 'com.android.volley:volley:1.1.1'
    v3Implementation 'com.google.android.gms:play-services-base:17.4.0'
    v3Implementation 'com.google.android.gms:play-services-basement:17.4.0'
    v3Implementation 'com.google.android.gms:play-services-gcm:17.0.0'
    v3Implementation 'com.google.android.gms:play-services-location:17.1.0'
    v3Implementation 'com.google.android.gms:play-services-tasks:17.2.0'
    v3Implementation 'com.google.android.libraries.maps:maps:3.1.0-beta'
    v3Implementation 'com.google.auto.value:auto-value-annotations:1.7.4'
    v3Implementation 'com.google.code.gson:gson:2.8.6'

Steps to reproduce

  1. Import attached, which is based on the demo here:

https://github.com/googlemaps/android-places-demos/tree/main/demo-kotlin

Code example

It's just what's on the sample.

Stack trace

2020-10-19 10:43:01.502 32526-32526/com.example.placesdemo.v3 E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.placesdemo.v3, PID: 32526
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/datatransport/runtime/TransportRuntime;
        at com.google.android.libraries.places.internal.fg.<init>(PG:5)
        at com.google.android.libraries.places.internal.cb.h(PG:17)
        at com.google.android.libraries.places.internal.cb.i(PG:18)
        at com.google.android.libraries.places.internal.cb.l(PG:21)
        at com.google.android.libraries.places.internal.cb.r(PG:27)
        at com.google.android.libraries.places.internal.cb.a(PG:1)
        at com.google.android.libraries.places.api.Places.a(PG:43)
        at com.google.android.libraries.places.api.Places.createClient(PG:30)
        at com.example.placesdemo.CurrentPlaceTestActivity.onCreate(CurrentPlaceTestActivity.kt:62)
        at android.app.Activity.performCreate(Activity.java:8000)
        at android.app.Activity.performCreate(Activity.java:7984)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.datatransport.runtime.TransportRuntime" on path: DexPathList[[zip file "/data/app/~~4e9kwdXxgvYn4L0pRpwLiA==/com.example.placesdemo.v3-SLNdZABmDyGjIHSjoIMU4w==/base.apk"],nativeLibraryDirectories=[/data/app/~~4e9kwdXxgvYn4L0pRpwLiA==/com.example.placesdemo.v3-SLNdZABmDyGjIHSjoIMU4w==/lib/x86, /data/app/~~4e9kwdXxgvYn4L0pRpwLiA==/com.example.placesdemo.v3-SLNdZABmDyGjIHSjoIMU4w==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]

Following these steps will guarantee the quickest resolution possible.

I've tried each of the buttons. All cause a crash.

See attached:

https://github.com/kataklisma/android-google-places/files/5399937/2020-10-19_10-42-11.zip

And the project (without the real key):

https://github.com/kataklisma/android-google-places/files/5399948/demo-kotlin.zip

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.