android-lint

Android Lint report for my project only, excluding library projects?

喜你入骨 提交于 2019-11-26 20:54:57
问题 How do I run Android Lint so it only reports on my project module, and ignores any library projects I'm using? Even when I aim Lint at my project's module, it spews out lists of issues in the library projects which I'm not interested in - I want to focus effort on fixing issues in my own code. I can't see a parameter to specify whether it follows references to library projects or not, but maybe you can see how to do it. 回答1: If you are using Eclipse, go to the library project's properties

Lint: How to ignore “<key> is not translated in <language>” errors?

…衆ロ難τιáo~ 提交于 2019-11-26 19:26:11
I can't compile/debug our Android app, because the localization files are not perfect yet. My IDE's validation tool Lint create errors saying: newCardsOrderVals is not translated in ar, bg, ca, cs Compiling/installing/running with Ant works fine, but I would like to use my IDE to ease debugging. Is there a way to turn off this particular check, or ideally make it a warning rather than an error? I understand that before release we will really need to get localisation files right, but for the time being it is not a priority as the screens themselves are being modified very frequently. Android

AppCompatActivity.onCreate can only be called from within the same library group

£可爱£侵袭症+ 提交于 2019-11-26 18:43:39
After upgrading to appcompat 25.1.0 I've started getting wired errors. In my code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); I get lint error: AppCompatActivity.onCreate can only be called from within the same library group (groupId=com.android.support) How to prevent such behavior? Martin As Felipe already pointed out in his comment this is a bug in the pre-release version of the tools. You can workaround it for now, until Google release a fix, by adding the following into your project module's build.gradle file: android { lintOptions {

Android Lint limit languages to check for missing translations

余生长醉 提交于 2019-11-26 14:13:09
问题 My app supports only 2 languages - English and German. So I have such folders structure for languages strings: myproject/res/values/strings.xml myproject/res/values-de/strings.xml When I run Lint check I get many warnings about missing languages, that my app doesn't need to support: "some_string" is not translated in af, am, ar, be, bg, ca, cs, da, el, en-rGB, es, es-rUS, et, fa, fi, fr, hi, hr, hu, in, it, iw, ja, ko, lt, lv, ms, nb, nl, pl, pt, pt-rPT, ro, ru, sk, sl, sr, sv, sw, th, tl, tr

Run lint when building android studio projects

不问归期 提交于 2019-11-26 12:25:21
问题 I would like to be able to run the lint task when I\'m building projects with android studio to ensure the lint rules are being followed. I have tried using task dependencies but with no luck. My teamcity build server uses the build task which runs the lint task, so that works great. However, android studio appears to use generateDebugSources and compileDebugJava tasks interchangeably when I have selected the debug build variant. Here is what I have tried in my build.gradle: assemble

Avoid Android Lint complains about not-translated string

三世轮回 提交于 2019-11-26 12:09:36
问题 is it possible to specify that the strings in a file within the value-* directories are purposely not translated into other languages? I have a bunch of strings that are common for all the languages and need no translation, so I\'ve created an unlocalized-strings.xml file within values directory.. Running Android Lint to check for problems it keeps saying that some translations are missing.. I do not want to disable this check on the whole project, I\'d like to disable it only in some XML

Lint: How to ignore “<key> is not translated in <language>” errors?

时间秒杀一切 提交于 2019-11-26 06:58:19
问题 I can\'t compile/debug our Android app, because the localization files are not perfect yet. My IDE\'s validation tool Lint create errors saying: newCardsOrderVals is not translated in ar, bg, ca, cs Compiling/installing/running with Ant works fine, but I would like to use my IDE to ease debugging. Is there a way to turn off this particular check, or ideally make it a warning rather than an error? I understand that before release we will really need to get localisation files right, but for the

AppCompatActivity.onCreate can only be called from within the same library group

℡╲_俬逩灬. 提交于 2019-11-26 06:32:58
问题 After upgrading to appcompat 25.1.0 I\'ve started getting wired errors. In my code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); I get lint error: AppCompatActivity.onCreate can only be called from within the same library group (groupId=com.android.support) How to prevent such behavior? 回答1: As Felipe already pointed out in his comment this is a bug in the pre-release version of the tools. You can workaround it for now, until Google

This Handler class should be static or leaks might occur: IncomingHandler

和自甴很熟 提交于 2019-11-25 22:48:02
问题 I\'m developing an Android 2.3.3 application with a service. I have this inside that service to communicate with Main activity: public class UDPListenerService extends Service { private static final String TAG = \"UDPListenerService\"; //private ThreadGroup myThreads = new ThreadGroup(\"UDPListenerServiceWorker\"); private UDPListenerThread myThread; /** * Handler to communicate from WorkerThread to service. */ private Handler mServiceHandler; // Used to receive messages from the Activity