Start a new topic

Help! Cordova 5.1.1 Android build errors with Wikitude plugin

Help! Cordova 5.1.1 Android build errors with Wikitude plugin


Many thanks Simon,

No errors now. That seems to have worked; except that, since I am using Cordova rather than PhoneGap, the correct command is: 

cordova platform add android@4.0.2

Before I found that out, I also ran the following update in the Android SDK folder (which at least doesn't seem to have done any harm!):

toolsandroid update sdk --no-ui 

Thank you both.

@John: You have the latest version of Cordova installed but your project still uses the old cordova android lib. Your Android project ist still an Eclipse project right? New projects now use Android Studio, so I hope the following will work. Please backup your current project and run: "phonegap platform update android" in the root of your project.

@Fredrick: Your version is the current, and should work. I'm not sure what the problem is. You do have the exact same problem as John right? I'm just asking because the screenshot you posted shows some other error. Could you please run our sample app setup script and see if this app runs? I'll post the instructions below.

Automatic Setup of Sample App


Download the binary of the Sample App from GitHub

Unzip the binary file (wikitude-phonegap-samples-master.zip)

Open the console and change to the directory where you unzipped the binary


In the console run the CreateSampleApp.sh script. Use the -d flag to specify where the Sample App should be created. The -ios and -android flags control which platform should be compiled after creating the app.

$ ./CreateSampleApp.sh -d ~/Path/Where/The/App/Should/Be/Created -ios true -android true


 


This may take a while (more than one minute) without any update message in the command line, depending on how fast the plugin is cloned from GitHub and downloaded (more than 30MB)

The script might run for some minutes without feedback as it is downloading more than 30MB from GitHub. It will finish with the following success message:

 

$ *** DONE - SUCCESS ***



Open the project in Xcode (iOS) or Android Studio (Android) and run it on your device.

Done

Ran the command. It's reporting:

Installed platforms: Android 3.7.1
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, windows, windows8, wp8

Installed platforms: android 4.0.2

Available platforms: amazon-fireos, blackberry10, browser, firefoxos, windows, w

indows8, wp8

Hi again,

were your projects created with an pre 5.x Cordova version?

Please navigate to the root of your project on the command line and run the following command: cordova platform version android
Is the android platform version > 4?

Thank you and best regards,
Simon

Wikitude technical team is working on it now I think.

Mine is 5.1.1 also, Frederick.

Either nobody's using Android or nobody gives a monkey's about it at Wikitude. I gave up.

I'm now using a Unity/Vuforia solution which works.

It is Version 5.1.1

Hi,

this error occures if you use our latest plugin with Cordova lower than 5.x. Are you absolutely sure you are using Cordova 5.x? Might there be an older and newer Cordova version installed and you are accidently using the older?

Best regards,
Simon




I got the same problem on Android. There is no problem on iOS. 

I've been following the online guide here:
http://www.wikitude.com/external/doc/documentation/latest/phonegap/setupguidecordovacli.html
Note: I'm using the open-source Apache Cordova (5.1.1), NOT the Adobe PhoneGap variant.

- Created an empty Cordova project which builds and deploys to a Nexus 4 phone OK.
- Added the Wikitude plugin:
$ cordova plugin add https://github.com/Wikitude/wikitude-cordova-plugin.git
- Added license key to line 12 of WikitudePlug.js
- $ cordova run android
Build fails with following errors:

    Compiling 3 source files to C:Users\me\Desktop\PROJECTS\Fizz AR project\fizzARdemo\platforms\android\ant-build\classes

    C:\Users\me\Desktop\PROJECTS\Fizz AR project\fizzARdemo\platforms\android\src\com\wikitude\phonegap\WikitudePlugin.java:756: error: cannot find symbol

            ((CordovaWebView)rootView).getView().clearFocus();

                                      ^

      symbol:   method getView()

      location: class CordovaWebView

    C:\Users\me\Desktop\PROJECTS\Fizz AR project\fizzARdemo\platforms\android\src\com\wikitude\phonegap\WikitudePlugin.java:771: error: method handleResume in class CordovaWebView cannot be applied to given types;

    ((CordovaWebView)rootView).handleResume(true);

                             ^

      required: boolean,boolean

      found: boolean

      reason: actual and formal argument lists differ in length

    2 errors

ERROR running one or more of the platforms: Error: cmd: Command failed with exit code 1

You may not have the required environment or OS to run this project


This should be simple, right?

I've googled around for solutions without success.
Can anybody help me get this working please? 
Login or Signup to post a comment