14 Replies Latest reply on Jul 28, 2016 5:54 AM by fernandezh34561706

    Android compilation with Crosswalk is currently broken

    UncatCrea Level 1

      Hi,

      It appears that Android compilation with Crosswalk is currently broken. I get the following error when having <plugin name="cordova-plugin-crosswalk-webview" source="npm" /> in my config.xml:

       

      --------------------------------------------------------------------------------

      COMPILE OUTPUT

      --------------------------------------------------------------------------------

      Build option --'' not recognized (ignoring).

      Running: /project/gradlew cdvBuildDebug -b /project/build.gradle -Dorg.gradle.daemon=true -PcdvBuildMultipleApks=false

      null

      embedded

       

       

      FAILURE: Build failed with an exception.

       

       

      * Where:

      Script '/project/cordova-plugin-crosswalk-webview/q_android-xwalk.gradle' line: 77

       

       

      * What went wrong:

      A problem occurred evaluating script.

      > Could not find property 'xwalkMultipleApk' on root project 'project'.

       

       

      * Try:

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

       

      It's a blocker for me. Thank you in advance :-\

        • 1. Re: Android compilation with Crosswalk is currently broken
          martinb77004568 Level 1

          How about using

          <gap:plugin name='org.crosswalk.engine' version='1.3.0' source='pgb' />
          

          ?

           

          It is a pretty old version but should work (@PGB team: Many of us need crosswalk - why is there no official update?).

          • 2. Re: Android compilation with Crosswalk is currently broken
            UncatCrea Level 1

            Thank you. I've been able to compile with the spec attribute set to 1.5.0 (I use npm as source).

            • 3. Re: Android compilation with Crosswalk is currently broken
              UncatCrea Level 1

              Hi. I've done some tests and it appears that compilation with any CrossWalk version superior to 1.5.0 still won't work. Is there a plan to support latest CrossWalk versions on PGB? Thank you in advance

              • 4. Re: Android compilation with Crosswalk is currently broken
                martinb77004568 Level 1

                What do you mean by "still won't work"? Are you getting the same error messages again or a different one?

                 

                I have managed to use a later version of crosswalk using the following settings. Please note that I haven't tested this in a while but it worked 2 months ago :-) Maybe you will need to do some minor changes but I think we will get this working...

                 

                <plugin name="cordova-plugin-crosswalk-webview" source="npm" version="1.7.0" />
                <preference name="xwalkMultipleApk" value="true" />    
                <plugin name="cordova-build-architecture" spec="https://github.com/MBuchalik/cordova-build-architecture.git#v1.0.1" source="git" />
                <preference name="android-versionCode" value="1" />
                
                • 5. Re: Android compilation with Crosswalk is currently broken
                  UncatCrea Level 1

                  Thank you for your answer. I've done a test modifying my config.xml with the elements you gave. Unfortunatly, it has failed. It gave the following error:

                   

                  FAILURE: Build failed with an exception.

                   

                  * Where:

                  Script '/project/cordova-plugin-crosswalk-webview/q_plus_android-xwalk.gradle' line: 73

                   

                  * What went wrong:

                  A problem occurred evaluating script.

                  > Could not find property 'xwalkMultipleApk' on root project 'project'.

                   

                  * Try:

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

                   

                  BUILD FAILED

                  • 6. Re: Android compilation with Crosswalk is currently broken
                    martinb77004568 Level 1

                    I have tried it again and it works for me (have only tested it without signing).

                    Does this error still occur if you remove all unnecessary plugins and settings? Could you maybe post your new config.xml here (without personal data :-) ?

                     

                    What version of PGB are you using? I have tried it with:

                    <preference name='phonegap-version' value='cli-6.0.0' />
                    <preference name="android-build-tool" value="gradle" />
                    
                    • 7. Re: Android compilation with Crosswalk is currently broken
                      UncatCrea Level 1

                      Sure. Here's the config.xml file I use for my tests.

                       

                      <?xml version="1.0" encoding="UTF-8" ?>
                      <widget xmlns       = "http://www.w3.org/ns/widgets"
                              xmlns:gap   = "http://phonegap.com/ns/1.0"
                              id          = "com.uncatcrea.q-plus-android"
                              version     = "1.0.0"
                              android-versionCode = "14" >
                      
                      
                        <name>Q+ Test App (Android)</name>
                      
                      
                        <description>Q+ Test App (Android) - Compiled by Benjamin</description>
                      
                      
                        <author href="http://uncatcrea.com" email="uncategorized.creations@gmail.com">Uncatcrea</author>
                      
                      
                        <gap:platform name="android" />
                        <preference name="android-build-tool" value="gradle" />
                        <preference name="permissions" value="none"/>
                        <preference name="disallowOverscroll" value="true" />
                        <preference name="webviewbounce" value="false" />
                      
                      
                        <!-- PhoneGap plugin declaration -->
                        <plugin name="cordova-plugin-inappbrowser" source="npm" />
                        <plugin name="cordova-plugin-network-information" source="npm" />
                        <plugin name="cordova-plugin-whitelist" source="npm" />
                        <plugin name="cordova-plugin-splashscreen" source="npm" />
                        <plugin name="cordova-plugin-device" source="npm" />
                        <plugin name="cordova-plugin-statusbar" source="npm" />
                        <plugin name="cordova-plugin-x-socialsharing" spec="5.0.12" source="npm" />
                      
                      
                        <!-- Whitelist policy  -->
                        <access origin="*" />
                        <allow-intent href="*" />
                        <allow-navigation href="*" />
                      
                      
                        <!-- SplashScreen configuration -->
                        <preference name="SplashScreen" value="splash" />
                        <preference name="SplashScreenDelay" value="10000" />
                        <preference name="FadeSplashScreenDuration" value="300" />
                        <preference name="ShowSplashScreenSpinner" value="false" />
                      
                      
                        <!-- Icons and Splashscreens declaration -->
                      
                      
                        <icon src="icon.png" gap:platform="android" />
                        <icon src="icons/icon-wp-appkit-ldpi.png" gap:platform="android" gap:qualifier="ldpi" />
                        <icon src="icons/icon-wp-appkit-mdpi.png" gap:platform="android" gap:qualifier="mdpi" />
                        <icon src="icons/icon-wp-appkit-hdpi.png" gap:platform="android" gap:qualifier="hdpi" />
                        <icon src="icons/icon-wp-appkit-xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />
                        <icon src="icons/icon-wp-appkit-xxhdpi.png" gap:platform="android" gap:qualifier="xxhdpi" />
                        <icon src="icons/icon-wp-appkit-xxxhdpi.png" gap:platform="android" gap:qualifier="xxxhdpi" />
                      
                        <gap:splash src="splash.9.png" gap:platform="android" />
                        <gap:splash src="splashscreens/splashscreen-wp-appkit-ldpi.9.png" gap:platform="android" gap:qualifier="ldpi" />
                        <gap:splash src="splashscreens/splashscreen-wp-appkit-mdpi.9.png" gap:platform="android" gap:qualifier="mdpi" />
                        <gap:splash src="splashscreens/splashscreen-wp-appkit-hdpi.9.png" gap:platform="android" gap:qualifier="hdpi" />
                        <gap:splash src="splashscreens/splashscreen-wp-appkit-xhdpi.9.png" gap:platform="android" gap:qualifier="xhdpi" />
                        <gap:splash src="splashscreens/splashscreen-wp-appkit-xxhdpi.9.png" gap:platform="android" gap:qualifier="xxhdpi" />
                        <gap:splash src="splashscreens/splashscreen-wp-appkit-xxxhdpi.9.png" gap:platform="android" gap:qualifier="xxxhdpi" />
                      
                      
                          <!-- Testing CrossWalk -->
                          <plugin name="cordova-plugin-crosswalk-webview" source="npm" version="1.7.0" />  
                          <preference name="xwalkMultipleApk" value="true" />      
                          <plugin name="cordova-build-architecture" spec="https://github.com/MBuchalik/cordova-build-architecture.git#v1.0.1" source="git" />  
                          <preference name="android-versionCode" value="1" />  
                          
                      
                      
                          
                      </widget>
                      
                      • 8. Re: Android compilation with Crosswalk is currently broken
                        VectorP Level 4

                        You can't have

                        android-versionCode = "14"

                        as an attribute of the widget root.

                        In Phonegap Build, it's specified as a preference.

                        • 9. Re: Android compilation with Crosswalk is currently broken
                          UncatCrea Level 1

                          OK. I have deleted the android-versionCode attribute to android-versionCode preference and I got the same error.

                          • 10. Re: Android compilation with Crosswalk is currently broken
                            martinb77004568 Level 1

                            You can actually set the android versionCode attribute in the widget root. It's simply called "versionCode". But remember that, on PGB, the versionCode is slightly modified (I think an "8" is added to your number).

                             

                            Please try to compile with sth like cli-6.0.0 like in my post above:

                            <preference name='phonegap-version' value='cli-6.0.0' />
                            

                             

                            Does that help?

                            • 11. Re: Android compilation with Crosswalk is currently broken
                              UncatCrea Level 1

                              Unfortunatly no. I've added the following to my config.xml:

                               

                              `<plugin name="cordova-plugin-crosswalk-webview" source="npm" version="1.7.0" /> 

                              <preference name='phonegap-version' value='cli-6.0.0' />`

                               

                              Compilation still craches (below output).

                               

                              I am going to retry your original answer later

                               

                              `

                              null

                              Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.

                              java.lang.IllegalStateException: buildToolsVersion is not specified.

                                at com.google.common.base.Preconditions.checkState(Preconditions.java:176)

                                at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:599)

                                at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:566)

                                at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:563)

                                at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)

                                at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)

                                at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:562)

                                at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:559)

                                at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch. java:109)

                                at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch. java:98)

                                at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)

                                at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)

                                at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(Pr oxyDispatchAdapter.java:93)

                                at com.sun.proxy.$Proxy13.afterEvaluate(Unknown Source)

                                at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleP rojectEvaluator.java:79)

                                at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvalu ator.java:65)

                                at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:504)

                                at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:83)

                                at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator .java:42)

                                at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)

                                at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java: 129)

                                at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)

                                at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)

                                at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProces sBuildActionExecuter.java:80)

                                at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)

                                at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)

                                at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecute r.java:36)

                                at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecute r.java:26)

                                at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:47)

                                at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)

                                at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecut ion.java:119)

                                at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnectio n.java:35)

                                at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecut ion.java:119)

                                at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLog ger.java:24)

                                at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecut ion.java:119)

                                at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAn dStop.java:33)

                                at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecut ion.java:119)

                                at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java: 71)

                                at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java: 69)

                                at org.gradle.util.Swapper.swap(Swapper.java:38)

                                at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java :69)

                                at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecut ion.java:119)

                                at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)

                                at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)

                                at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecut ion.java:119)

                                at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEn vironment.java:70)

                                at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)

                                at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecut ion.java:119)

                                at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.ja va:39)

                                at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecut ion.java:119)

                                at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrResp ondWithBusy.java:46)

                                at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.jav a:246)

                                at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(Default ExecutorFactory.java:64)

                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                                at java.lang.Thread.run(Thread.java:745)

                               

                               

                              FAILURE: Build failed with an exception.

                               

                               

                              * Where:

                              Script '/project/cordova-plugin-crosswalk-webview/q_plus_android-xwalk.gradle' line: 73

                               

                               

                              * What went wrong:

                              A problem occurred evaluating script.

                              > Could not find property 'xwalkMultipleApk' on root project 'project'.

                               

                               

                              * Try:

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

                               

                               

                              BUILD FAILED`

                              • 12. Re: Android compilation with Crosswalk is currently broken
                                martinb77004568 Level 1

                                You will need to add everything we discussed before.

                                 

                                So:

                                <preference name='phonegap-version' value='cli-6.0.0' />
                                <plugin name="cordova-plugin-crosswalk-webview" source="npm" version="1.7.0" />  
                                <preference name="android-versionCode" value="1" />
                                

                                 

                                For some reason, you need to add android-versionCode. Otherwise, the app won't compile.

                                 

                                If you want to output the ARM version only, add

                                <preference name="xwalkMultipleApk" value="true" />      
                                <plugin name="cordova-build-architecture" spec="https://github.com/MBuchalik/cordova-build-architecture.git#v1.0.1" source="git" />
                                

                                 

                                The first preferece tells crosswalk to output multiple APKs (one for ARM and one for x86). Since you can only download one single file on PGB, you need some way to specify what you want. By default, PGB outputs the ARM version if your app is not signed. If you sign it, it outputs the x86 version. Don't ask why - I have no idea.

                                 

                                That's the reason why I wrote the (experimental - it seems to work at the moment) plugin you find on GitHub. It allows you to force gradle to build the x86 or ARM version.

                                • 13. Re: Android compilation with Crosswalk is currently broken
                                  UncatCrea Level 1

                                  Beautiful! I've just did a successful compilation with Crosswalk 1.7.0 using phonegap-version and android-versionCode preferences. Thank you very much martinb77004568 :-)

                                   

                                  I am not sure to get it properly about ARM and x86 builds but I am going to search a little bit about that too.

                                   

                                  Again, thank you.

                                  • 14. Re: Android compilation with Crosswalk is currently broken
                                    fernandezh34561706

                                    One of your plugins required the gradle android build tool to build.

                                     

                                    I have added the  <preference name="android-build-tool" value="gradle" /> and phonegap version in cli5.2.0

                                     

                                    Still unable to build the app

                                     

                                    Can some one please help.