Build error - creating custom project

Hi all,

I am trying to use OpenRemote in my own project, but am having a little difficulties setting up the build environment. I followed the guide on wiki - creating custom projects, but when I try to build an empty project at the end with

$ ./gradlew clean installDist

I get an error regarding OpenRemote submodule generic_app - android:

FAILURE: Build failed with an exception.

* Where:
Build file '<new project root dir>/openremote/console/generic_app/android/build.gradle' line: 27

* What went wrong:
A problem occurred evaluating project ':openremote:console:generic_app:android'.
> Project with path ':app' could not be found in project ':openremote:console:generic_app:android:app'.

removing subproject generic_app build proceeds but gets stuck on some dependencies during yarnInstall, but problems are unrelated (dependencies issue taht are solved by coping openremote/yarn.lock file to /yarn.lock file).

Can you please help me with the mentioned problem in generic_app subproject?

BR

Hi fb,

I’m sorry to hear you’re stuck with the build process. It probably has to do with some missing gradle settings.
If you check out the the settings.gradle file, in the OpenRemote root folder, you see the the following part on line 4 ..."**/generic_app/**"])

Your settings.gradle file in the custom project should match. So it should look like this:

rootProject.name = "tue"

// Include sub-projects dynamically, every directory with a build.gradle (and no .buildignore)
fileTree(dir: rootDir, include: "**/build.gradle", excludes: ["**/node_modules/**", "**/generic_app/**"])
        .filter { it.parent != rootDir }
        .filter { !file("${it.parent}/.buildignore").exists() }
        .each {
    include it.parent.replace(rootDir.canonicalPath, "").replace("\\", ":").replace("/", ":")
}

I see the wiki should be updated to include the "**/generic_app/**" part. I will update that accordingly.

Good luck with your project!

Best Regards,
Michael

1 Like

First of all when I followed the “Creating Custom Project” verbatim I encountered an issue where Gradle could not find the task “:agent” in the “myextention1/build.gradle” line 6. I am new to gradle but I think I am figuring it out what its doing and I changed that to “:openremote:agent” and it worked.

Then when I got the clean to work and the installDist target to build the installDist target fails at around 63% specifically at “:yarnInstall” task more specifically at the below error point. Is it struggling to install those “polymer” related dependencies? I am a gradle noob and a basical level nodejs user and I am using a Windows 10 Machine with Docker Desktop.


> warning workspace-aggregator-5c9f8a42-c010-4219-a822-d0614bf01dee > demo > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated	
> error Couldn't find any versions for "@polymer/promise-polyfill" that matches "gloo"	
> info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.	
> Error: Couldn't find any versions for "@polymer/polymer" that matches "preview"	
>     at MessageError.ExtendableBuiltin (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:721:66)	
>     at new MessageError (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:750:123)	
>     at Function.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:50546:13)	
>     at Generator.next (<anonymous>)	
>     at step (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:310:30)	
>     at C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:321:13	
> Error: Couldn't find any versions for "@polymer/polymer" that matches "preview"	
>     at MessageError.ExtendableBuiltin (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:721:66)	
>     at new MessageError (C:\user\Peter\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:750:123)	
>     at Function.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:50546:13)	
>     at Generator.next (<anonymous>)	
>     at step (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:310:30)	
>     at C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:321:13	
> Error: Couldn't find any versions for "@polymer/polymer" that matches "preview"	
>     at MessageError.ExtendableBuiltin (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:721:66)	
>     at new MessageError (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:750:123)	
>     at Function.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:50546:13)	
>     at Generator.next (<anonymous>)	
>     at step (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:310:30)	
>     at C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:321:13	
> Error: Couldn't find any versions for "@polymer/polymer" that matches "preview"	
>     at MessageError.ExtendableBuiltin (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:721:66)	
>     at new MessageError (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:750:123)	
>     at Function.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:50546:13)	
>     at Generator.next (<anonymous>)	
>     at step (C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:310:30)