1 2 Previous Next 16 Replies Latest reply on May 14, 2014 2:01 AM by csa

    Errai-tutorial - mobile error

    jdestef

      Hi,

       

      Was trying to get the errai-tutorial (errai/errai-tutorial · GitHub) mobile app working. I was able to get the app built and running locally on JBoss. When I compile for mobile deployment (mvn clean package -Pmobile,jboss7) I was able to get an Android apk built. I did change the App.class and Config.class to point to where the server part of the app is running. When I installed on the phone and tried to open the app I got a dialog with the following message: Alert [ERROR] Error initializing Cordova: Class not found. Anybody else run into this issue?

       

       

       

      Thanks

        • 1. Re: Errai-tutorial - mobile error
          csa

          Hi John,

           

          I just pushed a fix for this.

           

          Please update to the latest 3.0-SNAPSHOT of errai-cordova. Then running mvn clean package -Pmobile,jboss7 -Dplatform=android should fix the problem.

           

          Cheers,

          Christian

          • 2. Re: Errai-tutorial - mobile error
            jdestef

            Hi Christian,

             

            Thanks for getting back to me. The error dialog doesn't pop up any more, but the app still doesn't run. The background loads but none of the widgets show up. It does work in a desktop browser. When I try to run on the phones mobile browser (Chrome) I get a pop up with the following message:

             

            The page at 192.168.0.14:8080 says:

             

            gap:["PluginManager","startup","PluginManager26324857"]

             

            The background then loads but not the form.

             

            I got the following output when I hooked the android debugger up to the phone and ran the native app. There is a line about the cordova.js script tag which I highlighted. Wondering if this might have something to do with the issue: 

             

            05-09 14:04:27.763: E/SELinux(15204): Function: selinux_android_load_priority [0], There is no sepolicy file

            05-09 14:04:27.763: E/SELinux(15204): 

            05-09 14:04:27.763: E/SELinux(15204): Function: selinux_android_load_priority [1], There is no sepolicy version file

            05-09 14:04:27.763: E/SELinux(15204): 

            05-09 14:04:27.763: E/SELinux(15204): Function: selinux_android_load_priority , loading version is VE=SEPF_SM-N900V_4.3_0012

            05-09 14:04:27.763: E/SELinux(15204): 

            05-09 14:04:27.763: E/SELinux(15204): 

            05-09 14:04:27.763: E/SELinux(15204): selinux_android_seapp_context_reload: seapp_contexts file is loaded from /seapp_contexts

            05-09 14:04:27.763: D/dalvikvm(15204): Late-enabling CheckJNI

            05-09 14:04:27.783: D/dalvikvm(15204): Debugger has detached; object registry had 1 entries

            05-09 14:04:27.813: W/ActivityThread(15204): Application io.cordova.hellocordova can be debugged on port 8100...

            05-09 14:04:27.843: I/dalvikvm(15204): Could not find method org.apache.cordova.CordovaWebView.setWebContentsDebuggingEnabled, referenced from method org.apache.cordova.CordovaWebView.setup

            05-09 14:04:27.843: W/dalvikvm(15204): VFY: unable to resolve static method 2326: Lorg/apache/cordova/CordovaWebView;.setWebContentsDebuggingEnabled (Z)V

            05-09 14:04:27.843: D/dalvikvm(15204): VFY: replacing opcode 0x71 at 0x00be

            05-09 14:04:27.873: I/webclipboard(15204): clipservice: android.sec.clipboard.ClipboardExManager@42ba2a78

            05-09 14:04:27.883: D/CordovaWebView(15204): CordovaWebView is running on device made by: samsung

            05-09 14:04:27.883: D/JsMessageQueue(15204): Set native->JS mode to 2

            05-09 14:04:27.883: D/JSENGINE(15204): qualcomm.jsengine.version:C.2-patch35-git:7b7ad6f

            05-09 14:04:27.893: D/WebView(15204): loadUrlImpl: called

            05-09 14:04:27.903: E/webview(15204): registerForStylusPenEvent onAttachedToWindow

            05-09 14:04:27.903: E/webview(15204): registerForStylusPenEvent START

            05-09 14:04:27.913: E/webview(15204): registerForStylusPenEvent END

            05-09 14:04:27.913: D/webcore(15204):  CORE loadUrl: called

            05-09 14:04:27.913: D/webkit(15204): Firewall not null

            05-09 14:04:27.913: D/webkit(15204): euler: isUrlBlocked = false

            05-09 14:04:27.933: D/libEGL(15204): loaded /vendor/lib/egl/libEGL_adreno.so

            05-09 14:04:27.933: D/libEGL(15204): loaded /vendor/lib/egl/libGLESv1_CM_adreno.so

            05-09 14:04:27.933: D/libEGL(15204): loaded /vendor/lib/egl/libGLESv2_adreno.so

            05-09 14:04:27.933: I/Adreno-EGL(15204): <qeglDrvAPI_eglInitialize:316>: EGL 1.4 QUALCOMM build: RVADDULA_AU_LINUX_ANDROID_JB_3.1.2.04.03.00.125.077+PATCH[ES]_msm8974_JB_3.1.2_CL3851443_release_ENGG (CL3851443)

            05-09 14:04:27.933: I/Adreno-EGL(15204): OpenGL ES Shader Compiler Version: 17.01.10.SPL

            05-09 14:04:27.933: I/Adreno-EGL(15204): Build Date: 08/22/13 Thu

            05-09 14:04:27.933: I/Adreno-EGL(15204): Local Branch:

            05-09 14:04:27.933: I/Adreno-EGL(15204): Remote Branch: quic/jb_3.1

            05-09 14:04:27.933: I/Adreno-EGL(15204): Local Patches: 9e903e17860d2a01d2699c1be9415e1bd9fec649 Track the dirty rect list even when preserve_swaps is turned off. This helps preserve to work as expected on frame 2 after a resize.

            05-09 14:04:27.933: I/Adreno-EGL(15204):                  765a3562222e76c73e79a6cc1a27e0b843bcea83 Revert "RB

            05-09 14:04:27.983: D/OpenGLRenderer(15204): Enabling debug mode 0

            05-09 14:04:27.983: D/WebView(15204): onSizeChanged - w:1080 h:1845

            05-09 14:04:28.183: E/Web Console(15204): Uncaught TypeError: undefined is not a function:6

            05-09 14:04:28.213: I/GATE(15204): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>

            05-09 14:04:28.213: D/CallbackProxy(15204): sendMessageToUiThreadSync Package=io.cordova.hellocordova message=103

            05-09 14:04:28.213: D/WebCore(15204): uiOverrideUrlLoading: shouldOverrideUrlLoading() returnsfalse

            05-09 14:04:28.863: I/Web Console(15204): 14:04:28 INFO [InitVotes] wait for: org.jboss.errai.marshalling.client.api.MarshallerFramework:3117

            05-09 14:04:28.883: I/Web Console(15204): 14:04:28 INFO [InitVotes] vote for: org.jboss.errai.marshalling.client.api.MarshallerFramework:3117

            05-09 14:04:28.983: I/Web Console(15204): 14:04:28 INFO [ClientMessageBusImpl] bus initialization started ...:3117

            05-09 14:04:29.003: I/Web Console(15204): 14:04:29 INFO [InitVotes] wait for: org.jboss.errai.bus.client.api.ClientMessageBus:3117

            05-09 14:04:29.013: I/Web Console(15204): 14:04:29 INFO [Container] IOC bootstrapper successfully initialized.:3117

            05-09 14:04:29.043: I/Web Console(15204): 14:04:29 INFO [InitVotes] wait for: org.jboss.errai.ui.cordova.CordovaProducer:3117

            05-09 14:04:29.123: I/Web Console(15204): Could not find cordova.js script tag. Plugin loading may fail.:1548

            05-09 14:04:29.483: I/Web Console(15204): 14:04:29 INFO [Container] 32 beans successfully deployed.:3117

            05-09 14:04:29.483: I/Web Console(15204): 14:04:29 INFO [Container] bean manager now in service.:3117

            05-09 14:04:29.493: I/Web Console(15204): 14:04:29 INFO [CDIClientBootstrap] declare CDI dispatch service:3117

            05-09 14:04:29.493: I/Web Console(15204): 14:04:29 INFO [InitVotes] wait for: org.jboss.errai.enterprise.client.cdi.api.CDI:3117

            05-09 14:04:29.503: D/chromium(15204): Unknown chromium error: -6

            05-09 14:04:29.583: I/Web Console(15204): 14:04:29 INFO [ClientMessageBusImpl] sending handshake message to remote bus:3117

            05-09 14:04:29.613: I/Web Console(15204): 14:04:29 INFO [LocationAwareClientMessageBus] url end point http://192.168.0.14:8080/errai-tutorial/:3117

            05-09 14:04:29.663: D/TilesManager(15204): Starting TG #0, 0x74f34520

            05-09 14:04:29.663: D/TilesManager(15204): new EGLContext from framework: 75f2b040

            05-09 14:04:29.663: D/GLWebViewState(15204): Reinit shader

            05-09 14:04:29.683: D/GLWebViewState(15204): Reinit transferQueue

            05-09 14:04:29.693: I/Web Console(15204): 14:04:29 SEVERE [LogConfiguration] (TypeError) : Cannot read property 'uuid' of undefined:3117

            05-09 14:04:30.193: I/Web Console(15204): 14:04:30 INFO [ClientMessageBusImpl$ProtocolCommandProcessor] my queue session id: e547a9fdc76e12ba4f4a4615fe6e4077b7888cb6d1272e573ff3f7a882ba1c15:3117

            05-09 14:04:30.203: I/Web Console(15204): 14:04:30 INFO [LocationAwareClientMessageBus] url end point http://192.168.0.14:8080/errai-tutorial/:3117

            05-09 14:04:30.213: I/Web Console(15204): 14:04:30 INFO [ClientMessageBusImpl] transitioning to new handler: SSE[343]:3117

            05-09 14:04:30.233: I/Web Console(15204): 14:04:30 INFO [InitVotes] vote for: org.jboss.errai.bus.client.api.ClientMessageBus:3117

            05-09 14:04:30.243: I/Web Console(15204): 14:04:30 INFO [CDIClientBootstrap] CDI subsystem syncing with server ...:3117

            05-09 14:04:30.263: I/Web Console(15204): 14:04:30 INFO [LocationAwareClientMessageBus] url end point http://192.168.0.14:8080/errai-tutorial/:3117

            05-09 14:04:30.273: I/Web Console(15204): 14:04:30 INFO [CDI] requested server to forward CDI events for 0 existing observers:3117

            05-09 14:04:30.293: I/Web Console(15204): 14:04:30 INFO [InitVotes]   still waiting for -> [org.jboss.errai.ui.cordova.CordovaProducer, org.jboss.errai.enterprise.client.cdi.api.CDI]:3117

            05-09 14:04:30.293: I/Web Console(15204): 14:04:30 INFO [ClientMessageBusImpl$ProtocolCommandProcessor] bus federated and running.:3117

            05-09 14:04:30.303: I/Web Console(15204): 14:04:30 INFO [LocationAwareClientMessageBus] url end point http://192.168.0.14:8080/errai-tutorial/:3117

            05-09 14:04:30.313: I/Web Console(15204): SSE channel opened (according to the browser):2820

            05-09 14:04:30.333: I/Web Console(15204): 14:04:30 INFO [CDI] activated CDI eventing subsystem.:3117

            05-09 14:04:30.333: I/Web Console(15204): 14:04:30 INFO [InitVotes] vote for: org.jboss.errai.enterprise.client.cdi.api.CDI:3117

            05-09 14:04:30.333: I/Web Console(15204): 14:04:30 INFO [InitVotes]   still waiting for -> [org.jboss.errai.ui.cordova.CordovaProducer]:3117

            05-09 14:04:30.343: I/Web Console(15204): 14:04:30 INFO [LocationAwareClientMessageBus] url end point http://192.168.0.14:8080/errai-tutorial/:3117

            05-09 14:04:30.353: I/Web Console(15204): 14:04:30 INFO [SSEHandler] SSE[343]: SSE channel is active.:3117

            05-09 14:05:13.853: I/Web Console(15204): 14:05:13 SEVERE [InitVotes] components failed to initialize:3117

            05-09 14:05:13.883: I/Web Console(15204): 14:05:13 SEVERE [InitVotes]    [failed] -> org.jboss.errai.ui.cordova.CordovaProducer:3117

            • 3. Re: Errai-tutorial - mobile error
              csa

              Hi John,

               

              OK that's strange. Thanks for sharing the debug output. I will try to reproduce this.

               

              Cheers,

              Christian

              • 4. Re: Errai-tutorial - mobile error
                csa

                Hi John,

                 

                I was able to reproduce the problem and just pushed a fix for it.

                 

                You need to replace your config.xml file with this one: https://github.com/errai/errai-tutorial/blob/master/src/main/webapp/config.xml

                 

                Then simply adding -U (to update your 3.0-SNAPSHOTs) will fix it:  mvn clean package -Pmobile,jboss7 -U

                 

                Cheers,

                Christian

                • 5. Re: Errai-tutorial - mobile error
                  jdestef

                  Hi Christian,

                   

                  Thanks for looking at this. I got a little farther but still not working. I re-downloaded the errai-tutorial project. Changed the App and Config class to point to my ip address. Checked that I could access that address on my phones browser. I rebuilt the app as you instructed above and deployed to the app server on my machine. Ran it locally and it worked fine. I deployed the apk to my phone and tried to run the app. This time the splash screen loaded but the first page of the app did not. It just stayed on the splash screen. The debugger had the following output:

                   

                  05-13 10:40:17.744: E/SELinux(17502): Function: selinux_android_load_priority [0], There is no sepolicy file

                  05-13 10:40:17.744: E/SELinux(17502): 

                  05-13 10:40:17.744: E/SELinux(17502): Function: selinux_android_load_priority [1], There is no sepolicy version file

                  05-13 10:40:17.744: E/SELinux(17502): 

                  05-13 10:40:17.744: E/SELinux(17502): Function: selinux_android_load_priority , loading version is VE=SEPF_SM-N900V_4.3_0012

                  05-13 10:40:17.744: E/SELinux(17502): 

                  05-13 10:40:17.744: E/SELinux(17502): 

                  05-13 10:40:17.744: E/SELinux(17502): selinux_android_seapp_context_reload: seapp_contexts file is loaded from /seapp_contexts

                  05-13 10:40:17.754: D/dalvikvm(17502): Late-enabling CheckJNI

                  05-13 10:40:17.764: D/dalvikvm(17502): Debugger has detached; object registry had 1 entries

                  05-13 10:40:17.814: W/ActivityThread(17502): Application io.cordova.hellocordova can be debugged on port 8100...

                  05-13 10:40:17.824: I/CordovaLog(17502): Changing log level to DEBUG(3)

                  05-13 10:40:17.824: D/CordovaActivity(17502): CordovaActivity.onCreate()

                  05-13 10:40:17.834: I/dalvikvm(17502): Could not find method org.apache.cordova.CordovaWebView.setWebContentsDebuggingEnabled, referenced from method org.apache.cordova.CordovaWebView.setup

                  05-13 10:40:17.834: W/dalvikvm(17502): VFY: unable to resolve static method 2373: Lorg/apache/cordova/CordovaWebView;.setWebContentsDebuggingEnabled (Z)V

                  05-13 10:40:17.834: D/dalvikvm(17502): VFY: replacing opcode 0x71 at 0x00be

                  05-13 10:40:17.864: I/webclipboard(17502): clipservice: android.sec.clipboard.ClipboardExManager@42c15f70

                  05-13 10:40:17.884: D/CordovaWebView(17502): CordovaWebView is running on device made by: samsung

                  05-13 10:40:17.884: D/JSENGINE(17502): qualcomm.jsengine.version:C.2-patch35-git:7b7ad6f

                  05-13 10:40:17.884: D/JsMessageQueue(17502): Set native->JS mode to 2

                  05-13 10:40:17.884: D/CordovaActivity(17502): CordovaActivity.init()

                  05-13 10:40:17.894: D/CordovaWebView(17502): >>> loadUrl(file:///android_asset/www/index.html)

                  05-13 10:40:17.894: D/PluginManager(17502): init()

                  05-13 10:40:17.894: D/CordovaWebView(17502): >>> loadUrlNow()

                  05-13 10:40:17.904: D/WebView(17502): loadUrlImpl: called

                  05-13 10:40:17.904: V/webkit(17502): BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {42c138a0}

                  05-13 10:40:17.904: I/CordovaLog(17502): Found start page location: index.html

                  05-13 10:40:17.904: D/Whitelist(17502): Unlimited access to network resources

                  05-13 10:40:17.904: I/CordovaLog(17502): Changing log level to DEBUG(3)

                  05-13 10:40:17.904: D/CordovaActivity(17502): Resuming the App

                  05-13 10:40:17.904: D/CordovaActivity(17502): CB-3064: The errorUrl is null

                  05-13 10:40:17.904: D/webcore(17502):  CORE loadUrl: called

                  05-13 10:40:17.904: D/webkit(17502): Firewall not null

                  05-13 10:40:17.904: D/webkit(17502): euler: isUrlBlocked = false

                  05-13 10:40:17.924: D/CordovaActivity(17502): onMessage(onPageStarted,file:///android_asset/www/index.html)

                  05-13 10:40:17.924: E/webview(17502): registerForStylusPenEvent onAttachedToWindow

                  05-13 10:40:17.924: E/webview(17502): registerForStylusPenEvent START

                  05-13 10:40:17.924: E/webview(17502): registerForStylusPenEvent END

                  05-13 10:40:17.934: D/SoftKeyboardDetect(17502): Ignore this event

                  05-13 10:40:17.954: D/libEGL(17502): loaded /vendor/lib/egl/libEGL_adreno.so

                  05-13 10:40:17.954: D/libEGL(17502): loaded /vendor/lib/egl/libGLESv1_CM_adreno.so

                  05-13 10:40:17.954: D/libEGL(17502): loaded /vendor/lib/egl/libGLESv2_adreno.so

                  05-13 10:40:17.954: I/Adreno-EGL(17502): <qeglDrvAPI_eglInitialize:316>: EGL 1.4 QUALCOMM build: RVADDULA_AU_LINUX_ANDROID_JB_3.1.2.04.03.00.125.077+PATCH[ES]_msm8974_JB_3.1.2_CL3851443_release_ENGG (CL3851443)

                  05-13 10:40:17.954: I/Adreno-EGL(17502): OpenGL ES Shader Compiler Version: 17.01.10.SPL

                  05-13 10:40:17.954: I/Adreno-EGL(17502): Build Date: 08/22/13 Thu

                  05-13 10:40:17.954: I/Adreno-EGL(17502): Local Branch:

                  05-13 10:40:17.954: I/Adreno-EGL(17502): Remote Branch: quic/jb_3.1

                  05-13 10:40:17.954: I/Adreno-EGL(17502): Local Patches: 9e903e17860d2a01d2699c1be9415e1bd9fec649 Track the dirty rect list even when preserve_swaps is turned off. This helps preserve to work as expected on frame 2 after a resize.

                  05-13 10:40:17.954: I/Adreno-EGL(17502):                  765a3562222e76c73e79a6cc1a27e0b843bcea83 Revert "RB

                  05-13 10:40:17.994: D/OpenGLRenderer(17502): Enabling debug mode 0

                  05-13 10:40:17.994: D/WebView(17502): onSizeChanged - w:1080 h:1845

                  05-13 10:40:18.024: I/GATE(17502): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>

                  05-13 10:40:18.034: D/SoftKeyboardDetect(17502): Ignore this event

                  05-13 10:40:18.054: D/CordovaWebViewClient(17502): onPageFinished(file:///android_asset/www/index.html)

                  05-13 10:40:18.054: D/CordovaActivity(17502): onMessage(onPageFinished,file:///android_asset/www/index.html)

                  05-13 10:40:18.074: D/CordovaActivity(17502): onMessage(spinner,stop)

                  05-13 10:40:18.094: D/CordovaLog(17502): file:///android_asset/www/js/index.js: Line 47 : Received Event: deviceready

                  05-13 10:40:18.094: I/Web Console(17502): Received Event: deviceready:47

                  05-13 10:40:18.244: D/TilesManager(17502): Starting TG #0, 0x746ce818

                  05-13 10:40:18.244: D/TilesManager(17502): new EGLContext from framework: 74d3ca50

                  05-13 10:40:18.244: D/GLWebViewState(17502): Reinit shader

                  05-13 10:40:18.344: D/GLWebViewState(17502): Reinit transferQueue

                  05-13 10:40:20.064: D/CordovaActivity(17502): onMessage(spinner,stop)

                   

                  Any ideas as to why this is happening?

                   

                   

                  Thanks

                  • 6. Re: Errai-tutorial - mobile error
                    csa

                    Hi John,

                     

                    Hm I've build the .apk file of the tutorial and installed it on two different phones without a problem. I don't see the errors in your log anymore. Maybe this is specific to your application/changes now.

                     

                    Can you try with this .apk file: https://dl.dropboxusercontent.com/u/16288770/test.apk

                     

                    It uses my test instance on openshift as a server. Does this work for you? If not, can you share the output of adb logcat | grep -i console

                     

                    Cheers,

                    Christian

                    • 7. Re: Errai-tutorial - mobile error
                      jdestef

                      Hi Christian,

                       

                      I tried your apk and it worked fine. Still having an issue though. I grabbed the project from github just as it is with the server stuff pointing at your open shift server. Ran mvn clean package -Pmobile,jboss7 -U to build the apk. Went to /Users/johndestefano/Cordova/errai-tutorial/target/template/platforms/android/ant-build and copied HelloCordova-debug.apk to DropBox then installed from dropbox to my phone. Still getting the same result of the splash screen showing up but nothing else. I'm using maven 3.0.5 and I have Cordova version 3.4.1-0.1.0 installed on the machine. Not sure if that makes a difference. I put the apk in dropbox if you want to try it out.

                       

                      https://www.dropbox.com/s/jypi84980ykhjkc/HelloCordova-debug.apk

                       

                      Thanks for any help you can give me with this.

                      • 8. Re: Errai-tutorial - mobile error
                        jdestef

                        Hi Christian,

                         

                        One other thing. From the console output when running the build I have this:

                         

                        -check-env:

                        [checkenv] Android SDK Tools Revision 22.6.0

                        [checkenv] Installed at /Users/johndestefano/android-sdks

                        -setup:

                             [echo] Project Name: HelloCordova

                          [gettype] Project Type: Application

                        -set-debug-mode:

                        -debug-obfuscation-check:

                        -pre-build:

                        -build-setup:

                        [getbuildtools] Using latest Build Tools: 19.0.1

                             [echo] Resolving Build Target for HelloCordova...

                        [gettarget] Project Target:   Android 4.4.2

                        [gettarget] API level:        19

                             [echo] ----------

                             [echo] Creating output directories if needed...

                            [mkdir] Created dir: /Users/johndestefano/Cordova/errai-tutorial/target/template/platforms/android/ant-build

                            [mkdir] Created dir: /Users/johndestefano/Cordova/errai-tutorial/target/template/platforms/android/ant-build/res

                            [mkdir] Created dir: /Users/johndestefano/Cordova/errai-tutorial/target/template/platforms/android/ant-build/rsObj

                            [mkdir] Created dir: /Users/johndestefano/Cordova/errai-tutorial/target/template/platforms/android/ant-build/rsLibs

                            [mkdir] Created dir: /Users/johndestefano/Cordova/errai-tutorial/target/template/platforms/android/ant-gen

                            [mkdir] Created dir: /Users/johndestefano/Cordova/errai-tutorial/target/template/platforms/android/ant-build/classes

                            [mkdir] Created dir: /Users/johndestefano/Cordova/errai-tutorial/target/template/platforms/android/ant-build/dexedLibs

                             [echo] ----------

                             [echo] Resolving Dependencies for HelloCordova...

                         

                        Is your android env set-up the same way?

                         

                        Thanks

                        • 9. Re: Errai-tutorial - mobile error
                          csa

                          I just compared the contents of our two APK files (simply renamed to zip, unzipped, and diff'ed). The problem is that in your case the assets/www/index.html file is wrong. It's not the apps (errai-tutorial's) index.html but the default cordova one which is why you see the cordova splash screen. I am not sure what causes this.

                          • 10. Re: Errai-tutorial - mobile error
                            csa

                            I am using Maven 3.0.3. Here's my env-setup:

                             

                            -check-env:

                            [checkenv] Android SDK Tools Revision 22.6.1

                            [checkenv] Installed at /Library/android-sdk-macosx

                            -setup:

                                 [echo] Project Name: HelloCordova

                              [gettype] Project Type: Application

                            -set-debug-mode:

                            -debug-obfuscation-check:

                            -pre-build:

                            -build-setup:

                            [getbuildtools] Using latest Build Tools: 17.0.0

                                 [echo] Resolving Build Target for HelloCordova...

                            [gettarget] Project Target:   Android 4.4.2

                            [gettarget] API level:        19

                                 [echo] ----------

                                 [echo] Creating output directories if needed...

                                [mkdir] Created dir: /Users/csadilek/Projects/misc/errai-tutorial/target/template/platforms/android/ant-build

                                [mkdir] Created dir: /Users/csadilek/Projects/misc/errai-tutorial/target/template/platforms/android/ant-build/res

                                [mkdir] Created dir: /Users/csadilek/Projects/misc/errai-tutorial/target/template/platforms/android/ant-build/rsObj

                                [mkdir] Created dir: /Users/csadilek/Projects/misc/errai-tutorial/target/template/platforms/android/ant-build/rsLibs

                                [mkdir] Created dir: /Users/csadilek/Projects/misc/errai-tutorial/target/template/platforms/android/ant-gen

                                [mkdir] Created dir: /Users/csadilek/Projects/misc/errai-tutorial/target/template/platforms/android/ant-build/classes

                                [mkdir] Created dir: /Users/csadilek/Projects/misc/errai-tutorial/target/template/platforms/android/ant-build/dexedLibs

                                 [echo] ----------

                                 [echo] Resolving Dependencies for HelloCordova...

                            • 11. Re: Errai-tutorial - mobile error
                              csa

                              Here's the line in our maven plugin that copies files (including the index.html) from target/errai-tutorial to target/template/platforms/android/assets/www:

                               

                              https://github.com/errai/errai/blob/master/errai-cordova-maven-plugin/src/main/groovy/org/jboss/errai/maven/cordova/CordovaMojo.groovy#L87

                               

                              For some reason this doesn't work for you and you end up with the wrong index.html file. Could it be a file system permission problem?

                               

                              Cheers,

                              Christian

                              • 12. Re: Errai-tutorial - mobile error
                                jdestef

                                Hi Christian,

                                 

                                As far as I can tell it doesn't look like a permissions issue. I am running this on a Mac, not sure what OS you are using. The contents of the template/www is copied to template/platforms/android/assets/www except for the index.html file (maybe because its there already and won't overwrite?). I can see the errai-cordova-template being copied into the template directory:

                                 

                                Expanding /Users/johndestefano/.m2/repository/org/jboss/errai/errai-cordova-template/3.0-SNAPSHOT/errai-cordova-template-3.0-SNAPSHOT.tar.gz to /var/folders/ln/dn6q8w_s6254yqzrhcj8ylp00000gn/T/tmp1560742731347915050.tar

                                [INFO] Expanding: /var/folders/ln/dn6q8w_s6254yqzrhcj8ylp00000gn/T/tmp1560742731347915050.tar into /Users/johndestefano/Cordova/errai-tutorial/target/template

                                 

                                After the build is complete, if I copy the index.html file from the template/www folder to the template/platforms/android/assets/www I get prompted to overwrite the file. If I do that and then build the apk with "cordova build android" and then deploy the resulting apk, it works fine. As you mentioned, the problem is the index.html file does not seem to be copied to the android assets directory. Is there a way in groovy to force an overwrite? This could be a Mac thing I guess?

                                 

                                 

                                Thanks  

                                • 13. Re: Errai-tutorial - mobile error
                                  csa

                                  Hi John,

                                   

                                  OK, good that we found the cause and that you can build a working apk now.  I will investigate and push another fix to our maven plugin.

                                   

                                  Cheers,

                                  Christian

                                  • 14. Re: Errai-tutorial - mobile error
                                    jdestef

                                    Hi Christian,

                                     

                                    Think I have it now. The index.html file was not being overwritten because the one that was unpacked into the template directory was newer than the index.html from the project. I touched the index.html file in the src of the project to update the timestamp on it. Then, when I did the build the correct index.html file ended up in the template/platforms/android/assets/www directory and the built app worked on the phone. I suppose this could still be a difference between OSs. I wonder if there is a way ant.copy can force an overwrite. Did a quick look but didn't find anything.

                                     

                                     

                                    Thanks

                                    1 2 Previous Next