Android Annotations and MonkeyTalk? - android

I just tried to update my project which uses Android Annotations to include the MonkeyTalk agent. However, as soon as I switch the project to an AspectJ project, all my Android Annotations references are not recognized.
Has anybody successfully used MonkeyTalk in an Android Annotations project?
I'm using Eclipse 4.2 SR2.
It looks like this issue has been raised on the Android Annotations FAQ:
https://github.com/excilys/androidannotations/wiki/FAQ#wiki-aspectj
In order to "fix" it, you have to remove / replace some project properties. I'm worried doing this will cause MonkeyTalk to not work, but I haven't tried it yet.
Any insight appreciated!

I was facing to this problem before. I added a solution in the FAQ page of AA. Could you test that and keep me updated ?

I had implemented the solution but still my android annotations references are not recognized,please let me know if there is any other way to tackle the same.

Related

Problems porting Android App from VS2019 to VS2022

I am trying to upgrade an Android App to build under VS2022 and use the latest nuget packages. I am also trying to modify it so that it will work on phones, and not just tablets, so the display needs to scale properly. (This is an old project that started with VS2010, so there are many legacy problems.)
When I build it, I get the error message:
resource dimen/abc_action_bar_icon_vertical_padding_material not found.
The offending axml code is:
android:textSize="#dimen/abc_action_bar_icon_vertical_padding_material"
I know that this comes from the depreciation of R.dimen and that I should upgrade from the support library to AndroidX. I thought that I had done this.
My question is, How do I fix this? Should I add or delete packages? If I declare the value explicitly, what should I use? This happens in many files, so I want to make sure that it is fixed correctly.
I also get the message:
attribute menu not found
from the code:
app:menu="#menu/navigation_menu"
I assume this is a related problem.
Thanks,
Dan

Type mismatch when creating a new ViewModel for Room implementation - kotlinx.coroutines obsolete since 1.3

I am building an app that will rely heavily on user data and plan on using Room to help manage and store their information. However, while following a tutorial I ran into a few versioning issues that I was having troubles resolving on my own.
Since I am fairly new to both Android development as well as using Room, I have been following this tutorial: Android Room with a View - Kotlin
I first noticed there might be some issues in step 3 when I updated my Gradle files. I was met by the following error on the last two lines of the dependencies block:
Library should be updated to be compatible with Kotlin 1.3
I was confused by this since the tutorial uses a variable of some kind to determine the library versions. I ran the app at this point and it seemed to work fine so I continued.
When I got to step 9, I also ran into additional errors which now prevent builds from completing:
Type mismatch: inferred type is kotlin.coroutines.experimental.CoroutineContext but kotlin.coroutines.CoroutineContext was expected
Type mismatch: inferred type is kotlin.coroutines.CoroutineContext but kotlin.coroutines.experimental.CoroutineContext was expected
This is on top of errors that implementations of kotlinx.coroutines.experimental are obsolete, however, I couldn't find references to libraries without experimental using Android Studio's intellisense.
What do I need to do in order to resolve these library issues and allow me to continue the tutorial?
To the best of my knowledge, here is the recommended way to resolve these issues.
To try and solve these issues, I started with the errors in my Gradle scripts to see if that would maybe resolve dependencies in the code. I did find this post, which I'm still not completely convinced is the best solution, but just following the first couple of suggestions in the top answer did clear most of my issues.
To be clear, I changed the following:
Changed the variable in the last line of the dependencies Gradle block to have a hard-coded version number (I did the latest as found in the kotlinx.coroutines repo). If possible, I would like this to be auto-generated again as the tutorial implies
Removed the kotlin block from the bottom of that same Gradle file
Synced my Gradle project
Update Kotlin and Gradle (I was asked by Android Studio, you might not be depending on your versions)
Manually removed problem libraries from code, and Alt+Enter'ed any missing libraries back into existence
If you update Gradle, you may also find it necessary to include the following in your Module: app Gradle file inside the android block:
packagingOptions {
exclude 'META-INF/*'
}
(* might be overkill for some, but the suggestion from this post didn't completely eliminate all of my errors.)
After all that, I was then able to rebuild the SDK which loaded to my phone with zero errors.

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 (0.8.1) cant use go to declaration/implementation

I cant seem to use go to declaration or implementation for any classes and methods that are outside of either the current class/file. It will work for classes that are from the android library but nothing that I created or that I import from another library. This is taking a huge toll on productivity... Anyone run into this? Have a solution? Ideas for a fix?
Also highlighting seems to be an issue as well, this might be related. It seems lighter then it used to be, like Annotations are not being highlighted. Maybe its a parser issue?
If you are using gradle to build your application, then make sure gradle project sync is not failing. If gradle project sync fails, then basic IDE functionality may not work properly e.g. goto type declaration (ctrl+shift+b) and implementation (ctrl+alt+b or ctrl+click). Android studio also does a wonderful job of notifying you when something fails.

Renderscript in a library project will cause findViewById() return null

I met exactly the same issue as in Android Build in Eclipse not generating the right resource ids in R.java, since that link doesn't have a "renderscript" tag, I reported it here again with some additional info.
In sum, if I create a library project and added some custom renderscripts the following issue will occur. If I link the library project with another UI project by adding
android.library.reference.1=..xxx
in the UI project's project.properties file, then calling findViewById() in that UI project will always return null, no matter what I did. If I remove the custom renderscript in the library project, the UI project works fine.
I also tried to delete all the possible resources in the library project (only the renderscript resource was kept), the same issue occurs. So this proves that the issue was caused by renderscript.
I'm working with the latest SDK bundle "adt-bundle-windows-x86-20131030" and Android SDK Tools version 22.3, Platform tools version 19, Build tools version 19.
The same issue occurs in the earlier SDK versions as well.
Is this a bug with Eclipse ADT? Is there any workaround solution before a fix. Thank you!
Update:
Some updates. I found a "solution" to this issue. If I use the old "adt-bundle-windows-x86-20130729" SDK bundle to compile and launch the application (it will success) and then switch back to the "adt-bundle-windows-x86-20130917" or the "adt-bundle-windows-x86-20131030" (the new ones), this problem will disappear! I tried this in two machines and it all behave like that. I don't know the reason why but hope this will help you if you meet the same problem.
Some updates. I found a "solution" to this issue. If I use the old "adt-bundle-windows-x86-20130729" SDK bundle to compile and launch the application (it will success) and then switch back to the "adt-bundle-windows-x86-20130917" or the "adt-bundle-windows-x86-20131030" (the new ones), this problem will disappear! I tried this in two machines and it all behave like that. I don't know the reason why but hope this will help you if you meet the same problem.

Categories

Resources