简体   繁体   中英

Cordova not running on Android after removing and adding platform again

I had some problems to run my Ionic to an old Android device (Android 4.1.2) then I removed and added the Android platform again, but after that I can't run on the device any more.

Command I use:

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

And what I get:

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 plugins:

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"

What would be wrong if I just removed and added it again? I can see something about the BarcodeScanner plugin, but how could that be if it was working just fine before removing and adding the Android platform?

Appreciate any tip :/

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM