Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no permission prompts when calling startGeofences #1867

Closed
viljark opened this issue Oct 31, 2023 · 11 comments
Closed

no permission prompts when calling startGeofences #1867

viljark opened this issue Oct 31, 2023 · 11 comments

Comments

@viljark
Copy link

viljark commented Oct 31, 2023

Your Environment

  • Plugin version: 4.14.3
  • Platform: Android
  • OS version: 14
  • Device manufacturer / model: Google Pixel 6 Pro
  • React Native version (react-native -v): 0.72.6,
  • Expo version: 49.0.16
  • Plugin config
	const defaultConfig: Config = {
		geofenceModeHighAccuracy: false,
		enableHeadless: true,
		stopOnTerminate: false,
		startOnBoot: true,
		geofenceInitialTriggerEntry: false,
		notification: {
			smallIcon: 'notification_icon',
		},
		logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
	}

Expected Behavior

Application should ask background location permissions when BackgroundGeolocation.startGeofences is called.

Actual Behavior

	const defaultConfig: Config = {
		geofenceModeHighAccuracy: false,
		enableHeadless: true,
		stopOnTerminate: false,
		startOnBoot: true,
		geofenceInitialTriggerEntry: false,
		notification: {
			smallIcon: 'notification_icon',
		},
		logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
	}
	await BackgroundGeolocation.ready(defaultConfig)
	try {
		const status = await BackgroundGeolocation.startGeofences(
			(state) => {
				console.log('successfully started')
			},
			(e) => {
				console.error('failed to start', e)
			},
		)
		console.log('status', status)
	} catch (e) {
		console.error(e)
	}

results in ReactNativeJS: 'failed to start', 'Permission denied', no permission dialogs shown at all.

Calling
const permission = await BackgroundGeolocation.requestPermission()
results in 2, meaning BackgroundGeolocation.AUTHORIZATION_STATUS_DENIED

Steps to Reproduce

  1. set up the config and call BackgroundGeolocation.startGeofences

Context

Even when I ask permissions with expo-locations, for foreground and background location, calling BackgroundGeolocation.requestPermission() still returns 2.
This issue also occurs without expo-locations package being installed.

Let me know if you need some more info.

Debug logs

Logs
10-31 16:01:20.279 28299 28419 I ReactNativeJS: Running "main
10-31 16:01:26.901 28299 28486 E TSLocationManager: ╔═════════════════════════════════════════════
10-31 16:01:26.901 28299 28486 E TSLocationManager: ║ LICENSE VALIDATION FAILURE: com.my.app
10-31 16:01:26.901 28299 28486 E TSLocationManager: ╠═════════════════════════════════════════════
10-31 16:01:26.901 28299 28486 E TSLocationManager: ╟─ Invalid license key: UNDEFINED
10-31 16:01:26.901 28299 28486 E TSLocationManager: ╟─ BackgroundGeolocation is fully functional in DEBUG builds without a license so you can 'try before you buy'.
10-31 16:01:26.901 28299 28486 E TSLocationManager: ╚═════════════════════════════════════════════
10-31 16:01:28.507 28299 28493 I ReactNativeJS: Running "main" with {"rootTag":31}
10-31 16:01:37.475 28299 28493 E ReactNativeJS: 'failed to start', 'Permission denied'
@christocracy
Copy link
Member

You are not showing any call to .ready(config).

You must wait until .ready(config) resolves before calling .start() / .startGeofences()

@viljark
Copy link
Author

viljark commented Oct 31, 2023

You are not showing any call to .ready(config).

You must wait until .ready(config) resolves before calling .start() / .startGeofences()

I updated the code examples.

@christocracy
Copy link
Member

Are you attempting to launch a release build without a license key?

@viljark
Copy link
Author

viljark commented Oct 31, 2023

I'm running expo development build (which is a Debug build): https://docs.expo.dev/develop/development-builds/introduction/

I'll try a release build with licence key to see if behaves differently.

Also same code used to work with 4.12.1, on Android 13 and Expo SDK 48 (I have some additional dependencies added).
But I'm also seeing same issue on Android 10, I'll see if 4.12.1 still works for me or it might be Expo SDK49 development client issue.

@christocracy
Copy link
Member

I suggest you observe unfiltered adb logcat for other errors.

@viljark
Copy link
Author

viljark commented Oct 31, 2023

In the logs it looks like it triggers some kind of permission request, but I think it is closed immediately.

Logs
10-31 16:24:19.439  4574  5312 D ModemODPMPoller: Current Modem ODPM (mw): 109, threshold: 800
10-31 16:24:19.827 28299 28493 I ReactNativeJS: 'geofenceEnabled change', { geofenceModeHighAccuracy: false }
10-31 16:24:19.827 28299 28493 I ReactNativeJS: enable geo
10-31 16:24:19.828 28299 28493 I ReactNativeJS: bg location configured
10-31 16:24:19.885  1717  5190 E Transition: Trying to add a ready-group twice: Display{#0 state=ON size=1440x3120 ROTATION_0}
10-31 16:24:19.886  1717  5190 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.google.android.permissioncontroller cmp=com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity (has extras)} with LAUNCH_MULTIPLE from uid 10518 (BAL_ALLOW_VISIBLE_WINDOW) result code=0
10-31 16:24:19.886  2463  2501 V WindowManagerShell: Transition requested: android.os.BinderProxy@7ab0ad7 TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=47309 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.remato.sm.dev/.MainActivity } baseActivity=ComponentInfo{com.remato.sm.dev/com.remato.sm.dev.MainActivity} topActivity=ComponentInfo{com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} origActivity=null realActivity=ComponentInfo{com.remato.sm.dev/com.remato.sm.dev.MainActivity} numActivities=2 lastActiveTime=4761700 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@a6b4fc4} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 145 - 0, 0) topActivityInfo=ActivityInfo{796dead com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false topActivityLetterboxed= false isFromDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}, remoteTransition = null, displayChange = null }
10-31 16:24:19.891  1291  1971 D usf_sensor_hal: accelerometer: Enter Batch. period = 15000000, latency = 0.
10-31 16:24:19.891  1291  1971 D usf_sensor_hal: IMU temperature: Enter Batch. period = 615385000, latency = 0.
10-31 16:24:19.891   602   602 I BpBinder: onLastStrongRef automatically unlinking death recipients:
10-31 16:24:19.891 28299 28299 D ReactNativeNfcManager: onPause
10-31 16:24:19.891 28299 28299 I ReactNativeNfcManager: enableForegroundDispatch, enable = false
10-31 16:24:19.895 28299 28493 I ReactNativeJS: 'Pixel 6 Pro ::', 'App state changed', 'background'
10-31 16:24:19.896  1717  5196 D ActivityManager: quick sync unfreeze 2479 for 1
10-31 16:24:19.897  1717  1965 D ActivityManager: sync unfroze 2479 com.google.android.permissioncontroller for 1
10-31 16:24:19.907  7206  8217 E msys    : E[N mns]_OnTimerExpired(375)=>ngtcp2_conn_handle_expiry: ERR_IDLE_CLOSE
10-31 16:24:19.907  1717  2194 D ActivityManager: sync unfroze 7206 com.instagram.android for 6
10-31 16:24:19.912 28299 32402 D TrafficStats: tagSocket(126) with statsTag=0xffffffff, statsUid=-1
10-31 16:24:19.917 28299 28475 D TrafficStats: tagSocket(126) with statsTag=0xffffffff, statsUid=-1
10-31 16:24:19.920 28299 32404 D TrafficStats: tagSocket(126) with statsTag=0xffffffff, statsUid=-1
10-31 16:24:19.953  1717  5196 D CoreBackPreview: Window{fc3c106 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@f0fddf4, mPriority=0, mIsAnimationCallback=false}
10-31 16:24:19.961  1717  1962 W ziparchive: Unable to open '/apex/com.android.permission/priv-app/GooglePermissionController@341011020/GooglePermissionController.dm': No such file or directory
10-31 16:24:19.961  1717  1962 W ziparchive: Unable to open '/apex/com.android.permission/priv-app/GooglePermissionController@341011020/GooglePermissionController.dm': No such file or directory
10-31 16:24:19.962  2463  2501 V WindowManagerShell: onTransitionReady android.os.BinderProxy@7ab0ad7: {id=150 t=OPEN f=0x0 trk=0 r=[0@Point(0, 0)] c=[{null m=OPEN f=TRANSLUCENT|FILLS_TASK leash=Surface(name=ActivityRecord{3fd1973 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity)/@0x9e3b5e2 sb=Rect(0, 0 - 0, 0) eb=Rect(0, 0 - 1440, 3120) d=-1->0 r=-1->0:-1}]}
10-31 16:24:19.962  2463  2501 V WindowManagerShell: Playing animation for (#150)android.os.BinderProxy@7ab0ad7@0
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.transition.DefaultMixedHandler@8b0fed4
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.keyguard.KeyguardTransitionHandler@cf9487d
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.activityembedding.ActivityEmbeddingController@7e82372
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.recents.RecentsTransitionHandler@4d003c3
10-31 16:24:19.962  2463  2501 V ShellRecents: RecentsTransitionHandler.startAnimation: no controller found
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.pip.PipTransition@9893440
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.splitscreen.StageCoordinator@6d6ef79
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.transition.RemoteTransitionHandler@71104be
10-31 16:24:19.962  2463  2501 V WindowManagerShell: Transition doesn't have explicit remote, search filters for match for {id=150 t=OPEN f=0x0 trk=0 r=[0@Point(0, 0)] c=[{null m=OPEN f=TRANSLUCENT|FILLS_TASK leash=Surface(name=ActivityRecord{3fd1973 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity)/@0x9e3b5e2 sb=Rect(0, 0 - 0, 0) eb=Rect(0, 0 - 1440, 3120) d=-1->0 r=-1->0:-1}]}
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  Checking filter Pair{{types=[] flags=0x0] notFlags=0x0 checks=[{atype=dream independent=true modes=[OPEN,TO_FRONT] flags=NONE mustBeTask=false order=ANY topActivity=null},{atype=home independent=true modes=[CLOSE,TO_BACK] flags=NONE mustBeTask=false order=ANY topActivity=null}]} RemoteTransition { remoteTransition = android.window.IRemoteTransition$Stub$Proxy@d33e324, appThread = android.app.IApplicationThread$Stub$Proxy@24de8d, debugName = LauncherToDream }}
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  Checking filter Pair{{types=[] flags=0x0] notFlags=0x100 checks=[{atype=home independent=true modes=[OPEN,TO_FRONT] flags=NONE mustBeTask=false order=TOP topActivity=ComponentInfo{com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity}},{atype=standard independent=true modes=[CLOSE,TO_BACK] flags=NONE mustBeTask=false order=ANY topActivity=null}]} RemoteTransition { remoteTransition = android.window.IRemoteTransition$Stub$Proxy@98fe842, appThread = android.app.IApplicationThread$Stub$Proxy@163053, debugName = QuickstepLaunchHome }}
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  Delegate animation for #150 to null
10-31 16:24:19.962  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.transition.DefaultTransitionHandler@aa5191f
10-31 16:24:19.962  2463  2501 V WindowManagerShell: start default transition animation, info = {id=150 t=OPEN f=0x0 trk=0 r=[0@Point(0, 0)] c=[{null m=OPEN f=TRANSLUCENT|FILLS_TASK leash=Surface(name=ActivityRecord{3fd1973 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity)/@0x9e3b5e2 sb=Rect(0, 0 - 0, 0) eb=Rect(0, 0 - 1440, 3120) d=-1->0 r=-1->0:-1}]}
10-31 16:24:19.962  2463  2501 V WindowManagerShell: loadAnimation: anim=null animAttr=0x4 type=OPEN isEntrance=true
10-31 16:24:19.963  1717  1962 I ActivityTaskManager: Displayed com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity for user 0: +82ms
10-31 16:24:19.963  1717  1962 V WindowManager: Sent Transition #150 createdAt=10-31 16:24:19.878 via request=TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=47309 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.remato.sm.dev/.MainActivity } baseActivity=ComponentInfo{com.remato.sm.dev/com.remato.sm.dev.MainActivity} topActivity=ComponentInfo{com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} origActivity=null realActivity=ComponentInfo{com.remato.sm.dev/com.remato.sm.dev.MainActivity} numActivities=2 lastActiveTime=4761700 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{646ff Task{3441e88 #47309 type=standard A=10518:com.remato.sm.dev}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 145 - 0, 0) topActivityInfo=ActivityInfo{824f78c com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false topActivityLetterboxed= false isFromDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}, remoteTransition = null, displayChange = null }
10-31 16:24:19.963  1717  1962 V WindowManager:     startWCT=WindowContainerTransaction { changes = {} hops = [] errorCallbackToken=null taskFragmentOrganizer=null }
10-31 16:24:19.963  1717  1962 V WindowManager:     info={id=150 t=OPEN f=0x0 trk=0 r=[0@Point(0, 0)] c=[{null m=OPEN f=TRANSLUCENT|FILLS_TASK leash=Surface(name=ActivityRecord{3fd1973 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity)/@0xd531a19 sb=Rect(0, 0 - 0, 0) eb=Rect(0, 0 - 1440, 3120) d=-1->0 r=-1->0:-1}]}
10-31 16:24:19.963  2463  2501 V WindowManagerShell: Transition animation finished (aborted=false), notifying core (#150)android.os.BinderProxy@7ab0ad7@0
10-31 16:24:19.966  1717  1962 V WindowManager: Finish Transition #150: created at 10-31 16:24:19.878 collect-started=0.039ms request-sent=7.384ms started=8.336ms ready=18.908ms sent=82.324ms finished=87.457ms
10-31 16:24:19.967  2463  2501 V WindowManagerShell: Track 0 became idle
10-31 16:24:19.967  2463  2501 V WindowManagerShell: All active transition animations finished
10-31 16:24:19.967  2463  2501 V WindowManagerShell:  animated by com.android.wm.shell.transition.DefaultTransitionHandler@aa5191f
10-31 16:24:19.967  2463  2501 V WindowManagerShell: Track 0 became idle
10-31 16:24:19.967  2463  2501 V WindowManagerShell: All active transition animations finished
10-31 16:24:19.976  2463  2501 V WindowManagerShell: Transition requested: android.os.BinderProxy@50b4e2e TransitionRequestInfo { type = CLOSE, triggerTask = null, remoteTransition = null, displayChange = null }
10-31 16:24:19.980  1717  4489 I ImeTracker: com.google.android.permissioncontroller:1b72cde2: onRequestHide at ORIGIN_SERVER_HIDE_INPUT reason HIDE_ALWAYS_HIDDEN_STATE
10-31 16:24:19.981  1717  4489 I ImeTracker: com.google.android.permissioncontroller:1b72cde2: onCancelled at PHASE_SERVER_SHOULD_HIDE
10-31 16:24:19.982  4237  4237 I GoogleInputMethodService: GoogleInputMethodService.onFinishInput():3260
10-31 16:24:19.983  4237  4237 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2103 repeatCheckTimes = 0, locked = false
10-31 16:24:19.983  4237  4237 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1894 onStartInput(EditorInfo{EditorInfo{packageName=com.google.android.permissioncontroller, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=0, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false)
10-31 16:24:19.983  4237  4237 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2103 repeatCheckTimes = 1, locked = false
10-31 16:24:19.996  1717  1962 V WindowManager: Sent Transition #151 createdAt=10-31 16:24:19.976 via request=TransitionRequestInfo { type = CLOSE, triggerTask = null, remoteTransition = null, displayChange = null }
10-31 16:24:19.996  1717  1962 V WindowManager:     startWCT=WindowContainerTransaction { changes = {} hops = [] errorCallbackToken=null taskFragmentOrganizer=null }
10-31 16:24:19.996  1717  1962 V WindowManager:     info={id=151 t=CLOSE f=0x0 trk=0 r=[0@Point(0, 0)] c=[{null m=CLOSE f=TRANSLUCENT|FILLS_TASK leash=Surface(name=ActivityRecord{3fd1973 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity)/@0xd531a19 sb=Rect(0, 0 - 1440, 3120) eb=Rect(0, 0 - 1440, 3120) d=0}]}
10-31 16:24:19.996  2463  2501 V WindowManagerShell: onTransitionReady android.os.BinderProxy@50b4e2e: {id=151 t=CLOSE f=0x0 trk=0 r=[0@Point(0, 0)] c=[{null m=CLOSE f=TRANSLUCENT|FILLS_TASK leash=Surface(name=ActivityRecord{3fd1973 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity)/@0xd367dcf sb=Rect(0, 0 - 1440, 3120) eb=Rect(0, 0 - 1440, 3120) d=0}]}
10-31 16:24:19.996  2463  2501 V WindowManagerShell: Playing animation for (#151)android.os.BinderProxy@50b4e2e@0
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.transition.DefaultMixedHandler@8b0fed4
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.keyguard.KeyguardTransitionHandler@cf9487d
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.activityembedding.ActivityEmbeddingController@7e82372
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.recents.RecentsTransitionHandler@4d003c3
10-31 16:24:19.996  2463  2501 V ShellRecents: RecentsTransitionHandler.startAnimation: no controller found
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.pip.PipTransition@9893440
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.splitscreen.StageCoordinator@6d6ef79
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.transition.RemoteTransitionHandler@71104be
10-31 16:24:19.996  2463  2501 V WindowManagerShell: Transition doesn't have explicit remote, search filters for match for {id=151 t=CLOSE f=0x0 trk=0 r=[0@Point(0, 0)] c=[{null m=CLOSE f=TRANSLUCENT|FILLS_TASK leash=Surface(name=ActivityRecord{3fd1973 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity)/@0xd367dcf sb=Rect(0, 0 - 1440, 3120) eb=Rect(0, 0 - 1440, 3120) d=0}]}
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  Checking filter Pair{{types=[] flags=0x0] notFlags=0x0 checks=[{atype=dream independent=true modes=[OPEN,TO_FRONT] flags=NONE mustBeTask=false order=ANY topActivity=null},{atype=home independent=true modes=[CLOSE,TO_BACK] flags=NONE mustBeTask=false order=ANY topActivity=null}]} RemoteTransition { remoteTransition = android.window.IRemoteTransition$Stub$Proxy@d33e324, appThread = android.app.IApplicationThread$Stub$Proxy@24de8d, debugName = LauncherToDream }}
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  Checking filter Pair{{types=[] flags=0x0] notFlags=0x100 checks=[{atype=home independent=true modes=[OPEN,TO_FRONT] flags=NONE mustBeTask=false order=TOP topActivity=ComponentInfo{com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity}},{atype=standard independent=true modes=[CLOSE,TO_BACK] flags=NONE mustBeTask=false order=ANY topActivity=null}]} RemoteTransition { remoteTransition = android.window.IRemoteTransition$Stub$Proxy@98fe842, appThread = android.app.IApplicationThread$Stub$Proxy@163053, debugName = QuickstepLaunchHome }}
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  Delegate animation for #151 to null
10-31 16:24:19.996  1291  1971 D usf_sensor_hal: accelerometer: Enter Flush
10-31 16:24:19.996  2463  2501 V WindowManagerShell:  try handler com.android.wm.shell.transition.DefaultTransitionHandler@aa5191f
10-31 16:24:19.996  2463  2501 V WindowManagerShell: start default transition animation, info = {id=151 t=CLOSE f=0x0 trk=0 r=[0@Point(0, 0)] c=[{null m=CLOSE f=TRANSLUCENT|FILLS_TASK leash=Surface(name=ActivityRecord{3fd1973 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity)/@0xd367dcf sb=Rect(0, 0 - 1440, 3120) eb=Rect(0, 0 - 1440, 3120) d=0}]}
10-31 16:24:19.996  2463  2501 V WindowManagerShell: loadAnimation: anim=null animAttr=0x7 type=CLOSE isEntrance=false
10-31 16:24:19.997  2463  2501 V WindowManagerShell: Transition animation finished (aborted=false), notifying core (#151)android.os.BinderProxy@50b4e2e@0
10-31 16:24:19.997  1717  1962 V WindowManager: Finish Transition #151: created at 10-31 16:24:19.976 collect-started=0.116ms request-sent=0.197ms started=4.072ms ready=16.059ms sent=19.368ms finished=21.366ms
10-31 16:24:19.999 28299 28299 D ReactNativeNfcManager: onResume
10-31 16:24:20.000  2463  2501 V WindowManagerShell: Track 0 became idle
10-31 16:24:20.000  2463  2501 V WindowManagerShell: All active transition animations finished
10-31 16:24:20.000  2463  2501 V WindowManagerShell:  animated by com.android.wm.shell.transition.DefaultTransitionHandler@aa5191f
10-31 16:24:20.000  2463  2501 V WindowManagerShell: Track 0 became idle
10-31 16:24:20.000  2463  2501 V WindowManagerShell: All active transition animations finished
10-31 16:24:20.005 28299 32407 D TrafficStats: tagSocket(126) with statsTag=0xffffffff, statsUid=-1
10-31 16:24:20.007  2479  2479 W WindowOnBackDispatcher: sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda17@ceea224
10-31 16:24:20.007  1717  5164 D CoreBackPreview: Window{fc3c106 u0 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity}: Setting back callback null
10-31 16:24:20.008  1717  5164 W InputManager-JNI: Input channel object 'fc3c106 com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity (client)' was disposed without first being removed with the input manager!
10-31 16:24:20.024  1717  5182 I ImeTracker: com.remato.sm.dev:4044199c: onRequestHide at ORIGIN_SERVER_HIDE_INPUT reason HIDE_UNSPECIFIED_WINDOW
10-31 16:24:20.024  1717  5182 I ImeTracker: com.remato.sm.dev:4044199c: onCancelled at PHASE_SERVER_SHOULD_HIDE
10-31 16:24:20.026  4237  4237 I GoogleInputMethodService: GoogleInputMethodService.onFinishInput():3260
10-31 16:24:20.026  4237  4237 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2103 repeatCheckTimes = 0, locked = false
10-31 16:24:20.027  4237  4237 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1894 onStartInput(EditorInfo{EditorInfo{packageName=com.remato.sm.dev, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=0, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false)
10-31 16:24:20.027  4237  4237 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2103 repeatCheckTimes = 1, locked = false
10-31 16:24:20.183 28299 28493 I Choreographer: Skipped 34 frames!  The application may be doing too much work on its main thread.
10-31 16:24:20.211  2479  2491 W ssioncontroller: Reducing the number of considered missed Gc histogram windows from 136 to 100
10-31 16:24:20.221 28299 32408 D TrafficStats: tagSocket(125) with statsTag=0xffffffff, statsUid=-1
10-31 16:24:20.373 28299 28493 I ReactNativeJS: 'Pixel 6 Pro ::', 'App state changed', 'active'
10-31 16:24:20.444  4574  5312 D ModemODPMPoller: Current Modem ODPM (mw): 105, threshold: 800
10-31 16:24:20.603 28299 28493 I Choreographer: Skipped 50 frames!  The application may be doing too much work on its main thread.
10-31 16:24:20.639 28299 28494 E com.remato.sm.dev: failed to start Permission denied

@viljark viljark changed the title no permission prompts when calling startGeofences in Android 14 no permission prompts when calling startGeofences Oct 31, 2023
@christocracy
Copy link
Member

I have no idea what your problem is and none of those logs reference anything from the plug-in.

I suggest you experiment with the plug-in in a fresh new HelloWorld app.

@viljark
Copy link
Author

viljark commented Oct 31, 2023

Everything works as expected in release build.

It seems that expo development build which used to be a debug build before, does not work anymore without a license
It is build with gradlew :app:assembleDebug, so I'm not sure why debug build is not detected and license is required.

Looks like react-native-background-geolocation thinks it is release build.

Running 'gradlew :app:assembleDebug' in /home/expo/workingdir/build/android

> Configure project :app

 ℹ️  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' ([email protected])

 ℹ️  Applying gradle plugin 'expo-updates-gradle-plugin' ([email protected])

Minifying disabled for variant debug, no upload task created

[react-native-background-geolocation] Purging debug resources in release build

Minifying disabled for variant release, no upload task created

@christocracy
Copy link
Member

You will have to consult with Expo docs to figure out why you're not getting a debug build.

@viljark
Copy link
Author

viljark commented Oct 31, 2023

What flag is used internally to detect debug build by react-native-background-geolocation?
BuildConfig.DEBUG?

nevermind, found it

        if (variant.buildType.name == "release") {
            println("[react-native-background-geolocation] Purging debug resources in release build")
            variant.mergeResourcesProvider.configure {
                doLast {
                    delete(fileTree(dir: outputDir, includes: ["raw_tslocationmanager*"]))
                }
            }
        }

@viljark
Copy link
Author

viljark commented Nov 2, 2023

Consulted with Expo team member, and the debug build is created as expected with gradlew :app:assembleDebug expo/eas-cli#2105 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants