use -DGRADLE with fuse preview

Hi i am trying to build a uno file that connects to a couchbase lite database. I added the couchbase dependency using

[Require("Gradle.Repository", "maven { url 'http://files.couchbase.com/maven2' }")]
[Require("Gradle.Dependency","compile('com.couchbase.lite:couchbase-lite-android:1.2.1')")]

and it compiles properly when i run fuse build fuse build -t=android -DGRADLE and runs properly on the device when i add --run when i try to preview it however its not finding the couchbase source. I assumed that it was because gradle is not pulling the dependencies, so i try adding -DGRADLE to fuse preview like so fuse preview --target=android -DGRADLE but it says fuse: Could not find a fuse project to preview can anyone help. I am also willing to contribute my couchbase-lite uno file once its far enough along to the community.

Hi Chad,

To preview using gradle, you unfortunately have to specify the unoproj explicitly, like so:

fuse preview <whatever>.unoproj -t android -DGRADLE

I’ve filed a ticket for us to improve this.

Hi Andres

I tried what you suggested and it compiles properly. however it does not install on the device. it basically sticks at “Launching activity ‘app’” however when i look on the device i am seeing that it removed the previous previewed app but i am not seeing the preview app for the current project. this is the output from console.

fuse preview app.unoproj -t android -DGRADLE Fuse 0.21.0 (build 6650) Build started: FullCompile Configuring (6.89s) Installing dependenciesstuff: GET https://az664292.vo.msecnd.net/files/EhnL9U7bMgbjEYe4-uno-base-0.8.614-android.zip stuff: GET https://az664292.vo.msecnd.net/files/0bc3RZL4ET5cYUfD-Android.zip (4.93s) Compiling syntax tree (11.76s) Generating code and data (25.31s) Building Android app 2/2: app.apk Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. (179.68s)

Build completed in 228.59 seconds Build ended Installing APK on 1 device(s) Launching activity ‘app’

Hi, it looks like we have a bug here. I’ve created a ticket for us to investigate this.

any update on this issue yet? or is ther an alternative way for me to preview with gradle dependencies?

Hi Chad,

Unfortunately this issue is not solved yet, and we don’t know of any workaround.

I am also having issues getting Gradle to work in preview. I am running Fuse release 0.24.0. At first there were issues around the windows path limitation of 260 characters.

Is there any work around for this?