253
Views
30
Comments
[HealthPlugin] Fails when generating Android app
Question
Forge component by Sofia Mourato
4
Published on 18 Jul 2019

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

Staff
Rank: #52

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

Rank: #2881

Thanks Sofia!

Staff
Rank: #52

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

Staff
Rank: #52

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

Rank: #16956

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

Hey Sofia,


Any news regarding this topic?


I am also facing the same issue as Denis Mulder.


Regards,

Hey,


Sorry, the generation of the Keystore wasn't something straightforward, and that wasn't my problem after all.


I am able to generate the application as a sandbox. But once I get the plugin on the right application everything falls apart. After a lot of "try and error" I manage to discover another weird relation, once I added onesignal plugin dependencies I wasn't able to build the application anymore.

So, if everything goes separete it works as expected once I get both dependencies together I get the error that Denis described.


Unfortunately, I still don't have a solution, I will implement Rodrigo's suggestion, and I will get back to the thread.


Staff
Rank: #52

Hi Davide,

Ok it could be a dependency relationship issue then, which is not an easy thing to solve.
I'll also do some tests on my side and see if I can solve it.

Regards,
Sofia

Rank: #6010

Hey Sofia,


I can't say for sure, but i don't think so.

I'm using everything from your plugin with the exception of the cordova-plugin-health-master.zip resource. Same dependencies (CommonPlugin and System).

Regarding Davide's, i am also using the onesignal plugin and it works perfectly.


Regards,

Rodrigo

Staff
Rank: #52

Ok Rodrigo,

So the zip was to solve an issue with the previous MABS version, and probably we can now remove it and use the extensibility to the Git repository.
I'll review this when I have and let you know if there are updates.

Thank you

Staff
Rank: #52

Now it makes sense :)

Can you please try to use the extensibility with this URL (instead of the zip):
https://github.com/dariosalvi78/cordova-plugin-health.git

Please let me know if it worked.

Try this:

{
    "plugin" :{
        "url": "https://github.com/dariosalvi78/cordova-plugin-health.git"
    }
}

Same error.


I am trying with the newer version of the one signal the same thing.

Staff
Rank: #52

Can you please share with me the apps so I can test on my side?

Rank: #6010

Unfortunately, i can not, due to it not being a personal app..

Staff
Rank: #52

Hi Rodrigo,

That's great information!
I'll investigate that (as soon as I have some time) and try to have a new version of the component.

Thank you!

Regards,
Sofia

Rank: #12803

Hi Sofia,

Is there any updates on this.

Are you releasing a new plugin