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

TLIB.02-Solution-DetectFaces #23

Open
wants to merge 1 commit into
base: TLIB.02-Exercise-DetectFaces
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Aug 31, 2017

No description provided.

@kahraman-mustafa
Copy link

kahraman-mustafa commented Aug 5, 2018

Hi, I have gotten two error while working on this branch and found solutions from stackoverflow. Maybe some other one faces the same problem, I want to share my solutions. My emulator is my own phone running Android 4.4.2. The logcat error and the corresponding solutions are like the below:

ERROR 1: java.lang.SecurityException: Permission Denial: opening provider android.support.v4.content.FileProvider from ProcessRecord ...
SOLUTION 1 (FROM): https://stackoverflow.com/questions/24467696/android-file-provider-permission-denial . Applying the solution from the link as in the below in the launchCamera() method in the MainActivity.java:

takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);

// Solution is found in stackoverflow "https://stackoverflow.com/questions/24467696/android-file-provider-permission-denial"
List<ResolveInfo> resInfoList = this.getPackageManager().queryIntentActivities(takePictureIntent, PackageManager.MATCH_DEFAULT_ONLY);
for (ResolveInfo resolveInfo : resInfoList) {
   String packageName = resolveInfo.activityInfo.packageName;
   this.grantUriPermission(packageName, photoURI, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
}

// Launch the camera activity
startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);

Answer by https://stackoverflow.com/users/1069884/limlim

ERROR 2: android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection ...
SOLUTION 2 (FROM): https://stackoverflow.com/questions/13765122/android-emulator-spams-logcat-with-service-com-android-exchange-exchangeservice .

A simpler fix is to disable "Exchange Services" in the emulated device under Settings : Apps : All (you may need to swipe over to see the "All" tab)
Answer by https://stackoverflow.com/users/42619/nuthatch

ADDITION: I have also noticed that it is required to rotate my device 90 degree reverse clockwise when taking photo in order to get true portrait image and be the face detected. Otherwise the face is not detected.

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

Successfully merging this pull request may close these issues.

2 participants