Could not get unknown property ‘manifestOutputDirectory’

I encountered this same issue today, in my case it was caused by an outdated version of Huawei’s AG Connect plugin. I was using com.huawei.agconnect:agcp:1.2.1.301, but when I updated it to com.huawei.agconnect:agcp:1.4.1.300 the issue was fixed. See Latest Huawei’s AG Connect plugin here: https://developer.huawei.com/latest/plugin/agconnect …Just scroll, you’ll find it there haha! But if Huawei’s plugin … Read more

FileProvider getUriForFile() error on Huawei devices

Update for Android N (leaving the original answer below and have confirmed this new approach works in production): As you noted in your update, many Huawei device models (e.g. KIW-L24, ALE-L21, ALE-L02, PLK-L01, and a variety of others) break the Android contract for calls to ContextCompat#getExternalFilesDirs(String).
 Rather than returning Context#getExternalFilesDir(String) (ie the default entry) as … Read more

How to create Huawei Android Emulator

Huawei provides cloud debugging functionality for Huawei developers as a free service. If you use Huawei SDKs, you should have Huawei Developer Account. Just need to login Huawei developer console and follow below instruction; Enables real-time debugging of apps on remote Android devices. Service Introduction For details about how to use Cloud Debugging in your … Read more

Have both GMS and HMS in the project

So, I managed to do it like this: Defined two flavours gms { dimension “services” buildConfigField “String”, “SERVICE_USED”, ‘”g”‘ } hms { dimension “services” buildConfigField “String”, “SERVICE_USED”, ‘”h”‘ } I use the “g” and “h” in the code whenever I need to decide on doing things like: the API requires a deviceType of “android” or … Read more

“Protected Apps” setting on Huawei phones, and how to handle it

There isn’t a setting in the manifest, and Huawei has enabled Tinder because it’s a popular app. There isn’t a way to know if apps are protected. Anyway I used ifHuaweiAlert() in onCreate() to show an AlertDialog: private void ifHuaweiAlert() { final SharedPreferences settings = getSharedPreferences(“ProtectedApps”, MODE_PRIVATE); final String saveIfSkip = “skipProtectedAppsMessage”; boolean skipMessage = … Read more

Huawei, logcat not showing the log for my app?

OK, since I had another Huawei Ascend I ran into the same problem. This time I have the exact answer. Follow these instructions (from denispyr’s answer on Why doesn’t logcat show anything in my Android?) Dial *#*#2846579#*#* and you will see a hidden menu. Go to the Project Menu > Background Setting > Log setting … Read more