Giter Site home page Giter Site logo

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

googlemaps-samples avatar googlemaps-samples commented on June 3, 2024
Error: Program type already present: com.google.android.libraries.places.api.internal.impl.net.pablo.AutocompletePredictionResult$StructuredFormatting" after adding new libraries

from android-places-demos.

Comments (14)

amuramoto avatar amuramoto commented on June 3, 2024 2

This is because you are including both places and places-compat. You must remove one of them.

from android-places-demos.

joelmmx avatar joelmmx commented on June 3, 2024

If you remove the first one: com.google.android.libraries.places:places:1.0.0 the project doesn't compile.
If you remove the second one: com.google.android.libraries.places:places-compat:1.0.0 the project can compile, but in runtime doesn't work,
Any idea to resolve??
@eriknyk , could you resolve it ?

from android-places-demos.

kamilwyszynski avatar kamilwyszynski commented on June 3, 2024

I have the same problem and removing one of them doesn't solve the problem.
I left the com.google.android.libraries.places:places:1.0.0 and the error is exactly the same.
What should I do?
@eriknyk

from android-places-demos.

dharmeshrathore avatar dharmeshrathore commented on June 3, 2024

i am having the same problem

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

what should i do?

from android-places-demos.

amuramoto avatar amuramoto commented on June 3, 2024

@kamilwyszynski @dharmeshrathore Can you provide a link to your gradle file?

from android-places-demos.

McKabue avatar McKabue commented on June 3, 2024

Same problem here

from android-places-demos.

amuramoto avatar amuramoto commented on June 3, 2024

@McKabue can you provide a link to your gradle file?

from android-places-demos.

jwilly12 avatar jwilly12 commented on June 3, 2024

I have the same issue, what was the solution?

from android-places-demos.

asmodeus78 avatar asmodeus78 commented on June 3, 2024

Same problem any solution found?

from android-places-demos.

jwilly12 avatar jwilly12 commented on June 3, 2024

It was a library issue. Google is confusing with their new Places SDK migration description.
But I fixed the issue doing the following:

In Gradle App dependencies
implementation 'com.google.android.libraries.places:places:1.1.0' // Remove
implementation 'com.google.android.libraries.places:places-compat:1.1.0' // Add

*** In activity
import com.google.android.libraries.places.api.net.PlacesClient; // Remove
import com.google.android.libraries.places.api.Places; // Remove

*** Remove all com.google.android.gms.location.places and replace with:

import com.google.android.libraries.places.compat.AutocompletePredictionBufferResponse; // New
import com.google.android.libraries.places.compat.AutocompletePrediction; //New
import com.google.android.libraries.places.compat.AutocompleteFilter; //New
import com.google.android.libraries.places.compat.GeoDataClient; //New
import com.google.android.libraries.places.compat.Place; //New
import com.google.android.libraries.places.compat.Places; //New
import com.google.android.libraries.places.compat.PlaceBufferResponse; //New

from android-places-demos.

amuramoto avatar amuramoto commented on June 3, 2024

thanks for the info @jwilly12!

from android-places-demos.

eriknyk avatar eriknyk commented on June 3, 2024

@kamilwyszynski nope, I have not luck to get com.google.android.libraries.places.compat working,
I spend about half day trying to get this working, and after that I decided to rewrite the implementation with using new api so get rid of places.compat, and rewrite the code took in my case half hour.

from android-places-demos.

rufinex avatar rufinex commented on June 3, 2024

Duplicate class com.google.android.libraries.places.api.internal.impl.net.pablo.AutocompletePredictionResult found in modules classes.jar (com.google.android.libraries.places:places-compat:1.1.0) and classes.jar (com.google.android.libraries.places:places:1.1.0)

It's impossible to solve this duplicity until a solution to this problem appears, I'll continue using 'com.google.android.gms: play-services-places: 16.1.0'

from android-places-demos.

AmritpalSingh5 avatar AmritpalSingh5 commented on June 3, 2024

Just comment this 'com.google.android.libraries.places:places:1.0.0' use only this 'com.google.android.libraries.places:places-compat:1.0.0' issue will resolved.

from android-places-demos.

Related Issues (20)

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.