thaliproject / postcardapp

A sample app to demonstrate how to build Thali applications
MIT License
22 stars 5 forks source link

Story_001_dadougla build failed #119

Closed tongkolizer closed 8 years ago

tongkolizer commented 8 years ago

Hi,

Tried replicating from this branch since I want to use the one with the camera plugin but it seems like I can't build it again. below are the errors that returned while building on Android. I just followed the instructions from readme.

:compileDebugJavaWithJavacC:\Users\Imman\test\postcardapp\platforms\android\src\io\jxcore\node\JXcoreExtension.java:38: error: cannot find symbol
        final ConnectionHelper mConnectionHelper = new ConnectionHelper();
              ^
  symbol:   class ConnectionHelper
  location: class JXcoreExtension
C:\Users\Imman\test\postcardapp\platforms\android\src\io\jxcore\node\JXcoreExtension.java:38: error: cannot find symbol
        final ConnectionHelper mConnectionHelper = new ConnectionHelper();
                                                       ^
  symbol:   class ConnectionHelper
  location: class JXcoreExtension
C:\Users\Imman\test\postcardapp\platforms\android\src\io\jxcore\node\JXcoreExtension.java:265: error: package ConnectionHelper does not exist
              mConnectionHelper.connect(address, new ConnectionHelper.JxCoreExtensionListener() {
                                                                     ^
C:\Users\Imman\test\postcardapp\platforms\android\src\io\jxcore\node\JXcoreExtension.java:278: error: cannot find symbol
      final LifeCycleMonitor mLifeCycleMonitor = new LifeCycleMonitor(new LifeCycleMonitor.onLCEventCallback() {
            ^
  symbol:   class LifeCycleMonitor
  location: class JXcoreExtension
C:\Users\Imman\test\postcardapp\platforms\android\src\io\jxcore\node\JXcoreExtension.java:278: error: cannot find symbol
      final LifeCycleMonitor mLifeCycleMonitor = new LifeCycleMonitor(new LifeCycleMonitor.onLCEventCallback() {
                                                     ^
  symbol:   class LifeCycleMonitor
  location: class JXcoreExtension
C:\Users\Imman\test\postcardapp\platforms\android\src\io\jxcore\node\JXcoreExtension.java:278: error: package LifeCycleMonitor does not exist
      final LifeCycleMonitor mLifeCycleMonitor = new LifeCycleMonitor(new LifeCycleMonitor.onLCEventCallback() {
                                                                                          ^
6 errors
 FAILED

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.

BUILD FAILED

Total time: 10.504 secs
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"C:\Users\Imman\test\postcardapp\platforms\android\gradlew cdvBuildDebug -b C:\Users\Imman\test\postcardapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,"C:\Users\Imman\test\postcardapp\platforms\android\gradlew cdvBuildDebug -b C:\Users\Imman\test\postcardapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
deadlyfingers commented 8 years ago

@tongkolizer I see you got it working, what was causing this issue?

deadlyfingers commented 8 years ago

If you get an error with You may not have the required environment or OS to build this project this maybe caused by one of the plugins requiring a new android min sdk version. I fixed this by adding 'android-minSdkVersion' to 16 in the cordova config.xml

    <platform name="android">
        <preference name="android-minSdkVersion" value="16" />

Also worth noting if you get 'Unable to add' error .gz': file already in archive because of a 'jx npm install' then you will have to delete the .gz files before you can compile for Android. I use the following command to remove all .gz files inside the cordova build directory:

find ./www/jxcore -name "*.gz" -type f -delete
deadlyfingers commented 8 years ago

I have pushed an android min sdk fix for 'You may not have the required environment' error into the branch so I think we can close this issue...

tongkolizer commented 8 years ago

Yep Thanks @deadlyfingers!