webyonet / react-native-android-location-services-dialog-box

React Native Android Location Services Dialog Box
MIT License
182 stars 50 forks source link

No Activity found to handle Intent { act=android.settings.LOCATION_SOURCE_SETTINGS } #54

Closed maggialejandro closed 6 years ago

maggialejandro commented 6 years ago

Fatal Exception: android.content.ActivityNotFoundException

OS: 6.0.1 Device: Ken Brown Neo Wise

Lib Version: 2.4.4

android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:1798)
android.app.Instrumentation.execStartActivity (Instrumentation.java:1512)
android.app.Activity.startActivityForResult (Activity.java:3945)
android.app.Activity.startActivityForResult (Activity.java:3905)
com.showlocationservicesdialogbox.LocationServicesDialogBoxModule.newActivity (LocationServicesDialogBoxModule.java:122)
com.showlocationservicesdialogbox.LocationServicesDialogBoxModule.access$000 (LocationServicesDialogBoxModule.java:13)
com.showlocationservicesdialogbox.LocationServicesDialogBoxModule$2.onClick (LocationServicesDialogBoxModule.java:95)
com.android.internal.app.AlertController$ButtonHandler.handleMessage (AlertController.java:163)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:148)
com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run (MessageQueueThreadImpl.java:194)
java.lang.Thread.run (Thread.java:818)

any ideas? Thanks in advance!

TJBlack31 commented 6 years ago

@maggialejandro

have you tried calling it like this?

android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS

maggialejandro commented 6 years ago

@TJBlack31 yes, that's the way it's called https://github.com/webyonet/react-native-android-location-services-dialog-box/blob/eb44a01bf02b74f0922f43b0e175d734b3602cba/android/src/main/java/com/showlocationservicesdialogbox/LocationServicesDialogBoxModule.java#L121

TJBlack31 commented 6 years ago

@maggialejandro

I'm not too familiar with react native, but after looking at your manifest, it doesn't appear there's any mention of other activities.

I'm not set up for react native environment, but if I was, I would try adding something like this:

<activity android:name=".YourActivity">
    <intent-filter>
        <action android:name="android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

Either way, I'd double check your manifest

cheers

-TJB