Open wmmc88 opened 5 years ago
Hi @wmmc88,
It looks like it's failing to resolve rosjava_mvn_repo
(which is added when applying this buildscript).
Updating Gradle versions has brought some hiccups in the past; last time I had to upgrade all Gradle versions across all rosjava repositories at once because of one incompatibility. Do you need Gradle 5 for some particular reason?
@jubeira since im using gradle to include the ros android, it uses calls the chain of buildscripts and apply's the gradle version across my entire project (I don't understand why it needs to do this as it's not building anything from ros-android itself, just pulling in artifacts, right?). I was hoping to take advantage of some of the new features in the android gradle plugin, but this depends on a higher version of gradle and both the gradle version and the android gradle plugin version are pulled in from the ros buildscripts.
@jubeira since im using gradle to include the ros android, it uses calls the chain of buildscripts and apply's the gradle version across my entire project (I don't understand why it needs to do this as it's not building anything from ros-android itself, just pulling in artifacts, right?)
How are you accomplishing that?
If you just want e.g. android_core
in its binary (artifact) distribution you would just need to add it as a dependency (using compile
or implementation
), but that shouldn't force you to use the same Gradle version in your project. Are you building your project together with android_core
?
According to this , it says I need to also replace the buildscript portion of the grade file so that it applies the buildscript.gradle file in the android -core repo in addition to the needed lines in the dependencies section.
Alright; yes, that's correct, but you can do what those scripts do for you manually as well. Applying the buildscripts is basically a convenient shortcut, but you can also copy the contents into your script and modify them.
If you check the contents of the applied buildscript, it does the following:
3.2.1
jcenter
and Google maven repositoriesInstead of applying the first buildscript, try doing what it does manually in your buildscript with the version of the Gradle plugin that you want.
I upgraded to plugin 3.2.2 w/ gradle 4.10.1 and everything worked fine.
Then when i tried to upgrade to plugin 3.4.0 w/ gradle 5.1.1, it could no longer resolve org.ros.messages (Time and Duration). I think these are supposed pulled in from bootstrap somehow?
It's not that they are pulled from bootstrap
; the buildscript that lives on rosjava_bootstrap
and is applied (see here) adds rosjava_mvn_repo
URL to the list, which is where the artifacts are pulled from.
That being said, I'm not sure why the new Gradle version breaks. I think compile
was deprecated in favor of implementation
, but compile
was still supported in Gradle 4. Maybe compile
was removed in Gradle 5, and the dependencies are not being properly resolved?
Does the "ros-android" gradle plugin do anything useful?
I think i misphrased my earlier reply. When I use plugin 3.4 w/ gradle 5, I am still able to resolve most ros things. My module level ros dependencies are:
implementation 'org.ros.android_core:android_core_components:0.4.0'
implementation 'org.ros.rosjava_messages:sensor_msgs:1.12.7'
implementation 'org.ros.rosjava_messages:std_srvs:1.11.2'
implementation 'org.ros.rosjava_messages:std_msgs:0.5.11'
and they all resolve perfectly fine. My issue comes from specifically resolving the org.ros.messages
package to be able to import Time and Duration objects. I looked at the android_core source code and the rosjava_core source code and neither have that package. I found it here in the ros_bootstrap repo. I'm confused as to how it ever resolved the org.ros.messages
packages.
Looks like you need message_generation
: https://github.com/rosjava/rosjava_mvn_repo/tree/master/org/ros/rosjava_bootstrap/message_generation/0.3.3.
Try adding
implementation 'org.ros.rosjava_bootstrap.message_generation:[0.3, 0.4)'
I don't know why it didn't complain before. If I'm not mistaken, ROS messages depend on it so it would be a second-level dependency. Maybe the new version of Gradle needs to specify it as well..?
thanks. is working now after adding the message_generation dependency. i thought android_core_components already pulled in message_generation, but i guess it doesnt.
Looks like you need
message_generation
: https://github.com/rosjava/rosjava_mvn_repo/tree/master/org/ros/rosjava_bootstrap/message_generation/0.3.3.Try adding
implementation 'org.ros.rosjava_bootstrap.message_generation:[0.3, 0.4)'
I don't know why it didn't complain before. If I'm not mistaken, ROS messages depend on it so it would be a second-level dependency. Maybe the new version of Gradle needs to specify it as well..?
I think we should use :
replace .
implementation 'org.ros.rosjava_bootstrap:message_generation:[0.3, 0.4)'
and still not working, miss another dependencies...i was manually added several dependencies such as org.ros.rosjava_messages:xxx:version
.. finally i got an error says org.apache.commons.logging.Log
not found. can you help me with that? thank you.
@jubeira really need your help ..bro
@gxshao using Gradle 5.1.1 is an enhancement over the current codebase, so I haven't tried it on my side.
@wmmc88 would you mind clarifying what you did to make it work a bit further?
I don't remember what else I did to get it working and am no longer working on that project
@jubeira i just manually added commons-logging
into build.gradle. and it's build successful. thanks for your reply..
i am using Gradle 5.5 for nested build, btw.
Are you planning to update the gradle dependencies @jubeira ? I tried updating the values as has been done before , but it resulted in many dependencies failing to resolve.