Updating gradle to version 5.1.1 causes `Unresolved reference:` issues - java

I updated the Gradle plugin version from 3.3.2 to 3.4.0 and Gradle to version 5.1.1. I know for sure this causes a library to be unknown when I import it. It gives the error unresolved reference.
Cleaning the project, rebuilding, Invalidate caches/Restart and throwing away the .idea file all do not solve this issue. The only thing that worked for me was restoring the Gradle version back to 3.3.2. But this is not what I want.
The problem I have has to do with ROS libraries; ROS Java bootstrap's message_generation to be specific. This library has the same relative path as the rosjava library; namely org.ros.*. I am not sure if this has anything to do with the issue.
What can I do about this? Thanks a lot: all help is very welcome!

The solution was described on the Gradle github issue page where I also described my problem. What is described is that ROS is publishing the wrong metadata.
"This says that you only need the jar that contains org.ros.internal.message.Message when running your application and not when you're compiling it, which doesn't seem to be the case. To fix this, you'll need to add the extra dependencies that ROS isn't including for compilation."
I fixed it like described; I added the dependencies corresponding to the libraries that were not found after the update. This did the trick for me:
implementation 'org.ros.rosjava_messages:sensor_msgs:1.12.5'
implementation 'org.ros.rosjava_bootstrap:message_generation:0.3.3'
implementation 'org.ros.rosjava_messages:std_msgs:0.5.11'
implementation 'org.ros.rosjava_messages:geometry_msgs:1.12.7'

Related

Flutter: (location plugin) build issue due to java sdk

I am using flutter location package ^4.1.1 and this is the error message I am getting.
My flutter doctor results show that I am using JDK 1.8..
So my question is, do I need to configure the java source in my flutter project, in the build.gradle or some other place in order to make it point to my current version of Java? In my build gradle I did see a dependency implementation of kotlin pointing to jdk7. Tried changing that to jdk8 but didn't work.
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"}
I've done a ton of searches on google but couldn't find anyone in the same predicament as me which is why I finally gave up and had to make an account here to ask for help. Just a side note, I am using vscode for developing this project as part of a flutter course. Thanks in advance for the help.
[RESOLVED] Turns out the issue was not on my side but the developer's version of the package. He has released a patch fix to that package ^4.2.1. 3 days wasted trying to fix this issue on my end but all's well that ends well I guess. Hope this helps someone else facing the same issue.

Could not find builder.jar (com.android.tools.build:builder:3.1.0)

I wanted to Setting up android studio, i have installed the latest version(3.1.0) of it and i downloaded and installed the latest version of gradle(4.6) and created a new object. but gradle project sync failed. and shown up the error :
Could not find builder.jar (com.android.tools.build:builder:3.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.1.0/builder-3.1.0.jar
screenshot
I Couldn't find such problem with the others.
is it related to android sdk or gradle version?
is there any solution to download it manually and place it in the
location??if it's possible , where is the location ,that i can put the
builder-3.1.0.jar file.
Go to File>Setting>Build,Execution,Deployment>Gradle>Android Studio>>
and
Check mark this:: Enable Embedded repository
and Click Ok.
Then,
Rebuild the Project.
or
go to Terminal and type "gradlew cleanBuildCache" to clear the cache. The cache is in USERNAME.ANDROID\BUILD CACHE Directory.
And Rebuild.
Try deleting ~/.gradle folder and building the project again. Gradle will download that.
Accepted answer did not work for me, so I changed the class path line in gradle (project : project name) and issue is gone.
classpath 'com.android.tools.build:gradle:3.1.2'
I have tried all of the suggestions and none of them worked!
if you are facing the same issue i suggest you to do what solved my problem , i have found out the problem may caused because:
most likely at one time this dependency version was available, and so it’s now available on your Mac/PC in the filesystem (cache), and Gradle won’t try to download it (as it’s already downloaded). But then the version was removed / is no longer available, so it will no longer work on any new Mac/PC (as the dependency version can’t be downloaded).
hopefully if you have a backup before this problem happen these steps might help you to fix this issue
1) Backup or push the file you have changed to git (I suggest just your code files not anything related to gradles or android files)
2) delete C:\Users\ (your User)\ .gradle\caches
3) Do a clean git clone of the repository, into a new directory
4) Open new copy of your project with Android Studio and let Android studio sync gradles again
Check the version of Android Studio you are using...i was Android Studio 3.1 when it gave me the problem....i downgraded my Android Studio version to 3.0.1 and the problem solved.
I battled with the same problem for a very long time. But I was able to resolve it. You can try this:
Go FIle > Settings > Build, Execution, Deployment> Build Tools > Gradle then check the option Offline Work . You will notice that it points to a local gradle directory on your computer i.e C:Users/User_name/.gradle. Click Apply then OK. Run your project again, it should work.
Below is a screenshot:Screenshot of the Fix
go to SDK manager and download other SDK platform

Lucene NoSuchMethodError in Eclipse Plugin

Edit: This question is solved. For some reason there indeed was another version of the Lucene files in the plugins directory of Eclipse.
I'm trying to use Lucene in an Eclipse plugin. It's methods are supposed to be called from another plugin.
It works great as long as I run the project as a Java Application. But when I try to call a method from the other plugin, I get the following error:
java.lang.NoSuchMethodError: org.apache.lucene.store.FSDirectory.open(Ljava/nio/file/Path;)Lorg/apache/lucene/store/FSDirectory;
Of course the method does indeed exist as it runs perfectly fine as a Java Application. Therefore I guess I have to do something plugin-specific to make it work.
I added the necessary Lucene-jars (lucene-analyzers-common-5.3.1 and lucene-core-5.3.1) to the dependencies of my plugin. I also added org.apache.lucene.store to the Exported Packages of my plugin (as suggested by Eclipse so the plugin which calls the method can catch the LockObtainFailedException). That's everything I've done regarding Lucene.
Can someone tell me what I forgot / don't know about? (If it's not obvious, I am completly new to Eclipse plugins)
Edit:
I've also tried to add the jars directly to the plugin which is calling the Lucene-method (by adding the paths to Bundle-ClassPath in the manifest). Didn't change anything.
I've also read that such a problem may occur due to another version of Lucene being somewhere in my classpath. I made sure that's not the case.
For some reason there indeed was another (older) version of the Lucene files in the plugins directory of Eclipse. These were the problem. I deleted them and removed the version tag in the manifest.

Adding a plugin dependency to my plugin breaks existing non-plugin library (Google Data API)

I'm writing an eclipse plugin. This plugin uses a few local jar files, and additionally has a few dependencies on other plugins.
I'm using the Google Code Search API from jar files, and it works fine; but after I add the plugin dependency org.eclipse.zest.dot.ui to my project, the Google Code Search API does no longer work - on calling new CodeSearchService("my_ID"), I'm getting the following run-time error:
Analysis failed: java.lang.NoSuchMethodError exception raised.
com.google.common.collect.ImmutableSet.buider()Lcom/google/common/collect/ImmutableSet$Builder;
I have carefully checked and reproduced this: if the plugin appears in the dependency list, the CodeSearchService can no longer be used; if it doesn't, it works perfectly. The actual project code does not change, only a dependency is added.
This is very strange to me, as I don't see how adding a plugin dependency should suddenly make some methods disappear. Has anyone encountered anything similar, and can share any insights about this problem and a possible solution? I'm not even sure if this issue is specific to these two libraries or not.
The org.eclipse.zest.dot.ui bundle pulls in dependencies that depend on the Google Collections, so my guess is that the Google Code Search API requires a different version of these, and is now trying to use the other version. Not sure how to solve this, but you could try to update both to the latest version (see http://wiki.eclipse.org/Zest#Zest_2.x for the newest org.eclipse.zest.dot.ui bundle).

red5 0.9 on Windows - Java Problems on build

so I've installed red5 0.9, I've installed jdk 1.6 update 22. I've set my environment variables correctly, installed eclipse galileo for java ee developers, tortoise svn, and then ivyde and subclipse plugins for eclipse. I then created a folder called red5_server, and did the svn checkout. When I try to import the red5_server, I get the java problem:
The project was not built due to "Could not delete '/red5_server/bin/org'.". Fix the problem, then try refreshing this project and building it since it may be inconsistent
Do you have any idea what could cause this? Also, while it was attempting to build, an error flashed on the screen and quickly disappears. I was only able to read it by removing the project and importing it over and over again until I was able to react quick enough to screen-capture the error. It says:
'Ivy resolve job of ivy.xml in 'red5_server has encountered a problem. Error while resolving the ivy instance for ivy.xml in 'red5_server': Unrecognized variables in the Ivy settings file ${workspace_loc:red5_server/ivysettings.xml}
Any idea what this could be? Thanks in advance!
Also, when I remove the project and try it again, I get the same ivy.xml error and isntead of getting the one java problem, i get over 5000. Any ideas? My head is spinning over here.
I've tried this on a freshly reformatted computer with the same results and with every version of red5.
All of the errors are Java Problems of the same type:
ApplicationAdapter cannot be resolved to a type Application.java
or,
The import org.red5.server.adapter cannot be resolved Application.java
or,
log cannot be resolved Application.java
or,
The method getName() is undefined for the type Application Application.java
Am I missing some essential file or path?

Categories

Resources