AndroidUSBCamera icon indicating copy to clipboard operation
AndroidUSBCamera copied to clipboard

Play store release minimum targetSdkVersion 31.

Open GopalLR opened this issue 2 years ago • 4 comments

As per the latest google play store policy minimum targetSdkVersion is API level 31 but I'm not able to run app by using this API level so how can i fix this issue ?

GopalLR avatar Mar 23 '23 06:03 GopalLR

Is maybe a problem of "mutable flag" stuff? I had the same issue, but i've solved it

ghost avatar Mar 23 '23 09:03 ghost

How you solved it ?

GopalLR avatar Mar 23 '23 12:03 GopalLR

As per the latest google play store policy minimum targetSdkVersion is API level 31 but I'm not able to run app by using this API level so how can i fix this issue ?

which version, the newest version opt like this:

	public synchronized void register() throws IllegalStateException {
		if (destroyed) throw new IllegalStateException("already destroyed");
		if (mPermissionIntent == null) {
			if (DEBUG) XLogWrapper.i(TAG, "register:");
			final Context context = mWeakContext.get();
			if (context != null) {
				if (Build.VERSION.SDK_INT >= 31) {
					// avoid acquiring intent data failed in receiver on Android12
					// when using PendingIntent.FLAG_IMMUTABLE
					// because it means Intent can't be modified anywhere -- jiangdg/20220929
					int PENDING_FLAG_IMMUTABLE = 1<<25;
					mPermissionIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), PENDING_FLAG_IMMUTABLE);
				} else {
					mPermissionIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), 0);
				}
				final IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
				// ACTION_USB_DEVICE_ATTACHED never comes on some devices so it should not be added here
				filter.addAction(ACTION_USB_DEVICE_ATTACHED);
				filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
				context.registerReceiver(mUsbReceiver, filter);
			}
			// start connection check
			mDeviceCounts = 0;
			mAsyncHandler.postDelayed(mDeviceCheckRunnable, 1000);
		}
	}

jiangdongguo avatar Mar 28 '23 01:03 jiangdongguo

@jiangdongguo Still unable to access the usb camera in devices with sdk 29 and below, if targetSdk is set to 31.

ravijadav812 avatar Jun 06 '23 12:06 ravijadav812