Android Studio lint highlight with Timber not working - android

I've integrated Timber into a new project.
And I cannot make the lint highlight to work. Meaning stuff like this:
Timber.i("Hello, " + "world!");
Isn't highlighted to yellow.
Am I missing something? Is there a setting for this?
Running a ./gradlew lint generated a lovely report which finds exactly what I want, so the lint rules are somewhere in my project. Yet the IDE does not want to highlight that on the fly.
Things like new String("x") are highlighted, and mostly my IDE settings are default, so something works.
I have another bigger project with Timber and highlights work perfectly - so there is my suspicion that I'm missing something on the level of project config.

This was an issue with Android Studio 2.3 & Timber 4.5.1 or earlier.
If you upgrade Android Studio to 3.0 & Timber to 4.6.0 you should get this highlighted correctly. There was an issue in the Android Source Code and also in Timber. This was fixed now in both recent versions though.
You can see the Timber fix and a gif with your showcase here.

Related

Unsupported kotlin version

My gradle build completes successfully, but I get:
WARNING: Unsupported Kotlin plugin version.
The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `1.5.31` that
might work differently than in the requested version `1.6.10`.
All of my build.gradle.kts scripts refer to using version 1.5.31. The only association my project has with version 1.6.10 is that Android Studio has the Kotlin version 1.6.10 plugin added. If I try to disable that plugin, I get a message that several other plugins will be disabled. If I accept that, android studio crashes and will not start up again. It won't start up again even if you reinstall android studio again. The solution is to find the file named "disabled-plugins.txt" and delete that file. It's in your AppData folder and in a JetBrains subdirectory. It turns out that it's one or more of those other disabled plugins that prevents Android Studio from starting up again.
The question I have is how do I fix this version mismatch issue. I can't delete the plugin from Android Studio for the reasons I mentioned above. If I try to update my project to using version 1.6.10 I get literally 100's of unresolved dependencies. And it seems from opinionated investigation that 1.6.10 still have too many issues for general use.
By the way, when I look at the gradle window for the project I can see where the dependencies come from. Usually when I look at the gradle window I just see sub project folders that I can drill into for more information, but for this project, it has an additional folder name dependencies. I don't know how they get into my project. But when I look at their version numbers that's where the 1.6.10 mismatch happens.
So, I think I understand why the warning message is valid, I'm at a lost on what I need to do to correct this situation. For the moment, I'm just ignoring the warning, and so far I'm not finding any issues in proceeding that way. But that's means I'm proceeding, without an understanding of what's going on here! Sometimes that's okay and at other times that's a bad judgment The error message itself seems inverted. I would think that 1.6.10 is the embedded kotlin and kotlin-dsl since it an android studio plugin, but the error message seems to say it in the opposite way. So anyway, if someone can bring some clarity as to what's going on, and how I'm thinking wrongly about this problem would be greatly appreciated.
I'll accept the following as the answer to what's going on about the unsupported kotlin version:
https://github.com/gradle/gradle/issues/13020
So, for the moment, I'll go on like this is just a nuisance warning and ignore that.
What I just did was to re-create my Android Studio from a blank brand new project. I copied and pasted stuff from the previous project into the new project. I copied the source and build.script.kts files, so essentially everything is a copy of the disabandoned project. This new project didn't give me the WARNING message anymore. And in additional, I'm now able to upgrade my project to using kotlin 1.6.10, which I previously couldn't do because of the literally 100's of dependencies resolution issues. Whatever, that issue went away, and a lot of others things started working as expected once I recreated the project. I can't say what got my project into that weird state. Deleting the .gradle and .idea folders, wouldn't fix the problem. I didn't try deleting the JetBrains cache, I wish I would have tried that.

how to remove or update custom lint

When I wrote a custom lint and apply it to my project, I fount that it works on all projects on my computer. So I want to remove it, but it didn't work when I just delete lintChecks project(":lint") in Gradle. Also, it didn't work when I modify some code in the custom lint. It always works in the first draft. How can I fix it?
Ps:android studio 3.6 Beta 3, gradle-5.6.1, lint-api:26.4.1, lint-api:26.4.1

MonkeyTalk and Butterknife ViewInjector Generation - (Android + Annotations + AspectJ + Eclipse)

I have been using ButterKnife successfully to inject views in my application like so:
#InjectView(android.R.id.text1)
TextView mMessageText;
#InjectView(android.R.id.button1)
ImageView mButton;
... then later...
View.inflate(ctx, R.layout.layout_message_with_button, this);
ButterKnife.inject(this);
mMessageText.setText("Some Text");
This morning I integrated MonkeyTalk for some testing, and my injections now seem to be busted. I've removed/readded annotation processing for ButterKnife, but that didn't seem to fix the problem. Using findViewById fixed the issue (the views were found), but changing the project to use findViewById directly isn't really an option at this point.
I wasn't able to find any information about conflicts between the libraries (or using AspectJ with ButterKnife in general), so hopefully someone here can help provide some insight into what I might be doing wrong (or if they are just in general incompatible).
I am using ButterKnife 4.0.1 and MonkeyTalk Agent 2.0.9
UPDATE:
I have also tried changing the build order of the libraries in the Eclipse project properties, but this also doesn't seem to help.
UPDATE:
I narrowed it down to the generated files not being created in ButterKnife. It appears to be related to Annotation processing not happening in the org.eclipse.ajdt.core.ajbuilder. When I add org.eclipse.jdt.core.javabuilder to the .project as suggested here : https://bugs.eclipse.org/bugs/show_bug.cgi?id=169857, the classes are generated, but I'm getting NoClassDefFoundError at run time on .ajc files. Any idea how to get the annotation processor to run in the ajbuilder? That seems to be the correct solution for my problem.
UPDATE:
From this post (http://andrewclement.blogspot.ca/2014/08/annotation-processing-in-ajdt.html), it appears that Aspects and Annotations can be processed in the same project using Eclipse 4.4. It seems, however, that the combination of ADT 23 + Eclipse 4.4 + AspectJ is pretty unstable (and doesn't appear to generate the code from ButterKnife's Annotations anyway). Anyone know if Android Studio would be any help here?
UPDATE:
I converted my project to Android Studio and it looks like both the Aspects and the Annotations are working. I know I'm still not doing something right with the Aspects, since they weren't processing until I added Jake Wharton's Hugo library to the Android project.

Android Studio always excludes build/source folder

I'm using an annotation processor to generate code in android studio and ran into t
he problem that with every build android studio re-adds (i manually delete it every now and then) the following line to the module's .iml file:
<excludeFolder url="file://$MODULE_DIR$/build/source" />
Does anyone know a setting or a way to prevent this?
I'm maybe thinking of a gradle task to delete this line from the file but i've never done anything like this. Can someone point me to the right direction?
I'm using the latest android studio version in beta update channel, which is 0.8.2
Thanks in advance!
EDIT: Just to clarify: everything builds fine, but android studio shows a lot of errors in the editor and i can't use functions like "find usages" and "jump to definition" properly.
Thanks for guiding me in the right direction, the answer is to use a different source folder or in my case to update android-apt to a version >= 1.3 in build.gradle, like this:
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.3+'
I still had 1.2.+, see this link to the author's git for more details:
https://bitbucket.org/hvisser/android-apt/issue/13/compatibility-with-011-android-plugin

xmlvm - import errors compat libs in xcode

Does anyone know where the android compat libary is
located in xmlvm so I could copy it by myself to the project folder because this is
what I guess is missing, also would be provided by target=android-on-iphone but as mentioned below this target isn't available in the current build.
I had absolutely no problem installing xmlvm and getting in touch with the
demo/samples also all the demos worked perfectly for me.
But now im stuck at the last 4 errors in xcode, i migrated my android project via --
skeleton=android:migrate then cross-compiled it via --target=iphone and opened
up the project in Xcode. after few project setup changes the errors went down from
72 to 4 errors ;)
however the errors are importing file not found errors of compat libs, so this
should somehow get to be solved i think...
is it because --target=android-on-iphone wasnt used by me because this option
will copy the android compat libary to the project folder.. well i tried to use this
target mentioned in 2 documentations of xmlvm but in the actual build of xmlvm
this target however does not exist..
How to solve these errors?
Screenshots:
http://img526.imageshack.us/img526/8957/bildschirmfoto20120620u.png
http://imageshack.us/f/138/bildschirmfoto20120620u.png/
From what I can see, it looks like you are using part of the Android API which is not yet implemented.
Unfortunately it seems that you either need to rewrite your application or implement the API yourself.

Categories

Resources