paho.mqtt.java icon indicating copy to clipboard operation
paho.mqtt.java copied to clipboard

Paho Client as Android Libary

Open kavidriod opened this issue 5 years ago • 6 comments

Please fill out the form below before submitting, thank you!

  • [ ] Bug exists Release Version 1.2.5 ( Master Branch)

I'm currently exploring on paho client in my sample Android Application. Instead of using jar file I'm trying to use Source code of org.eclipse.paho.client.mqttv3 and org.eclipse.paho.android.service as Android Library. I'm able to successfully add source code of both jar files. But when I try to connect my app to mosquitto broker I'm getting this Exception.

Caused by: java.util.MissingResourceException: Can't find bundle for base name paho.mqtt.pahoclient.internal.nls.logcat, locale en_US

Error Screenshot is added here.

queryTogithub

Anyone faced these issue?

kavidriod avatar Sep 30 '20 09:09 kavidriod

Are you adding only the source code to your project? What about the resources? What's stopping you from just adding Paho as a dependency?

sp193 avatar Nov 01 '20 04:11 sp193

how to fix?

Minhtuyen28 avatar Dec 02 '20 04:12 Minhtuyen28

@kavidriod I had solve this problem. 1.in the library build.gradle dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) }

2.copy "org.eclipse.paho.client.mqttv3-1.2.5.jar" to the libs directory of the Library. remark : Copy the org.eclipse.paho.client.mqttv3-x.x.x.jar version you have.

3.The most important step: 3-1 ) Create the java resource folder on your Library Module : New > Folder > Java Resources Folder You will find a "resources" folder in "src/main" 3-2 ) Download the paho.mqtt.java source. Copy FOLDER : META-INF and org FILE : bundle.properties from "paho.mqtt.java-master\paho.mqtt.java-master\org.eclipse.paho.client.mqttv3\src\main\resources" to "src/main/resources"

4.Build your aar file and get it in build/outputs

staneychan avatar Dec 10 '20 10:12 staneychan

+1

manondidi avatar Jun 21 '21 03:06 manondidi

+1

kzqsky avatar Jan 07 '22 01:01 kzqsky

+1

kzqsky avatar Jan 11 '22 07:01 kzqsky