cordova-plugin-videoplayer
cordova-plugin-videoplayer copied to clipboard
Error when i build app
/home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:123: error: cannot find symbol [cordova] if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { [cordova] ^ [cordova] symbol: variable R [cordova] location: class VERSION_CODES [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: variable Type [cordova] location: class WindowInsets [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: method getInsetsController() [cordova] location: class Window [cordova] 3 errors [cordova] [cordova] FAILURE: Build failed with an exception. [cordova] [cordova] * What went wrong: [cordova] Execution failed for task ':app:compileDebugJavaWithJavac'. [cordova] > Compilation failed; see the compiler error output for details. [cordova] [cordova] * Try: [cordova] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. [cordova] [cordova] * Get more help at https://help.gradle.org [cordova] [cordova] BUILD FAILED in 56s [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/gradlew: Command failed with exit code 1 Error output: [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:123: error: cannot find symbol [cordova] if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { [cordova] ^ [cordova] symbol: variable R [cordova] location: class VERSION_CODES [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: variable Type [cordova] location: class WindowInsets [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: method getInsetsController() [cordova] location: class Window [cordova] 3 errors [cordova] [cordova] FAILURE: Build failed with an exception. [cordova] [cordova] * What went wrong: [cordova] Execution failed for task ':app:compileDebugJavaWithJavac'. [cordova] > Compilation failed; see the compiler error output for details. [cordova] [cordova] * Try: [cordova] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. [cordova] [cordova] * Get more help at https://help.gradle.org [cordova] [cordova] BUILD FAILED in 56s [ERROR] An error occurred while running subprocess cordova.
cordova build android --device exited with exit code 1.
same error here
Same here!
/home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:123: error: cannot find symbol [cordova] if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { [cordova] ^ [cordova] symbol: variable R [cordova] location: class VERSION_CODES [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: variable Type [cordova] location: class WindowInsets [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: method getInsetsController() [cordova] location: class Window [cordova] 3 errors [cordova] [cordova] FAILURE: Build failed with an exception. [cordova] [cordova] * What went wrong: [cordova] Execution failed for task ':app:compileDebugJavaWithJavac'. [cordova] > Compilation failed; see the compiler error output for details. [cordova] [cordova] * Try: [cordova] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. [cordova] [cordova] * Get more help at https://help.gradle.org [cordova] [cordova] BUILD FAILED in 56s [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/gradlew: Command failed with exit code 1 Error output: [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:123: error: cannot find symbol [cordova] if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { [cordova] ^ [cordova] symbol: variable R [cordova] location: class VERSION_CODES [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: variable Type [cordova] location: class WindowInsets [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: method getInsetsController() [cordova] location: class Window [cordova] 3 errors [cordova] [cordova] FAILURE: Build failed with an exception. [cordova] [cordova] * What went wrong: [cordova] Execution failed for task ':app:compileDebugJavaWithJavac'. [cordova] > Compilation failed; see the compiler error output for details. [cordova] [cordova] * Try: [cordova] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. [cordova] [cordova] * Get more help at https://help.gradle.org [cordova] [cordova] BUILD FAILED in 56s [ERROR] An error occurred while running subprocess cordova.
cordova build android --device exited with exit code 1.
I solved by upgrading my android version
/home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:123: error: cannot find symbol [cordova] if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { [cordova] ^ [cordova] symbol: variable R [cordova] location: class VERSION_CODES [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: variable Type [cordova] location: class WindowInsets [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: method getInsetsController() [cordova] location: class Window [cordova] 3 errors [cordova] [cordova] FAILURE: Build failed with an exception. [cordova] [cordova] * What went wrong: [cordova] Execution failed for task ':app:compileDebugJavaWithJavac'. [cordova] > Compilation failed; see the compiler error output for details. [cordova] [cordova] * Try: [cordova] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. [cordova] [cordova] * Get more help at https://help.gradle.org [cordova] [cordova] BUILD FAILED in 56s [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/gradlew: Command failed with exit code 1 Error output: [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:123: error: cannot find symbol [cordova] if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { [cordova] ^ [cordova] symbol: variable R [cordova] location: class VERSION_CODES [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: variable Type [cordova] location: class WindowInsets [cordova] /home/fouzo/Desktop/SERVER/FOUZO/exam/mobile/platforms/android/app/src/main/java/com/moust/cordova/videoplayer/VideoPlayer.java:124: error: cannot find symbol [cordova] dialog.getWindow().getInsetsController().hide(WindowInsets.Type.statusBars()); [cordova] ^ [cordova] symbol: method getInsetsController() [cordova] location: class Window [cordova] 3 errors [cordova] [cordova] FAILURE: Build failed with an exception. [cordova] [cordova] * What went wrong: [cordova] Execution failed for task ':app:compileDebugJavaWithJavac'. [cordova] > Compilation failed; see the compiler error output for details. [cordova] [cordova] * Try: [cordova] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. [cordova] [cordova] * Get more help at https://help.gradle.org [cordova] [cordova] BUILD FAILED in 56s [ERROR] An error occurred while running subprocess cordova.
cordova build android --device exited with exit code 1.
I solved by upgrading my android version
Updated to which version ?
Hi there.
You should go to variables.gradle and update 'compileSdkVersion' to '30'. This is the Version Code R for Android SDK.
For those who still having the error, you need to go to Project folder -> platforms -> android -> build.gradle and then change defaultCompileSdkVersion to 30 instead 29. That resolved the error for me.
my compileSDKVersion is already 30 but still having the same error.. is any other way to fix this?
If ya dont wanna up the android version ya can also just install the previous commit: cordova plugin add https://github.com/moust/cordova-plugin-videoplayer.git#5c83c858ed159d68cce1bf54e31d6caf7e145fbf
In npm install (or Cordova plugin add) ya can specify a commit by adding the hashtag at the end. Here I specifiy the (at the time of writing) second to latest commit from 2018 an it compiled fine for me.