[HealthPlugin] Fails when generating Android app

Forge Component
(3)
Published on 4 Apr by Sofia Mourato
3 votes
Published on 4 Apr by Sofia Mourato

Generating Android app fails on Outsystems 11 with the following error log:


==================================================

/tmp/build/source/platforms/android/src/org/apache/cordova/health/HealthPlugin.java:574: error: cannot find symbol
            builder.addScope(new Scope(Scopes.FITNESS_BLOOD_GLUCOSE_READ));
                                             ^
  symbol:   variable FITNESS_BLOOD_GLUCOSE_READ
  location: class Scopes
/opt/NativeBuilder/builds/5b5601f9-ff4d-4a06-950a-c6d746ee4d98/source/platforms/android/src/org/apache/cordova/health/HealthPlugin.java:576: error: cannot find symbol
            builder.addScope(new Scope(Scopes.FITNESS_BLOOD_GLUCOSE_READ_WRITE));
                                             ^
  symbol:   variable FITNESS_BLOOD_GLUCOSE_READ_WRITE
  location: class Scopes
/opt/NativeBuilder/builds/5b5601f9-ff4d-4a06-950a-c6d746ee4d98/source/platforms/android/src/org/apache/cordova/health/HealthPlugin.java:579: error: cannot find symbol
            builder.addScope(new Scope(Scopes.FITNESS_BLOOD_PRESSURE_READ));
                                             ^
  symbol:   variable FITNESS_BLOOD_PRESSURE_READ
  location: class Scopes
/opt/NativeBuilder/builds/5b5601f9-ff4d-4a06-950a-c6d746ee4d98/source/platforms/android/src/org/apache/cordova/health/HealthPlugin.java:581: error: cannot find symbol
            builder.addScope(new Scope(Scopes.FITNESS_BLOOD_PRESSURE_READ_WRITE));
                                             ^
  symbol:   variable FITNESS_BLOOD_PRESSURE_READ_WRITE
  location: class Scopes
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
Error: /opt/NativeBuilder/builds/5b5601f9-ff4d-4a06-950a-c6d746ee4d98/source/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/opt/NativeBuilder/builds/5b5601f9-ff4d-4a06-950a-c6d746ee4d98/source/platforms/android/src/org/apache/cordova/health/HealthPlugin.java:574: error: cannot find symbol
            builder.addScope(new Scope(Scopes.FITNESS_BLOOD_GLUCOSE_READ));
                                             ^
  symbol:   variable FITNESS_BLOOD_GLUCOSE_READ
  location: class Scopes
/opt/NativeBuilder/builds/5b5601f9-ff4d-4a06-950a-c6d746ee4d98/source/platforms/android/src/org/apache/cordova/health/HealthPlugin.java:576: error: cannot find symbol
            builder.addScope(new Scope(Scopes.FITNESS_BLOOD_GLUCOSE_READ_WRITE));
                                             ^
  symbol:   variable FITNESS_BLOOD_GLUCOSE_READ_WRITE
  location: class Scopes
/opt/NativeBuilder/builds/5b5601f9-ff4d-4a06-950a-c6d746ee4d98/source/platforms/android/src/org/apache/cordova/health/HealthPlugin.java:579: error: cannot find symbol
            builder.addScope(new Scope(Scopes.FITNESS_BLOOD_PRESSURE_READ));
                                             ^
  symbol:   variable FITNESS_BLOOD_PRESSURE_READ
  location: class Scopes
/opt/NativeBuilder/builds/5b5601f9-ff4d-4a06-950a-c6d746ee4d98/source/platforms/android/src/org/apache/cordova/health/HealthPlugin.java:581: error: cannot find symbol
            builder.addScope(new Scope(Scopes.FITNESS_BLOOD_PRESSURE_READ_WRITE));
                                             ^
  symbol:   variable FITNESS_BLOOD_PRESSURE_READ_WRITE
  location: class Scopes
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

[2018-10-02T15:20:51.735Z] [ERROR] Build failed with the following error: Error compiling Cordova plugin: org/apache/cordova/health/HealthPlugin.java:574: error: cannot find symbol.
[2018-10-02T15:20:51.735Z] [INFO] Remove debug/release signing properties
[2018-10-02T15:20:51.736Z] [INFO] Zipping application source...
[2018-10-02T15:21:06.082Z] [INFO] Application was not successfully generated!
[2018-10-02T15:21:06.082Z] [INFO] Execution time: 92413ms

Hi Denis,

This component was released for the platform version 10 and I didn't tested it on version 11 yet.
I'll try to do it as soon as I can and if I have news I'll let you know.

Kind regards,
Sofia

Thanks Sofia!

Hi Denis,

I was testing this in an OutSystems 11 environment and I had no issues on generating the app for an Android device. Nevertheless, I've just uploaded a new version of the component and its demo application to the Forge.

Please, try to use the latest version and check if the error persists.
You can download the demo application (HealthPlugin Demo) to test the core functionality and please, don't forget to read the "Details" tab that helps you with the keystore generation you need to generate the Android app.

Kind regards,
Sofia

Sofia Mourato wrote:

Hi Denis,

I was testing this in an OutSystems 11 environment and I had no issues on generating the app for an Android device. Nevertheless, I've just uploaded a new version of the component and its demo application to the Forge.

Please, try to use the latest version and check if the error persists.
You can download the demo application (HealthPlugin Demo) to test the core functionality and please, don't forget to read the "Details" tab that helps you with the keystore generation you need to generate the Android app.

Kind regards,
Sofia

Hi Sofia,

I had the same issue too. 

When I dereference the health plugin, I am able to regenerate my application.
However, when I reference it,  I will have the same error as above.

I have attached the log too. 

Thank you. 

Hi Olivier,

What's the app you're trying to generate? It's the demo app available on the Forge or other that you've created?
If it's a different app, can you share it with me so I can do some tests on my side?

Kind regards,
Sofia Mourato

Sofia Mourato wrote:

Hi Olivier,

What's the app you're trying to generate? It's the demo app available on the Forge or other that you've created?
If it's a different app, can you share it with me so I can do some tests on my side?

Kind regards,
Sofia Mourato

I was trying to generate the app that I have created. It was working previously.

The current app that I have now has nothing because I had deleted All health-related component. 

I can still send you though. In which format? OAP or OML? 

Hi Olivier,

Sorry for the late response.
Yes please send me the OAP, but with the health plugin implemented (and causing you the issue), so I can try to reproduce from my site.

Kind regards,
Sofia Mourato

Hi Sofia, 


I might have to send you at a later date as I am having an issue with my personal cloud storage.

I will get back to you once I have sorted out that. 


Regards,

Olivier Cheah