android-lint

Why does Android Lint warn about String.format using default locale when explicitly using Locale.US?

不打扰是莪最后的温柔 提交于 2021-02-05 20:40:12
问题 I originally called String.format this way: return String.format("%s %f %f", anotherString, doubleA, doubleB); Which made Android Lint generate this warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead So I changed it to use Locale.US explicitly, based on what I read at http://developer.android.com/reference/java/util/Locale.html under the "Be wary of the default locale" section: return String.format(Locale.US, "%s %f %f",

Why does Android Lint warn about String.format using default locale when explicitly using Locale.US?

心已入冬 提交于 2021-02-05 20:40:03
问题 I originally called String.format this way: return String.format("%s %f %f", anotherString, doubleA, doubleB); Which made Android Lint generate this warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead So I changed it to use Locale.US explicitly, based on what I read at http://developer.android.com/reference/java/util/Locale.html under the "Be wary of the default locale" section: return String.format(Locale.US, "%s %f %f",

Android Lint erroneously thinks min SDK version is 1

自作多情 提交于 2021-02-05 19:57:55
问题 Eclipse refuses to build my Android project. In the package explorer, the project root node has the little red error symbol, but nothing else inside of it has this symbol. The Problems tab shows errors detected by Lint: Call requires API level 3 (current min is 1): android.os.AsyncTask#<init> Call requires API level 3 (current min is 1): android.view.GestureDetector#<init> Call requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager#hideSoftInputFromWindow Call

META-INF/versions/9/module-info.class: broken class file? (This feature requires ASM6)

早过忘川 提交于 2020-12-30 05:34:19
问题 I'm having issues with Bouncycastle, which only arise when running the :lint task. Generally it seems to be a Java 9 byte-code version 53.0 / ASM version conflict. These are the dependencies: // https://mvnrepository.com/artifact/org.bouncycastle implementation "org.bouncycastle:bcprov-jdk15on:1.64" implementation "org.bouncycastle:bcpkix-jdk15on:1.64" Which cause the :lint task to throw processing errors: > Task :mobile:lint Error processing bcpkix-jdk15on-1.64.jar:META-INF/versions/9/module

META-INF/versions/9/module-info.class: broken class file? (This feature requires ASM6)

守給你的承諾、 提交于 2020-12-30 05:34:07
问题 I'm having issues with Bouncycastle, which only arise when running the :lint task. Generally it seems to be a Java 9 byte-code version 53.0 / ASM version conflict. These are the dependencies: // https://mvnrepository.com/artifact/org.bouncycastle implementation "org.bouncycastle:bcprov-jdk15on:1.64" implementation "org.bouncycastle:bcpkix-jdk15on:1.64" Which cause the :lint task to throw processing errors: > Task :mobile:lint Error processing bcpkix-jdk15on-1.64.jar:META-INF/versions/9/module

How to output deprecation warnings for Kotlin code?

与世无争的帅哥 提交于 2020-05-31 07:34:14
问题 I am using the following configuration snippet in my Java/Kotlin Android project in the app/build.gradle file: gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } } It generates a verbose output of Lint warnings in .java files when the project is compiled. I would like to achieve the same for .kt files. I found out that Kotlin has compiler options: gradle.projectsEvaluated { tasks.withType(org.jetbrains.kotlin.gradle

Why is ContextThemeWrapper now restricted to the Support Library group?

a 夏天 提交于 2020-04-08 18:51:04
问题 I started using a ContextThemeWrapper to apply a style dynamically to an ImageButton ; based an answer to another question of mine, and answers to other similar questions. ContextThemeWrapper wrapper = new ContextThemeWrapper(getContext(), mStyleRes); mImageButton = new AppCompatImageButton(wrapper, null, 0); But recently a lint error started appearing on the ContextThemeWrapper constructor stating: ContextThemeWrapper can only be called from within the same library group (groupId=com.android

Why is ContextThemeWrapper now restricted to the Support Library group?

巧了我就是萌 提交于 2020-04-08 18:49:49
问题 I started using a ContextThemeWrapper to apply a style dynamically to an ImageButton ; based an answer to another question of mine, and answers to other similar questions. ContextThemeWrapper wrapper = new ContextThemeWrapper(getContext(), mStyleRes); mImageButton = new AppCompatImageButton(wrapper, null, 0); But recently a lint error started appearing on the ContextThemeWrapper constructor stating: ContextThemeWrapper can only be called from within the same library group (groupId=com.android

Why is ContextThemeWrapper now restricted to the Support Library group?

梦想与她 提交于 2020-04-08 18:48:54
问题 I started using a ContextThemeWrapper to apply a style dynamically to an ImageButton ; based an answer to another question of mine, and answers to other similar questions. ContextThemeWrapper wrapper = new ContextThemeWrapper(getContext(), mStyleRes); mImageButton = new AppCompatImageButton(wrapper, null, 0); But recently a lint error started appearing on the ContextThemeWrapper constructor stating: ContextThemeWrapper can only be called from within the same library group (groupId=com.android

Android Studio Remove lint error

妖精的绣舞 提交于 2020-01-24 14:26:25
问题 I need to remove a lint error and I don't know how to do that. The problem is that lint is interpreting wrong a regex expression. As the expression is in UTF-16, the range is right, but it interprets it as UTF-8 then it detects an Illegal character range (from < to) exception on my EMOJI_REGEX . Although the lint error, the code is working fine, so I need to remove that lint error. How could I do that? private final static String EMOJI_REGEX = "([\\u20a0-\\u32ff\\ud83c\\udc00-\\ud83d\\udeff\