1

I was using HiveMQ Client version 1.0.1 but I decided to update to the recently released version 1.1. I completely started from scratch and imported the project as a Gradle project and tried to build. The build work only after ignoring a few failed tests. I'm getting 3 errors in 3 different classes. I realize this is likely related to the Dagger dependency injection tool and I had already successfully built the project and added the directory of build/generated/source/apt/main/ to my build path as noted by my previous stack post where I had issues with a DaggerSingletonComponent not being found: How to fix DaggerSingletonComponent not resolved in HiveMQ (MQTT protocol) . This seems to be a new issue and I'm not sure what's wrong. I tried rebuilding by project but the errors still persist. I've left some screenshot below as well as the specific errors.

HiveMQ:

https://github.com/hivemq/hivemq-community-edition

https://github.com/hivemq/hivemq-mqtt-client

Errors:

The constructor MqttChannelInitializer(MqttClientConfig, MqttConnAckFlow, MqttEncoder, MqttConnectHandler, MqttDisconnectHandler, MqttAuthHandler, Lazy) is undefined

The constructor MqttSession(MqttClientConfig, MqttSubscriptionHandler, MqttIncomingQosHandler, MqttOutgoingQosHandler) is undefined

The method provideBootstrap(NettyEventLoopProvider, MqttChannelInitializer) in the type ConnectionModule is not applicable for the arguments (MqttClientConfig, NettyEventLoopProvider, MqttChannelInitializer)

Screenshots:

enter image description here enter image description here enter image description here

Chigozie A.
  • 335
  • 4
  • 16
  • If the goal is to use the library, wouldn’t it be an option to use the binary distribution of the lib e.g. via Maven? – Dominik Obermaier Jun 13 '19 at 21:06
  • @DominikObermaier I'd like to just use the entire project and just add a few simple classes to run the project so I'd want to just use it like it is for now. I don't actually have a project of my own. Do you have any suggestions for fixing the error? I'm not too familiar with Dagger. – Chigozie A. Jun 13 '19 at 23:03

2 Answers2

1

Executing ./gradlew clean build on the command line will fix your error.

But I also think that the real solution for your use case is to create a new empty project (gradle or maven) and add the client library as a dependency, like described here: https://hivemq.github.io/hivemq-mqtt-client/docs/installation.html

SgtSilvio
  • 476
  • 2
  • 5
1

The issue turned out to be caused by an issue with the source folder in the directory build/generated/source/apt/main/ not having the option “Update exclusion filters in other source folders to solve nesting” selected. Selecting that option solved all of the errors.

enter image description here

Chigozie A.
  • 335
  • 4
  • 16