Hello all,
I am working on a product using a P1 module on a custom PCB. I have a prototype Android app that is working well with the device setup library version 0.6.3. I am at a point with my product that I would like to customize the device setup experience. I know that I can modify some strings in the customization.xml resources file, but this doesn’t do enough for me. For example, the device setup library displays a prompt like Please power on your {device_name} by plugging it in. The indicator light should blink {indicator_light_setup_color_name}
where the values in brackets can be customized. The problem is I need to change this whole string. The sentence The indicator light should blink...
doesn’t make sense for my product.
This shouldn’t be a problem. I can fork the particle-android repo and should be able to modify the device setup library to my heart’s content. But that is turning out to be harder than I thought. First, in order to get device setup to build (using the latest Android Studio) I had to fix some errors about missing resources. Then when I do get device setup (0.6.3) and cloud sdk (1.0.1) built and include the .aar
files as dependencies in my app I get the error that is posted here. I tried to revert the changes in the commit that is referenced as causing the error in the issue, but the error persists.
I’m wondering if anyone can point me to an example of a product that uses a forked and customized device setup library.
Thanks!
Edit (more info):
When I use the published device setup library in my app I include the following line in my build.gradle
:
implementation 'io.particle:devicesetup:0.6.3
. That line also brings in the cloud sdk dependency so I don’t have to write implementation 'io.particle:cloudsdk:1.0.1
. In fact if I do include that I get the duplicate class error referenced above. When I build the device setup library from my fork and include that in my app I write implementation 'io.particle:devicesetup:0.6.3@aar
and
repositories {
...
flatDir {
dirs 'path/to/devicesetup/build/outputs/aar'
}
}
But then, I am learning because aar
files don’t include dependencies, my references to io.particle.android.sdk.cloud
are not understood. Ok, so I add implementation 'io.particle:cloudsdk:1.0.1'
. But then I get the duplicate class error! Ok, so revert back to version 0.5.1 of the cloud sdk and the duplicate class error goes away and my app builds!
But it crashes when I run it because of java.lang.NoClassDefFoundError: Failed resolution of: Ldagger/internal/Preconditions;
. I guess this is because device setup lib depends on Dagger and that dependency isn’t packaged into the aar when I build my fork of device setup.
Can someone help me to understand how to build my own copy of the device setup library so that it includes it’s dependencies in a format that is easily digestible by my product’s app? I am very much a novice with Gradle.
I guess the other option is to cram my app into the setup_example_app
included with particle-android
and use the provided build scripts to get everything linked up that way.
-Colin