删除并再次添加平台后,Cordova无法在Android上运行

时间:2017-12-19 17:40:24

标签: android cordova-plugins ionic3

我有一些问题将我的Ionic运行到一个旧的Android设备(Android 4.1.2)然后我删除并再次添加Android平台,但之后我再也无法在设备上运行了。

我使用的命令:

% sudo cordova run android -l -c --stacktrace

我得到了什么:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> 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: 21.435 secs
Error: /Users/francisco/Projetos-Ionic/Jungery/platforms/android/gradlew: Command failed with exit code 1 Error output:
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:178: error: cannot find symbol
                        intentScan.putExtra(Intents.Scan.SHOW_FLIP_CAMERA_BUTTON, obj.optBoolean(SHOW_FLIP_CAMERA_BUTTON, false));
                                                        ^
  symbol:   variable SHOW_FLIP_CAMERA_BUTTON
  location: class Scan
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:179: error: cannot find symbol
                        intentScan.putExtra(Intents.Scan.SHOW_TORCH_BUTTON, obj.optBoolean(SHOW_TORCH_BUTTON, false));
                                                        ^
  symbol:   variable SHOW_TORCH_BUTTON
  location: class Scan
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:180: error: cannot find symbol
                        intentScan.putExtra(Intents.Scan.TORCH_ON, obj.optBoolean(TORCH_ON, false));
                                                        ^
  symbol:   variable TORCH_ON
  location: class Scan
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:181: error: cannot find symbol
                        intentScan.putExtra(Intents.Scan.SAVE_HISTORY, obj.optBoolean(SAVE_HISTORY, false));
                                                        ^
  symbol:   variable SAVE_HISTORY
  location: class Scan
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:183: error: cannot find symbol
                            intentScan.putExtra(Intents.Scan.RESULT_DISPLAY_DURATION_MS, "" + obj.optLong(RESULTDISPLAY_DURATION));
                                                            ^
  symbol:   variable RESULT_DISPLAY_DURATION_MS
  location: class Scan
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:192: error: cannot find symbol
                            intentScan.putExtra(Intents.Scan.ORIENTATION_LOCK, obj.optString(ORIENTATION));
                                                            ^
  symbol:   variable ORIENTATION_LOCK
  location: class Scan
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:254: error: cannot find symbol
        intentEncode.setAction(Intents.Encode.ACTION);
                                      ^
  symbol:   variable Encode
  location: class Intents
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:255: error: cannot find symbol
        intentEncode.putExtra(Intents.Encode.TYPE, type);
                                     ^
  symbol:   variable Encode
  location: class Intents
/Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:256: error: cannot find symbol
        intentEncode.putExtra(Intents.Encode.DATA, data);
                                     ^
  symbol:   variable Encode
  location: class Intents
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/francisco/Projetos-Ionic/Jungery/platforms/android/src/com/bitpay/cordova/qrscanner/QRScanner.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors

FAILURE: Build failed with an exception.

Cordova插件:

com.googlemaps.ios 2.5.0 "Google Maps SDK for iOS"
cordova-plugin-add-swift-support 1.7.0 "AddSwiftSupport"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-nativegeocoder 2.0.4 "NativeGeocoder"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-qrscanner 2.5.0 "QRScanner"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-swift-support 3.1.1 "SwiftSupport"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 0.7.14 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-barcodescanner 6.0.8 "BarcodeScanner"

如果我刚删除并再次添加它会有什么问题?我可以看到一些关于BarcodeScanner插件的内容,但如果它在删除和添加Android平台之前工作得很好怎么可能呢?

感谢任何提示:/

1 个答案:

答案 0 :(得分:0)

我解决了我的问题,删除并再次安装Android平台,同样,我从头开始安装Android Studio与所有平台在另一个文件夹中,并再次创建我的ANDROID_HOME变量。