Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] react-native-webview:compileDebugJavaWithJavac 10.2.2 #1419

Closed
puera opened this issue May 29, 2020 · 19 comments
Closed

[Android] react-native-webview:compileDebugJavaWithJavac 10.2.2 #1419

puera opened this issue May 29, 2020 · 19 comments

Comments

@puera
Copy link

puera commented May 29, 2020

Bug description:
I am getting one error when build android

cannot find symbol if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { ^ symbol: variable Q location: class VERSION_CODES
i try clean with ./gradlew clean and a new project but a have the same result

Environment:

  • OS: Linux 5.3
  • OS version: Ubuntu 18.04.4 LTS (Bionic Beaver)
  • react-native version: 0.62.2
  • react-native-webview version: 10.2.2
@NoumanSakhawat
Copy link

did you find the solution? @puera

@puera
Copy link
Author

puera commented May 29, 2020

did you find the solution? @puera

nope, i trying everything but no success

@FelipeLimaDeSouza
Copy link

version 10.2.3 with the same error

@Prashantrao331
Copy link

Facing the same error with latest version

@bbm-design
Copy link

Got the same issue

[app]/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java:276: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
^
symbol: variable Q
location: class VERSION_CODES
Note: [app]/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: [app]/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

FAILURE: Build failed with an exception.

@hgySandy
Copy link

The same error ...

@dushyantss
Copy link

This issue is related to #1418

To fix it, you need to update your compileSdkVersion to 29. While you are at it, might as well update the buildToolsVersion. You can do that by changing these lines in your /android/build.gradle file.

...
buildscript {
    ext {
        ...
        buildToolsVersion = "29.0.3"
        compileSdkVersion = 29
        ...
    }
...

@iarmankhan
Copy link

Thanks @dushyantss
The error is gone after the changes!

@bbm-design
Copy link

bbm-design commented May 30, 2020

Tried that fix, only getting raw html when using it with charts native (iOS works fine)
https://github.com/somonus/react-native-echarts (updated to use react native web view instead of the the old one included in react native)

Capture d’écran 2020-05-30 à 15 00 57

@puera
Copy link
Author

puera commented May 30, 2020

This issue is related to #1418

To fix it, you need to update your compileSdkVersion to 29. While you are at it, might as well update the buildToolsVersion. You can do that by changing these lines in your /android/build.gradle file.

...
buildscript {
    ext {
        ...
        buildToolsVersion = "29.0.3"
        compileSdkVersion = 29
        ...
    }
...

@dushyantss thanks , the changes really works!

@gavrichards
Copy link

I'm experiencing this error too.

Changing the SDK version to 29 goes against the setup instructions for React Native which specify you should use Android SDK Platform 28 and build tools 28.0.3.

For that reason I'm reluctant to make these changes. Could this package be fixed to continue supporting 28? I'll downgrade this package in the meantime.

@ilyausorov
Copy link

Yes, looks like this is introduced with v10.2.0 and am also downgrading to v10.1.1 in the meantime.

@phillipmiles
Copy link

Yup, downgrading v10.1.1 fixes it. I don't want to update the SDK from what react native has by default either.

@xuan9230
Copy link

xuan9230 commented Jun 2, 2020

Don't forget to properly remove & unlink old version when downgrading.

@adifdwimaulana
Copy link

This issue is related to #1418

To fix it, you need to update your compileSdkVersion to 29. While you are at it, might as well update the buildToolsVersion. You can do that by changing these lines in your /android/build.gradle file.

...
buildscript {
    ext {
        ...
        buildToolsVersion = "29.0.3"
        compileSdkVersion = 29
        ...
    }
...

This is work for me, thanks !!

@Jeevan-Kishore
Copy link

Downgraded to v10.1.1, minor versions breaking the build set us back from deployments. Wasn't a pleasant experience.

@zhouwenqi
Copy link

thanks

@gavrichards
Copy link

I've not been able to test yet, but it looks like this latest release might address this issue?
https://github.com/react-native-community/react-native-webview/releases/tag/v10.3.2

@github-actions
Copy link

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests