我正在尝试使用$ ionic package build android --release --profile profile_production
为Android构建我的Ionic应用程序的发布版本,但是我收到以下错误。你能帮忙吗?
Nota:ionic build android
导致没有错误。
:compileReleaseJavaWithJavac/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:11: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.GoogleAuthException;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:12: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.GoogleAuthUtil;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:13: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.UserRecoverableAuthException;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:193: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:202: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:205: error: cannot find symbol
GoogleAuthUtil.clearToken(context, token);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:210: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:213: error: cannot find symbol
GoogleAuthUtil.clearToken(context, token);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:217: error: cannot find symbol
catch (UserRecoverableAuthException userAuthEx) {
^
symbol: class UserRecoverableAuthException
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:227: error: cannot find symbol
} catch (GoogleAuthException e) {
^
symbol: class GoogleAuthException
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
10 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> 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.
BUILD FAILED
Total time: 8.201 secs
Error: Error code 1 for command: /home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/gradlew with args: cdvBuildRelease,-b,/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
答案 0 :(得分:0)
第一次在这里回答,但这篇文章对我有用,所以我想我必须把它贴在这里。
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/252
我所做的更改是安装的插件,而不是cordova普通插件,我添加了git one,就像这段代码:
cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=myreversedclientid