googlearchive / android-play-places

Deprecated:
https://github.com/googlemaps/android-places-demos
Apache License 2.0
477 stars 580 forks source link

PLACES_API_ACCESS_NOT_CONFIGURED #29

Closed dmbuguah closed 5 years ago

dmbuguah commented 8 years ago

I'm trying out the PlaceComplete example. Getting - Error getting autocomplete prediction API call: Status{statusCode=PLACES_API_ACCESS_NOT_CONFIGURED, resolution=null}

What might cause this? Thank you!

mandadimuralidharreddy commented 8 years ago

I am facing same problem.

umesh0492 commented 8 years ago

checkout solution --> http://stackoverflow.com/questions/30434238/place-picker-automatically-close-after-launch

dmbuguah commented 8 years ago

Cool..Thanks.

shreenithya commented 8 years ago

how to connect places api

mandadimuralidharreddy commented 8 years ago

@shreenithya I have recently implemented in one of my projects. Exatly where your logging.For any query you can contact me mandadimuralidharreddy@gmail.com.

karansoni725 commented 7 years ago

Error contacting API: Status{statusCode=PLACES_API_INVALID_APP,resolution=null}

This Error is coming only Two phones , can anybody help me how to resolved this error, otherPhone is Going gud

Sunil-tc commented 6 years ago

I'm also facing same issue.

Abokorhassan commented 5 years ago

Enable the Google Places API for Android in developers console and check on the credentials page that your key is still present. it worked for me

Abramovick commented 5 years ago

I Enable the Google Places API for Android in developers console, and i can see that the calls are coming through on the graph with HTTP Status of 200, so they are successful, but the modal still automatically closes...

rafaelmaia8384 commented 5 years ago

I am facing the same issue here... Everything is configured as required in google docs.

"com.google.android.gms.ui E/Places: Place Picker closing due to PLACES_API_ACCESS_NOT_CONFIGURED"

bilawalsharif commented 5 years ago

I am facing the same issue PLACES api access not configured.Anyone can have the answer ?

Abramovick commented 5 years ago

@bilawalsharif @rafaelmaia8384 I was using react-native-google-places when i was facing that issue. I tried everything and searched for days but didn't find any answer or solution that worked... So I gave up and switched to react-native-places-autocomplete and that seems to be working fine. If you're using react native, then perhaps you might wanna try that.

bilawalsharif commented 5 years ago

Thnx Dear, I am using Android nkt react.I just switch gmail account to new account and generate new API key not its working fine.

On Thu, Mar 7, 2019, 3:54 PM Abraham Itule notifications@github.com wrote:

@bilawalsharif https://github.com/bilawalsharif @rafaelmaia8384 https://github.com/rafaelmaia8384 I was using react-native-google-places https://github.com/tolu360/react-native-google-places when i was facing that issue. I tried everything and searched for days but didn't find any answer or solution that worked... So I gave up and switched to react-native-places-autocomplete https://github.com/FaridSafi/react-native-google-places-autocomplete and that seems to be working fine. If you're using react native, then perhaps you might wanna try that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-places/issues/29#issuecomment-470480677, or mute the thread https://github.com/notifications/unsubscribe-auth/AZnwTQoJn8yEirbkCnQXcx7OBYNvVfJtks5vUO_zgaJpZM4GzMLl .

codal-mpawar commented 5 years ago

places_api_access_not_configured error is not solve any idea plz share in react-native android app

bilawalsharif commented 5 years ago

You just re-create API key from any other gmail account it will work.

On Tue, Mar 12, 2019 at 4:52 AM codal-mpawar notifications@github.com wrote:

places_api_access_not_configured error is not solve any idea plz share in react-native android app

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-places/issues/29#issuecomment-471969147, or mute the thread https://github.com/notifications/unsubscribe-auth/AZnwTY2V41-oPAluLf1G6VTCwk6UGOryks5vV5UIgaJpZM4GzMLl .

HoangTri81 commented 5 years ago

I enable the Google Places API Android in developers console and create new API key. I tried both 2 API key for my project map is work but when I'm trying out the PlaceComplete, I checked that the calls on dashboard of Google Developer Console not found any Places API request coming through, the modal automatically closes and Log get error "Status{statusCode=PLACES_API_ACCESS_NOT_CONFIGURED, resolution=null}". It took me several days to find ways to fix it and this is the reason https://errorstrike.com/2019/02/places-autocomplete-error-fix-2019/

Hassanjankhan commented 5 years ago

i have the same issue any one please help

amarnathkumarsah commented 5 years ago

anyone has resolved then please ping me i am also facing the same issue and got stuck.

ramz1121 commented 5 years ago

I am facing the same issue. Please help me out

HoangTri81 commented 5 years ago

1: Check and enable the Google Places API for Android in developers console

  1. In build.grandle add: implementation 'com.google.android.libraries.places:places:1.0.0'
  2. In AndroidManifesst.xml add: <meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR API KEY" />
    3.In Activity java file must code: if (!Places.isInitialized()) { Places.initialize(getApplicationContext(), "YOUR API KEY""); }
noer180895 commented 5 years ago

i have same issue plis help me for fixing it

HoangTri81 commented 5 years ago
  1. AndroidManifesst.xml add `

    <application ...... <meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR API KEY" /> `

    1. build.grandle add: implementation 'com.google.android.libraries.places:places:1.0.0'
  2. my java code: PlaceGoogleMapActivity `import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.libraries.places.api.Places; import com.google.android.libraries.places.api.model.Place; import com.google.android.libraries.places.widget.Autocomplete; import com.google.android.libraries.places.widget.AutocompleteActivity; import com.google.android.libraries.places.widget.model.AutocompleteActivityMode;

public class MainActivity extends FragmentActivity implements OnMapReadyCallback {

private GoogleMap mMap;

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

    if (!Places.isInitialized()) {
        Places.initialize(getApplicationContext(), "YOUR API KEY");
    }
    TextView txtPlace = (TextView) findViewById(R.id.txt_place);
    //Call AutocompleteFragment use intent
    txtPlace .setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            CallAutocompleteFragment(1);
        }
    });
}

@Override
public void onMapReady(GoogleMap googleMap) {
    // do something
       mMap = googleMap;
        LatLng fixedLocation = new LatLng(21.007142, 105.8099993);
        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(fixedLocation, 15));
    }

private void CallAutocompleteFragment(int AUTOCOMPLETE_REQUEST_CODE) {

    List<Place.Field> fields = Arrays.asList(Place.Field.ID, Place.Field.NAME, Place.Field.LAT_LNG, Place.Field.ADDRESS);
    Intent intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.FULLSCREEN, fields).setCountry("VN").build(this);
     startActivityForResult(intent, AUTOCOMPLETE_REQUEST_CODE);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == 1) {
        if (resultCode == RESULT_OK) {
            Place place = Autocomplete.getPlaceFromIntent(data);
            origin_id  = place.getId();
            origin_add = place.getAddress();
            origin_name= place.getName();
            txtPlace .setText(place.getName());
            LatLng location = place.getLatLng();
            if (location != null) {  
                createMarker(location);
            } else {
                Toast.makeText(this, "location is null",Toast.LENGTH_SHORT).show();
            }
        } else if (resultCode == AutocompleteActivity.RESULT_ERROR) {
            // TODO: Handle the error.
            Status status = Autocomplete.getStatusFromIntent(data);
            Log.i("TAG", status.getStatusMessage());
        } else if (resultCode == RESULT_CANCELED) {
            // The user canceled the operation.
        }
  }

private void createMarker(LatLng latLng){
    if (mMap == null) {
        return;
    }
    MarkerOptions mOptions = new MarkerOptions().position(latLng);
    mOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
    mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15));
    mMap.addMarker(mOptions);
}

} If you use: <fragment android:id="@+id/place_autocomplete_fragment" android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment" android:layout_width="match_parent" android:layout_height="wrap_content" /> in layout you can code: public class MainActivity extends FragmentActivity implements OnMapReadyCallback, PlaceSelectionListener {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    if (!Places.isInitialized()) {
        Places.initialize(getApplicationContext(), "YOUR API KEY");
    }

    PlaceAutocompleteFragment autocompleteFragment =
            (PlaceAutocompleteFragment) getFragmentManager().findFragmentById(
                    R.id.place_autocomplete_fragment);
    autocompleteFragment.setOnPlaceSelectedListener(this);
}
// Callback when Map allready
@Override
public void onMapReady(GoogleMap googleMap) {
    // do something
}
// Callback when you click to item
@Override
public void onPlaceSelected(Place place) {
    // remove old marker when add new marker
    if (marker != null) marker.remove();
    LatLng myLatLng = place.getLatLng();
    marker = googleMap.addMarker(
            new MarkerOptions().position(myLatLng).title(String.valueOf(place.getName())));
    googleMap.animateCamera(CameraUpdateFactory.newLatLng(myLatLng));
}
@Override
public void onError(Status status) {
    // do something
}

} `

bilawalsharif commented 5 years ago

you may use old account or make new account for maps

On Sat, Jun 1, 2019 at 12:44 AM Raju Shingadiya notifications@github.com wrote:

@ @mandadimuralidharreddy https://github.com/mandadimuralidharreddy @karansoni725 https://github.com/karansoni725 @mandadimuralidharreddy https://github.com/mandadimuralidharreddy @umesh0492 https://github.com/umesh0492 @karansoni725 https://github.com/karansoni725

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-places/issues/29?email_source=notifications&email_token=AGM7ATKJI3YUL5MXJPU5CMLPYISGDA5CNFSM4BWMYLS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWW3DFY#issuecomment-497922455, or mute the thread https://github.com/notifications/unsubscribe-auth/AGM7ATMNG7V5DMY7TOZSKWTPYISGDANCNFSM4BWMYLSQ .

codingjeremy commented 5 years ago

This sample has been deprecated/archived (check README for more information on newer samples related to this technology).

As recommended by GitHub, we are closing all issues and pull requests.