Android Studio构建失败

时间:2015-04-07 13:28:44

标签: android cordova android-studio gradle android-gradle

我刚尝试使用Android Studio构建我的cordova-app的android版本,因为我想为将来的版本添加Parse推送通知,但是我收到以下错误:

你有什么想法,如何解决这个问题?

Executing tasks: [:assembleDebug]

Configuration on demand is an incubating feature.
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources
:mergeDebugResources UP-TO-DATE
:processDebugManifest
:processDebugResources
:generateDebugSources
:compileDebugJava
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/gkb/PushApp/MainActivity.java:25: error: cannot find symbol
public class MainActivity extends CordovaActivity
                                  ^
  symbol: class CordovaActivity
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:3: error: cannot find symbol
import org.apache.cordova.CallbackContext;
                         ^
  symbol:   class CallbackContext
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:4: error: cannot find symbol
import org.apache.cordova.CordovaInterface;
                         ^
  symbol:   class CordovaInterface
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:5: error: cannot find symbol
import org.apache.cordova.CordovaPlugin;
                         ^
  symbol:   class CordovaPlugin
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:6: error: cannot find symbol
import org.apache.cordova.CordovaWebView;
                         ^
  symbol:   class CordovaWebView
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:7: error: package org.apache.cordova.PluginResult does not exist
import org.apache.cordova.PluginResult.Status;
                                      ^
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:18: error: cannot find symbol
public class IonicKeyboard extends CordovaPlugin{
                                   ^
  symbol: class CordovaPlugin
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:20: error: cannot find symbol
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
                           ^
  symbol:   class CordovaInterface
  location: class IonicKeyboard
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:20: error: cannot find symbol
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
                                                     ^
  symbol:   class CordovaWebView
  location: class IonicKeyboard
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:64: error: cannot find symbol
    public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
                                                                ^
  symbol:   class CallbackContext
  location: class IonicKeyboard
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/de/appplant/cordova/plugin/emailcomposer/EmailComposer.java:42: error: cannot find symbol
import org.apache.cordova.CordovaPlugin;
                         ^
  symbol:   class CordovaPlugin
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/de/appplant/cordova/plugin/emailcomposer/EmailComposer.java:43: error: cannot find symbol
import org.apache.cordova.CallbackContext;
                         ^
  symbol:   class CallbackContext
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/de/appplant/cordova/plugin/emailcomposer/EmailComposer.java:44: error: cannot find symbol
import org.apache.cordova.PluginResult;
                         ^
  symbol:   class PluginResult
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/de/appplant/cordova/plugin/emailcomposer/EmailComposer.java:46: error: cannot find symbol
public class EmailComposer extends CordovaPlugin {
                                   ^
  symbol: class CordovaPlugin
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/de/appplant/cordova/plugin/emailcomposer/EmailComposer.java:51: error: cannot find symbol
    public boolean execute (String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
                                                           ^
  symbol:   class CallbackContext
  location: class EmailComposer
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/de/appplant/cordova/plugin/emailcomposer/EmailComposer.java:73: error: cannot find symbol
    private void isServiceAvailable (CallbackContext ctx) {
                                     ^
  symbol:   class CallbackContext
  location: class EmailComposer
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/de/appplant/cordova/plugin/emailcomposer/EmailComposer.java:83: error: cannot find symbol
    private void open (JSONArray args, CallbackContext ctx) throws JSONException {
                                       ^
  symbol:   class CallbackContext
  location: class EmailComposer
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:15: error: cannot find symbol
import org.apache.cordova.CallbackContext;
                         ^
  symbol:   class CallbackContext
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:16: error: cannot find symbol
import org.apache.cordova.CordovaInterface;
                         ^
  symbol:   class CordovaInterface
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:17: error: cannot find symbol
import org.apache.cordova.CordovaPlugin;
                         ^
  symbol:   class CordovaPlugin
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:18: error: cannot find symbol
import org.apache.cordova.PluginResult;
                         ^
  symbol:   class PluginResult
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:34: error: cannot find symbol
public class SocialSharing extends CordovaPlugin {
                                   ^
  symbol: class CordovaPlugin
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:50: error: cannot find symbol
  private CallbackContext _callbackContext;
          ^
  symbol:   class CallbackContext
  location: class SocialSharing
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:62: error: cannot find symbol
  public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
                                                        ^
  symbol:   class CallbackContext
  location: class SocialSharing
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:106: error: cannot find symbol
  private boolean invokeEmailIntent(final CallbackContext callbackContext, final String message, final String subject, final JSONArray to, final JSONArray cc, final JSONArray bcc, final JSONArray files) throws JSONException {
                                          ^
  symbol:   class CallbackContext
  location: class SocialSharing
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:168: error: cannot find symbol
  private boolean doSendIntent(final CallbackContext callbackContext, final String msg, final String subject, final JSONArray files, final String url, final String appPackageName, final boolean peek) {
                                     ^
  symbol:   class CallbackContext
  location: class SocialSharing
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:332: error: cannot find symbol
  private boolean invokeSMSIntent(final CallbackContext callbackContext, JSONObject options, String p_phonenumbers) {
                                        ^
  symbol:   class CallbackContext
  location: class SocialSharing
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:389: error: cannot find symbol
  private ActivityInfo getActivity(final CallbackContext callbackContext, final Intent shareIntent, final String appPackageName) {
                                         ^
  symbol:   class CallbackContext
  location: class SocialSharing
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:55: error: cannot find symbol
    public CallbackContext callbackContext;
           ^
  symbol:   class CallbackContext
  location: class SocialSharing.SocialSharingRunnable
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/nl/xservices/plugins/SocialSharing.java:56: error: cannot find symbol
    SocialSharingRunnable(CallbackContext cb) {
                          ^
  symbol:   class CallbackContext
  location: class SocialSharing.SocialSharingRunnable
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/device/Device.java:23: error: cannot find symbol
import org.apache.cordova.CordovaWebView;
                         ^
  symbol:   class CordovaWebView
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/device/Device.java:24: error: cannot find symbol
import org.apache.cordova.CallbackContext;
                         ^
  symbol:   class CallbackContext
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/device/Device.java:25: error: cannot find symbol
import org.apache.cordova.CordovaPlugin;
                         ^
  symbol:   class CordovaPlugin
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/device/Device.java:26: error: cannot find symbol
import org.apache.cordova.CordovaInterface;
                         ^
  symbol:   class CordovaInterface
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/device/Device.java:33: error: cannot find symbol
public class Device extends CordovaPlugin {
                            ^
  symbol: class CordovaPlugin
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/device/Device.java:56: error: cannot find symbol
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
                           ^
  symbol:   class CordovaInterface
  location: class Device
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/device/Device.java:56: error: cannot find symbol
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
                                                     ^
  symbol:   class CordovaWebView
  location: class Device
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/device/Device.java:69: error: cannot find symbol
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
                                                          ^
  symbol:   class CallbackContext
  location: class Device
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:21: error: cannot find symbol
import org.apache.cordova.CallbackContext;
                         ^
  symbol:   class CallbackContext
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:22: error: cannot find symbol
import org.apache.cordova.CordovaInterface;
                         ^
  symbol:   class CordovaInterface
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:23: error: cannot find symbol
import org.apache.cordova.CordovaPlugin;
                         ^
  symbol:   class CordovaPlugin
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:24: error: cannot find symbol
import org.apache.cordova.PluginResult;
                         ^
  symbol:   class PluginResult
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:49: error: cannot find symbol
public class Notification extends CordovaPlugin {
                                  ^
  symbol: class CordovaPlugin
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:69: error: cannot find symbol
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
                                                          ^
  symbol:   class CallbackContext
  location: class Notification
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:157: error: cannot find symbol
    public synchronized void alert(final String message, final String title, final String buttonLabel, final CallbackContext callbackContext) {
                                                                                                             ^
  symbol:   class CallbackContext
  location: class Notification
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:198: error: cannot find symbol
    public synchronized void confirm(final String message, final String title, final JSONArray buttonLabels, final CallbackContext callbackContext) {
                                                                                                                   ^
  symbol:   class CallbackContext
  location: class Notification
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:272: error: cannot find symbol
    public synchronized void prompt(final String message, final String title, final JSONArray buttonLabels, final String defaultText, final CallbackContext callbackContext) {
                                                                                                                                            ^
  symbol:   class CallbackContext
  location: class Notification
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:454: error: cannot find symbol
    private AlertDialog.Builder createDialog(CordovaInterface cordova) {
                                             ^
  symbol:   class CordovaInterface
  location: class Notification
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/dialogs/Notification.java:464: error: cannot find symbol
    private ProgressDialog createProgressDialog(CordovaInterface cordova) {
                                                ^
  symbol:   class CordovaInterface
  location: class Notification
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:51: error: cannot find symbol
import org.apache.cordova.CallbackContext;
                         ^
  symbol:   class CallbackContext
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:52: error: cannot find symbol
import org.apache.cordova.Config;
                         ^
  symbol:   class Config
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:53: error: cannot find symbol
import org.apache.cordova.CordovaArgs;
                         ^
  symbol:   class CordovaArgs
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:54: error: cannot find symbol
import org.apache.cordova.CordovaPlugin;
                         ^
  symbol:   class CordovaPlugin
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:55: error: cannot find symbol
import org.apache.cordova.CordovaWebView;
                         ^
  symbol:   class CordovaWebView
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:56: error: cannot find symbol
import org.apache.cordova.LOG;
                         ^
  symbol:   class LOG
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:57: error: cannot find symbol
import org.apache.cordova.PluginResult;
                         ^
  symbol:   class PluginResult
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:65: error: cannot find symbol
public class InAppBrowser extends CordovaPlugin {
                                  ^
  symbol: class CordovaPlugin
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:84: error: cannot find symbol
    private CallbackContext callbackContext;
            ^
  symbol:   class CallbackContext
  location: class InAppBrowser
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:98: error: cannot find symbol
    public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
                                          ^
  symbol:   class CordovaArgs
  location: class InAppBrowser
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:98: error: cannot find symbol
    public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
                                                                  ^
  symbol:   class CallbackContext
  location: class InAppBrowser
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:666: error: package PluginResult does not exist
    private void sendUpdate(JSONObject obj, boolean keepCallback, PluginResult.Status status) {
                                                                              ^
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:682: error: cannot find symbol
        CordovaWebView webView;
        ^
  symbol:   class CordovaWebView
  location: class InAppBrowser.InAppBrowserClient
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:690: error: cannot find symbol
        public InAppBrowserClient(CordovaWebView webView, EditText mEditText) {
                                  ^
  symbol:   class CordovaWebView
  location: class InAppBrowser.InAppBrowserClient
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppChromeClient.java:21: error: cannot find symbol
import org.apache.cordova.CordovaWebView;
                         ^
  symbol:   class CordovaWebView
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppChromeClient.java:22: error: cannot find symbol
import org.apache.cordova.LOG;
                         ^
  symbol:   class LOG
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppChromeClient.java:23: error: cannot find symbol
import org.apache.cordova.PluginResult;
                         ^
  symbol:   class PluginResult
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppChromeClient.java:36: error: cannot find symbol
    private CordovaWebView webView;
            ^
  symbol:   class CordovaWebView
  location: class InAppChromeClient
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/inappbrowser/InAppChromeClient.java:40: error: cannot find symbol
    public InAppChromeClient(CordovaWebView webView) {
                             ^
  symbol:   class CordovaWebView
  location: class InAppChromeClient
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:27: error: cannot find symbol
import org.apache.cordova.CallbackContext;
                         ^
  symbol:   class CallbackContext
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:28: error: cannot find symbol
import org.apache.cordova.CordovaArgs;
                         ^
  symbol:   class CordovaArgs
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:29: error: cannot find symbol
import org.apache.cordova.CordovaInterface;
                         ^
  symbol:   class CordovaInterface
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:30: error: cannot find symbol
import org.apache.cordova.CordovaPlugin;
                         ^
  symbol:   class CordovaPlugin
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:31: error: cannot find symbol
import org.apache.cordova.CordovaWebView;
                         ^
  symbol:   class CordovaWebView
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:32: error: cannot find symbol
import org.apache.cordova.PluginResult;
                         ^
  symbol:   class PluginResult
  location: package org.apache.cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:35: error: cannot find symbol
public class StatusBar extends CordovaPlugin {
                               ^
  symbol: class CordovaPlugin
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:46: error: cannot find symbol
    public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
                                 ^
  symbol:   class CordovaInterface
  location: class StatusBar
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:46: error: cannot find symbol
    public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
                                                           ^
  symbol:   class CordovaWebView
  location: class StatusBar
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:70: error: cannot find symbol
    public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
                                          ^
  symbol:   class CordovaArgs
  location: class StatusBar
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/org/apache/cordova/statusbar/StatusBar.java:70: error: cannot find symbol
    public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
                                                                  ^
  symbol:   class CallbackContext
  location: class StatusBar
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/gkb/PushApp/MainActivity.java:30: error: cannot find symbol
        super.onCreate(savedInstanceState);
        ^
  symbol:   variable super
  location: class MainActivity
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/gkb/PushApp/MainActivity.java:31: error: cannot find symbol
        super.init();
        ^
  symbol:   variable super
  location: class MainActivity
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/gkb/PushApp/MainActivity.java:33: error: cannot find symbol
        loadUrl(launchUrl);
                ^
  symbol:   variable launchUrl
  location: class MainActivity
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/gkb/PushApp/MainActivity.java:27: error: method does not override or implement a method from a supertype
    @Override
    ^
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:21: error: cannot find symbol
        super.initialize(cordova, webView);
        ^
  symbol:   variable super
  location: class IonicKeyboard
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:29: error: cannot find symbol
        final CordovaWebView appView = webView;
              ^
  symbol:   class CordovaWebView
  location: class IonicKeyboard
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:69: error: cannot find symbol
                    InputMethodManager inputManager = (InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
                                                                           ^
  symbol: variable cordova
/Users/Alexander/Dropbox/com.idee.gkb/platforms/android/src/com/ionic/keyboard/IonicKeyboard.java:70: error: cannot find symbol
                    View v = cordova.getActivity().getCurrentFocus();
                             ^
  symbol: variable cordova


BUILD FAILED

Total time: 5.612 secs

依赖

dependencies {
        compile fileTree(dir: 'libs', include: '*.jar')
        // SUB-PROJECT DEPENDENCIES START
        // SUB-PROJECT DEPENDENCIES END
    }

使用.jar-Files

classes.jar || in gradle/wrapper/
gradle-wrapper.jar || in CordovaLib/ant-build/

2 个答案:

答案 0 :(得分:0)

在build.gradle中添加您的Sub项目

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(":CordovaLib")
}

添加后,您可能会收到其他JAR错误和Lint错误;

你必须添加适当的东西。

最后你的build.gradle应该是这样的

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.3'
    }
}
apply plugin: 'android'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(":CordovaLib")
}

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
    }
    lintOptions {
        abortOnError false
    }
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

答案 1 :(得分:0)

对我来说,添加必需的依赖项可以解决该问题。

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.PluginResult;