Wikitude / wikitude-cordova-plugin

Wikitude's Augmented Reality Plugin for Cordova - working together with the Wikitude SDK library for Android and iOS. Provides image recognition and tracking, geo-based augmente reality and 3D rendering and animations in an augmented reality scene
https://www.wikitude.com
Other
199 stars 181 forks source link

Build fails #105

Closed patrickhofer closed 8 years ago

patrickhofer commented 8 years ago

I followed exactly the tutorial here: http://www.wikitude.com/developer/documentation/phonegap but when i run cordova build i get this error.

wikitude/phonegap/WikitudePlugin.java:263: error: cannot find symbol
                        if ( !cordova.hasPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) ) {
                                     ^
  symbol:   method hasPermission(String)
  location: variable cordova of type CordovaInterface
/Users/patrickhofer/AugmentedRealityProject/platforms/android/src/com/wikitude/phonegap/WikitudePlugin.java:265: error: cannot find symbol
                            WikitudePlugin.this.cordova.requestPermission(WikitudePlugin.this, WRITE_TO_EXTERNAL_STORAGE_REQUEST_CODE, Manifest.permission.WRITE_EXTERNAL_STORAGE);
                                                       ^
  symbol:   method requestPermission(WikitudePlugin,int,String)
  location: variable cordova of type CordovaInterface
/Users/patrickhofer/AugmentedRealityProject/platforms/android/src/com/wikitude/phonegap/WikitudePlugin.java:462: error: cannot find symbol
            boolean cameraPermissionRequestRequired = !cordova.hasPermission(Manifest.permission.CAMERA);
                                                              ^
  symbol:   method hasPermission(String)
  location: variable cordova of type CordovaInterface
/Users/patrickhofer/AugmentedRealityProject/platforms/android/src/com/wikitude/phonegap/WikitudePlugin.java:463: error: cannot find symbol
            _locationPermissionRequestRequired = !cordova.hasPermission(Manifest.permission.ACCESS_FINE_LOCATION) && !cordova.hasPermission(Manifest.permission.ACCESS_COARSE_LOCATION);
                                                         ^
  symbol:   method hasPermission(String)
  location: variable cordova of type CordovaInterface
/Users/patrickhofer/AugmentedRealityProject/platforms/android/src/com/wikitude/phonegap/WikitudePlugin.java:463: error: cannot find symbol
            _locationPermissionRequestRequired = !cordova.hasPermission(Manifest.permission.ACCESS_FINE_LOCATION) && !cordova.hasPermission(Manifest.permission.ACCESS_COARSE_LOCATION);
                                                                                                                             ^
  symbol:   method hasPermission(String)
  location: variable cordova of type CordovaInterface
/Users/patrickhofer/AugmentedRealityProject/platforms/android/src/com/wikitude/phonegap/WikitudePlugin.java:468: error: cannot find symbol
                this.cordova.requestPermissions(this, CAMERA_PERMISSION_REQUEST_CODE, new String[] { Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION });
                            ^
  symbol:   method requestPermissions(WikitudePlugin,int,String[])
  location: variable cordova of type CordovaInterface
/Users/patrickhofer/AugmentedRealityProject/platforms/android/src/com/wikitude/phonegap/WikitudePlugin.java:470: error: cannot find symbol
                this.cordova.requestPermission(this, CAMERA_PERMISSION_REQUEST_CODE, Manifest.permission.CAMERA);
                            ^
  symbol:   method requestPermission(WikitudePlugin,int,String)
  location: variable cordova of type CordovaInterface
/Users/patrickhofer/AugmentedRealityProject/platforms/android/src/com/wikitude/phonegap/WikitudePlugin.java:473: error: cannot find symbol
                this.cordova.requestPermissions(this, CAMERA_PERMISSION_REQUEST_CODE, new String[] { Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION });
                            ^
  symbol:   method requestPermissions(WikitudePlugin,int,String[])
  location: variable cordova of type CordovaInterface
/Users/patrickhofer/AugmentedRealityProject/platforms/android/src/com/wikitude/phonegap/WikitudePlugin.java:993: error: method does not override or implement a method from a supertype
    @Override
    ^
9 errors
:compileDebugJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJava'.
> 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.
AndreasSchacherbauerWikitude commented 8 years ago

Android runtime permission require an installed Android SDK of API level 22/23. Can you please make sure that your Android SDK/NDK is up-to-date?

nilebma commented 8 years ago

I have exactly the same error here. My Android SDK and NDK are up-to-date, and I can build my project when I remove the wikitude plugin. Thanks :-)

sinclairt commented 8 years ago

I'm having the same problem, Android is up to date.

TheCell commented 8 years ago

Same Issue here I already reinstalled phonegap and cordova.

AndreasSchacherbauerWikitude commented 8 years ago

Which versions of the Android SDK do you use?

TheCell commented 8 years ago

SDK 23 (Android 6) just updated before using. When Building a cordova App it runs through but adding the repo to the empty project and building it again gives me this error. Does your Plugin only have the hasPermissions method if the SDK is > Android 4.4?

nilebma commented 8 years ago

I tried to build my app by targeting API version 19, 22 and 23, and got the same error each time.

AndreasSchacherbauerWikitude commented 8 years ago

nilebma made me aware of something: Is everyone trying to build it's own app and not our example app? If so, make sure that your cordova/phonegap command for android is either cordova platform add android@5.0.0 or cordova build android@5.0.0. Our example app generation script contains the version specifier which ensures that all required runtime permissions functions and constants are available. Might be that you need to update your cordova/phonegap installation.

I hope this helps

TheCell commented 8 years ago

Hey there I was able to build the app with that. I made a new app and did cordova platform add android@5.0.0 after that I was able to add the wikitude plugin via github and was able to build the app with cordova build android

AndreasSchacherbauerWikitude commented 8 years ago

(y) I'm glad we found the problem! Have fun using our Plugin!

AndreasSchacherbauerWikitude commented 8 years ago

cordova platform update android@5.0.0 is also an option

nilebma commented 8 years ago

Great ! It works for me, thank you :+1:

Tazaf commented 8 years ago

Marvelous! That command fixed my week-long running problem! Many thanks. This information should be clearly stated in the Wikitude documentation, though.