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

Build warnings: 'string too large to encode using UTF-8...' #93

Closed
maniac103 opened this issue Jun 24, 2019 · 7 comments
Closed

Build warnings: 'string too large to encode using UTF-8...' #93

maniac103 opened this issue Jun 24, 2019 · 7 comments

Comments

@maniac103
Copy link

As the title says, when building an app using this library the Android Gradle plugin emits the following warning:
string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'.

When checking the APK using the following command:
aapt dump --values resources <PATH_TO_BUILT_APK> | grep -B 1 'STRING_TOO_LARGE'
it looks like the culprit are the license texts shipped with the library:

        resource 0x7f100ba3 org.openhab.habdroid:string/license_cc30_licenseDescription: t=0x03 d=0x000026be (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100ba7 org.openhab.habdroid:string/license_cc40_licenseDescription: t=0x03 d=0x0000260a (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100bac org.openhab.habdroid:string/license_gpl_2_0_licenseDescription: t=0x03 d=0x000026c1 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100bb1 org.openhab.habdroid:string/license_gpl_3_0_licenseDescription: t=0x03 d=0x000026c2 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
        resource 0x7f100bb2 org.openhab.habdroid:string/license_gpl_3_0_licenseDescription_2: t=0x03 d=0x000026c4 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100bb6 org.openhab.habdroid:string/license_lgpl_2_1_licenseDescription: t=0x03 d=0x000026c3 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100ba3 org.openhab.habdroid:string/license_cc30_licenseDescription: t=0x03 d=0x00002e13 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100ba7 org.openhab.habdroid:string/license_cc40_licenseDescription: t=0x03 d=0x00002d5e (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100bac org.openhab.habdroid:string/license_gpl_2_0_licenseDescription: t=0x03 d=0x00002e16 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100bb1 org.openhab.habdroid:string/license_gpl_3_0_licenseDescription: t=0x03 d=0x00002e17 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
        resource 0x7f100bb2 org.openhab.habdroid:string/license_gpl_3_0_licenseDescription_2: t=0x03 d=0x00002e19 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"
--
        resource 0x7f100bb6 org.openhab.habdroid:string/license_lgpl_2_1_licenseDescription: t=0x03 d=0x00002e18 (s=0x0008 r=0x00)
          (string8) "STRING_TOO_LARGE"

I wonder whether a better solution were shipping the license files as assets instead?

@daniel-stoneuk
Copy link
Owner

Gosh that's weird. I'll have a look and keep you updated

@daniel-stoneuk
Copy link
Owner

Have you tried clearing the build cache? It's just we've never seen this problem before - so this might fix it!

@maniac103
Copy link
Author

I doubt it ;-) as it also happens in Travis: https://travis-ci.org/openhab/openhab-android/builds/549740975#L1856

@daniel-stoneuk
Copy link
Owner

Yikes! Sorry!

I'll have a look at the open HAB source since the names of these strings (license_lgpl_2_1_licenseDescription) aren't in this repo. I'll check if they're in AboutLibraries

@daniel-stoneuk
Copy link
Owner

daniel-stoneuk commented Jun 24, 2019

Yeah, looks like this is an issue with AboutLibraries

https://github.com/mikepenz/AboutLibraries/blob/21b13afc9336d9fb55a64636e4e92b63bf304631/library/src/main/res/values/license_lgpl_2_1_strings.xml

I can't see why your PR would break things? Nothing related to AboutLibraries has been changed. Weird.

@maniac103
Copy link
Author

Oops, sorry for taking too quick guesses. I checked the string files in your lib, saw some dealing with licenses and drew my conclusion :-/
Sorry for the noise, and thanks for the quick and helpful replies!

@daniel-stoneuk
Copy link
Owner

Haha, no problem! Hope you can get the tests passing :)

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