Android Studio: Getting JDocTest to work - java

Currently my team is working on some more complex code which our app will use and although we have UnitTests running we would really like to be able to use JDocTest so that we can create tests while we write some of our smaller methods.
I have successfully followed the instructions from JDocTest github read me and compiled it into my project. However I'm having trouble running the particular .java class files. I'm trying to be able to run MatrixCreator.
Here is what my directory looks like
Here is my attempt to set up MatrixCreator under application
I get the error
Error:Gradle: A problem occurred configuring root project 'AvocadoCoreProject'.
Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Required by:
project :

Related

Android Studio Javadoc Generation error: cannot find symbol R

I am trying to generate javadocs for a larger android project - using android studios built-in "Tools > Generate JavaDoc". I have tried different scopes (my module, a custom scope containing only the java files I created, Project Files, ...) but everytime there is a class included which uses import com.my-app.R; or a generated class such as SomeFragmentBinding for ViewBinding, I get an
error: cannot find symbol from javadoc...
Apart from this problem the usual building and executing of the app is completely successful and works like a charm, although I get some some warnings regarding my database layout. Also I am using Hilt for Dependency Injection, but I don't really think that is related?
Now I am a complete noob using gradle and my attempts to configure the javadoc task myself have failed - and from what I have found online this should generally work out-of-the-box.

Adding new aggregate function in Presto fails

I am trying to build custom aggregate functions for presto. I have created a FAT Jar and deployed the jar into the plugin directory. When I restart presto, it is always giving me this error :
java.lang.AbstractMethodError
at com.facebook.presto.server.PluginManager.installPlugin(PluginManager.java:183)
at com.facebook.presto.server.PluginManager.loadPlugin(PluginManager.java:175)
at com.facebook.presto.server.PluginManager.loadPlugin(PluginManager.java:158)
Unfortunately, I do not see any verbose error message which will give me a clue on what is actually missing here. I used presto-ml plugin as an example and implemented getFunctions() in plugin implementation. Is there a way to figure out what is missing?
I did check the source code of PLuginManager.java. I am just looking for a way to debug this in a better way.

JavaFX for Android - gradle build property not found

I am using this guide to try and port my JavaFX application to Android.
I have downloaded and installed all the things that the guide says I need but when I run the command:
gradle -PDEBUG -PDIR=/home/josh/cs335Android -PNAME=AndroidTimeline -PPACKAGE=src -PJFK_SDK=/home/josh/android-sdk -PJFX_APP=/home/josh/git/TimelinePhaseTwo -PJFX_MAIN=src/gui/Driver createProject
it says:
A problem occurred evaluating root project '***android-tools***'.
Cause: Could not find property '***ext***' on task '***:conf***'."
I think this is because I am not properly supplying the parameters to gradle (as described in the guide) but I don't actually know how to do that. Are those something that I write in the build.gradle file?

Multiple dex files + Unable to start activity ComponentInfo

After searching for similar questions/answers without success I'll try to explain my situation.
I've an Andorid game developed with LibGDX, which also uses the Google Play Games services.
My game is composed by several projects:
google-play-services_lib (lib project provided by Google, unmodified)
http://i.stack.imgur.com/1XnHn.png (libs)
http://i.stack.imgur.com/Gay5H.png (buildpath)
BaseGameUtils (lib project provided by Google, unmodified. depends on 1)
http://i.stack.imgur.com/3iJ0W.png (libs)
http://i.stack.imgur.com/noNDX.png (buildpath)
odd-blocks (the principal project of the game)
http://i.stack.imgur.com/atsKA.png (libs)
http://i.stack.imgur.com/5MDua.png (buildpath)
odd-blocks-android (basically the main activity class, depends on 1, 2, and 3)
http://i.stack.imgur.com/VUxJt.png (libs)
http://i.stack.imgur.com/yP6wv.png (buildpath)
odd-blocks-desktop (for testing the game on desktop mode, depends on 3)
http://i.stack.imgur.com/pKGUf.png (libs)
http://i.stack.imgur.com/9XzdM.png (buildpath)
My problem is that, with the configuration shown, when I try to execute the odd-blocks-android project I obtain the following error:
[2014-03-08 19:04:22 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
[2014-03-08 19:04:22 - odd-blocks-andorid] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Which is related to the "andorid-support-v4.jar", I'm sure to have only one version of this jar, as you can see in the images. There is a "solution" proposed in some questions to disable the private libraries in the build path configuration. In my case, if I do that, the game is executed but before starting there is a exception that says:
03-08 18:26:05.524: E/AndroidRuntime(15449): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.damsoft.oddblocks/com.damsoft.oddblocks.MainActivity}: java.lang.NullPointerException
There are also, some questions available about this second error message, that mentions that it is because the manifest is incorrect because does not have the activity registered. I'm sure that this is not my case, because I checked it, and also because my game worked before. In these questions they also mention that a way to resolve this error is to enable the "android private libraries" in the build path configuration screen, but then, I got the first error...
It is also important to mention that this error started to happen after the update to "Android SDK build-tools" v19 (currently 19.0.3).
I've been trying many things but nothing seems to solve the issue, maybe is something stupid... I don't know, but I'm out of ideas. I hope you can help :)
Finally I found the problem.
It was the "gdx-backend-android.jar", and some bad luck.
I installed a nightly build of LibGDX that for some reason included the classes of the android-support-v4.jar that caused the conflict of versions.
My solution was as simple as re-download libgdx.
But as a general remark, it is important to notice that this error message could mean that some other lib includes duplicated classes. Not necessarily with the same file name. The only way I found to check this was to rename the jar files to zip, and check for the duplicated class files.

JumpNote: main type is not specified

I'm doing my 1st steps in Android/GoogleApp, and I'm trying to explore the Jumpnote example:
http://code.google.com/p/jumpnote/
I was able to import the Android and Appengine projects to eclipse, but encountered the following issue when trying to run the Jumpnote-web part (android runs well).
When running the web part there is an error Main type is not specified which AFAIK implied that this project is missing a main function.
Is that indeed the case for jumpnote example and I need to manually add it, or am I missing something else?
Go to run Configuration
select JumpNoteWeb run configuration
You see in the main tab your project name and below it says main class
In the main class, put "com.google.gwt.dev.DevMode"
it should now run
*When I had this problem I also need to make sure that I put the src.shared folder into my project and had to change my build order so the app engine sdk, gwt sdk, and jre would build first

Categories