Sync commands not activated on Android

What is the problem you are having with rclone?

I want to write a app that downloads data from Google Drive. I was able to compile the gomobile.aar file and include it in my project. As well as setting up a remote that I checked to be working with a simple operations/list command.

But using sync/... commands returns the following "error": "couldn't find method \"sync/sync\"". Further, when executing rc/list, all the sync/... commands are missing. Did I miss the part of how to activate these? Or do i have the wrong commands? Relatively new to rclone, so sorry if this is a stupid question.

Run the command 'rclone version' and share the full output of the command.

Because of rc, here is the output of core/version:

RcloneRPCResult{Output:{
	"arch": "amd64",
	"decomposed": [
		1,
		70,
		0
	],
	"goTags": "none",
	"goVersion": "go1.23.3",
	"isBeta": true,
	"isGit": true,
	"linking": "dynamic",
	"os": "android",
	"version": "v1.70.0-DEV"
}

Which cloud storage system are you using? (eg Google Drive)

drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Gomobile.rcloneRPC("sync/sync", "{\"srcFs\":\"remote:secret_files\",\"dstFs\":\"ABSOLUTE_PATH\"}") 

Please run 'rclone config redacted' and share the full output. If you get

Not relevant

A log from the command that you were trying to run with the -vv flag

I don't know where I can access the logs under android.

If sounds like this import is missing

I'm not sure exactly what you compiled but hopefully that will give you a clue

Thanks for pointing me in the right direction, so I double-checked this location, and the line is there. But to make sure, I also cloned the repository again.

I have also tried to build the library directly from the git-url and locally. But the error persists.

gomobile bind -v -x -target=android -androidapi 33 -javapkg=org.rclone ~/rclone/librclone/gomobile
gomobile bind -v -x -target=android -androidapi 33 -javapkg=org.rclone github.com/rclone/rclone/librclone/gomobile

I noticed a few other commands are also missing, namely

  1. vfs/...,
  2. mount/... <- this makes sense, because android doesn't allow this.

Is there a pattern amongst those that I am unaware of?

Ok, I got it running, I fixed it by adding this line to the gomobile.go file

	_ "github.com/rclone/rclone/fs/sync"     // import sync/*

Even though I'm a complete beginner with go, this should (imo) be not necessary, but doesn't matter without this line the commands weren't added :person_shrugging:, maybe a bug with gomobile or my installation was just faulty

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.