简体   繁体   中英

Android Studio android-play-location google play service

I found on github https://github.com/googlesamples/android-play-location various location type, as suggested by https://developer.android.com/training/location/receive-location-updates.html , I tested LocationUpdates importing project on Android Studio. I run app on genymotion, smartphone, tablet, various android version but app always crash after Start updates button was clicked. I found others guide with play service location but app crash during start! Android Studio is the last, I downloaded and update tools etc... Someone could help me to understand what is the problem? When app crash no error showed

@Jayakrishnan PM is correct. Make sure that you have set up the Play Services properly. To develop an app using the Google Play services APIs, you need to set up your project with the Google Play services SDK.

To test your app when using the Google Play services SDK, you must use either:

  • A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
  • The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.

Along with new platform features, Android 6.0 Marshmallow has a new permissions model that streamlines the app install and auto-update process. Permissions are now requested at runtime instead of before app installation.

Ensure that your API level and Target SDK are set to 23 or greater. Additionally, ensure that you are using the V4 support library to verify and request permissions. If you don't have it already, add it to your gradle dependencies:

com.android.support:support-v4:23.0.0

You'll also need to declare permissions in your AndroidManifest.xml file. There's no change here--whatever permissions your app has always needed should be declared in your AndroidManifest.xml file with the uses-permission tag. For example:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM