Closed SebiderSushi closed 4 years ago
@Electric1447 I don't see anything wrong with the XML or the code. Could this be an androidx bug?
Possibly, however location should never be disabled.
@SebiderSushi try to hardcode the layouts height and see if it crashes
Yes it does not happen when hardcoding the layout height. Was anyone else able to reproduce this as well?
As per the code, Android Studio itself successfully resolves the values for the dimens resources as well here on my side so that should probably not be the issue.
Yes it does not happen when hardcoding the layout height. Was anyone else able to reproduce this as well?
No
The weirdest part is that you use an Lineage based roms so these things should not happen
Android at its finest. I'm fine with hardcoding those sizes but I can't find anyone with this issue online, it's kinda weird.
@adolfintel I really thing we should compile a list of bugs relating to the Android OS and report them to Google
As per the code, Android Studio itself successfully resolves the values for the dimens resources as well here on my side so that should probably not be the issue.
I didn't quite understand what you mean in here could you please elaborate?
@adolfintel I really thing we should compile a list of bug relating to the Android OS and report them to Google
Yeah, probably. I will be abandoning android as soon as linux phones are viable though. I've been developing on android since 2012 and it's been nothing but trouble.
As per the code, Android Studio itself successfully resolves the values for the dimens resources as well here on my side so that should probably not be the issue.
I didn't quite understand what you mean in here could you please elaborate?
I think he means that android studio displays width and height correctly (grabs them from dimens.xml), but for some reason the app itself does not. Decompiling the APK might give us a clue about what's going on.
Jadx-gui is the best decompilation tool for Android
I decompiled the app and everything seems fine
Maybe try to change the layout height of the textview to be the same as his parent?
I don't know, it points at line 2, that's the RelativeLayout tag. Maybe we could try another type of layout. This notification is so simple, any layout would be fine.
From the log 0x7f050065
is noti_location_small_height
and 0x7f050064
is noti_location_big_height
@SebiderSushi do you have any theme installation (Layers, substratum, ect)?
Context: https://reddit.com/r/Nexus6P/comments/4doysy/if_you_are_still_using_inversion_ui_or_any_layers
I don't know, it points at line 2, that's the RelativeLayout tag. Maybe we could try another type of layout. This notification is so simple, any layout would be fine.
ConstraintLayout?
That should be perfectly fine
@SebiderSushi do you have any theme installation (Layers, substratum, ect)?
Context: https://reddit.com/r/Nexus6P/comments/4doysy/if_you_are_still_using_inversion_ui_or_any_layers
Not that i know of. If yes, then it would have to be something preinstalled.
And for the following observation stated in the reddit post:
But the resource would change around every minute and the index along with that
I just reproduced the crash and the resource identifier hex values and indexes are the same as in the logcat i posted in my OP.
Could you change RelativeLayout to ConstraintLayout and retest?
No i don't like ConstraintLayout i'm a LinearLayout guy.
Okay jokes aside, i can reproduce the crash with both ConstraintLayout and LinearLayout as well.
@Electric1447 I think the best way to workaround this problem at the moment is to hardcode width and height in the notifications (all variants). I would also like to try to get rid of androidx to see if that's the cause of the problem. It's just an experiment and I'll do it myself.
I am pretty sure we cannot hardcode width with notifications, and we should test if that is really the issue
Pretty sure this doesn't releate to jetpack (androidx) as they did not change RelativeLayout and TextView
@SebiderSushi send me the link to the XDA thread of your rom although I highly doubt that's the issue
Yeah, you're right, only the height needs to be hardcoded. The width is determined automatically.
https://developer.android.com/training/notify-user/custom-notification trying to dig in here to see if something is related to this
strange tidbit: if i mangle the Main Activity like so, the layout works just fine even with dynamic dimens:
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.location_disabled_small);
}
@SebiderSushi send me the link to the XDA thread of your rom although I highly doubt that's the issue
The ResurrectionRemix 7.0.2 ROM is: https://forum.xda-developers.com/xiaomi-redmi-4x/development/rom-unofficial-resurrection-remix-t3912521
The LineageOS 15.1 ROM is actually self-build, with a few modifcations.
I'll try with official LineageOS 16.0 and maybe a few other ROMs.
@SebiderSushi send me the link to the XDA thread of your rom although I highly doubt that's the issue
The ResurrectionRemix 7.0.2 ROM is: https://forum.xda-developers.com/xiaomi-redmi-4x/development/rom-unofficial-resurrection-remix-t3912521
The LineageOS 15.1 ROM is actually self-build, with a few modifcations.
I'll try with official LineageOS 16.0 and maybe a few other ROMs.
LuisROM is stable so that's not relevant.
At least we got that out of the way
This is a shot in the dark but try to change noti_location_small_height
to 64dp
Here's a test APK without androidx. The layout will be all fucked up. If this version works, I'll fix it. app-release.zip
This is a shot in the dark but try to change
noti_location_small_height
to 64dp
Can still reproduce the bug with that...
Here's a test APK without androidx. The layout will be all fucked up. If this version works, I'll fix it. app-release.zip
This one still crashed as soon as i disable location, same error : /
06-16 17:20:23.861 1454 1454 E StatusBar: couldn't inflate view for notification com.dosse.airpods/0x1
06-16 17:20:23.861 1454 1454 E StatusBar: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: You must supply a layout_height attribute.
06-16 17:20:23.861 1454 1454 E StatusBar: Caused by: java.lang.UnsupportedOperationException: Binary XML file line #2: You must supply a layout_height attribute.
Good to know, it would have been quite annoying if androidx was the cause. @Electric1447 Let's just hardcode the height of all notifications, ok?
What a ride... :D
wait it doesnt crashes when hardcoded?
This is exactly why I hate android development. I swear, every single API in that fucking system is broken on at least 1 phone
And not to forget the system upgrade model...
Yes it does not happen when hardcoding the layout height.
@Electric1447
ok
I'll make a commit
Since i tested this now, i'm still gonna state for the record that the crash also appeared with the official lineage-16.0-20200610-nightly-santoni-signed.zip
.
Thanks for fixing and for investing yourself so much into this issue :)
I am experiencing a strange crash when location is disabled.
It seems as if the new dimens resource is unavailable. I can reproduce this isse when building from revision f6a39854afcd1463badea8f91f671787d3064f35 with AndroidStudio as well.
App version: 1.4 (F-Droid); version 1.3 is unaffected. Device: Xiaomi Redmi 4X ROM: Lineage 15.1 (Oreo), ResurrectionRemix 7.0.2 (Pie)
Logcat
``` 06-16 04:08:20.327 1439 4218 W ResourceType: For resource 0x7f050064, entry index(100) is beyond type entryCount(62) 06-16 04:08:20.327 1439 4218 W ResourceType: Failure getting entry for 0x7f050064 (t=4 e=100) (error -75) 06-16 04:08:20.327 1439 4216 W ResourceType: For resource 0x7f050065, entry index(101) is beyond type entryCount(62) 06-16 04:08:20.327 1439 4216 W ResourceType: Failure getting entry for 0x7f050065 (t=4 e=101) (error -75) 06-16 04:08:20.329 1439 1439 W ResourceType: For resource 0x7f050064, entry index(100) is beyond type entryCount(62) 06-16 04:08:20.329 1439 1439 W ResourceType: Failure getting entry for 0x7f050064 (t=4 e=100) (error -75) 06-16 04:08:20.330 1439 1439 E StatusBar: couldn't inflate view for notification com.dosse.airpods/0x1 06-16 04:08:20.330 1439 1439 E StatusBar: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: You must supply a layout_height attribute. 06-16 04:08:20.330 1439 1439 E StatusBar: Caused by: java.lang.UnsupportedOperationException: Binary XML file line #2: You must supply a layout_height attribute. 06-16 04:08:20.330 1439 1439 E StatusBar: at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:775) 06-16 04:08:20.330 1439 1439 E StatusBar: at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:7555) 06-16 04:08:20.330 1439 1439 E StatusBar: at android.view.ViewGroup$MarginLayoutParams.