[HealthPlugin] Fails when generating Android app

[HealthPlugin] Fails when generating Android app

  
Forge Component
(3)
Published on 15 Oct by Sofia Mourato
3 votes
Published on 15 Oct 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