我在FirebasePlugin.java中收到错误,如何解决?

时间:2017-05-31 12:31:36

标签: firebase firebase-cloud-messaging

当我在终端上发出命令ionic build android时。 它显示以下错误。

BUILD FAILED


Total time: 7.557 secs

Error: /Users/mac2/Desktop/myProj/platforms/android/gradlew: Command failed with exit code 1 Error output: /Users/mac2/Desktop/myProj/platforms/android/src/org/apache/cordova/firebase/FirebasePlugin.java:389: error: cannot find symbol
                mFirebaseAnalytics.setCurrentScreen(cordova.getActivity(), name, null);
                                  ^
symbol:   method setCurrentScreen(Activity,String,<null>)
location: variable mFirebaseAnalytics of type FirebaseAnalytics
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

下面是FirebasePlugin.java中的代码

private void setScreenName(final CallbackContext callbackContext, final String name) {
    // This must be called on the main thread
    cordova.getActivity().runOnUiThread(new Runnable() {
        public void run() {
            try {
                mFirebaseAnalytics.setCurrentScreen(cordova.getActivity(), name, null);
                callbackContext.success();
            } catch (Exception e) {
                callbackContext.error(e.getMessage());
            }
        }
    });
} 

我不明白为什么在这个文件中发生了这样的错误。

我试着解决,但我做不到。

任何人都知道为什么会这样吗?

0 个答案:

没有答案