moust / cordova-plugin-videoplayer

A Codova plugin to play video with the native MediaPlayer on Android devices.
MIT License
139 stars 102 forks source link

Error when i build app #73

Open fouzo09 opened 3 years ago

fouzo09 commented 3 years ago

/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.
marfrede commented 3 years ago

same error here

SantiagoIlli commented 3 years ago

Same here!

fouzo09 commented 3 years ago

/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

KishoreKoushik commented 3 years ago

/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 ?

wgrientidev commented 3 years ago

Hi there.

You should go to variables.gradle and update 'compileSdkVersion' to '30'. This is the Version Code R for Android SDK.

Ricardo385 commented 3 years ago

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.

ryansyrl commented 2 years ago

my compileSDKVersion is already 30 but still having the same error.. is any other way to fix this?

TBthegr81 commented 2 years ago

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.