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 error: package org.jetbrains.annotations does not exist import org.jetbrains.annotations.NotNull; #1166

Closed
pichillilorenzo opened this issue Apr 28, 2022 · 4 comments

Comments

@pichillilorenzo
Copy link
Owner

@pichillilorenzo
Still getting an error when trying to build an android app with version 5.4.3+2 😔

Running Gradle task 'bundleRelease'...                          
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Checking the license for package Android SDK Platform 31 in /usr/local/share/android-sdk/licenses
License for package Android SDK Platform 31 accepted.
Preparing "Install Android SDK Platform 31 (revision: 1)".
"Install Android SDK Platform 31 (revision: 1)" ready.
Installing Android SDK Platform 31 in /usr/local/share/android-sdk/platforms/android-31
"Install Android SDK Platform 31 (revision: 1)" complete.
"Install Android SDK Platform 31 (revision: 1)" finished.
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
WARNING: [Processor] Library '/Users/vagrant/.gradle/caches/modules-2/files-2.1/com.google.android.exoplayer/extension-mediasession/2.15.1/7ff14fea7bb6e1df9c4624dadb49994561f834ce/extension-mediasession-2.15.1.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.
 Example of androidX reference: 'androidx/annotation/Nullable'
 Example of support library reference: 'android/support/v4/media/session/MediaSessionCompat$Callback'
WARNING: [Processor] Library '/Users/vagrant/.gradle/caches/modules-2/files-2.1/androidx.media2/media2-session/1.1.3/27a17d921a5d48327be3c4d25bcea79def4d1f9d/media2-session-1.1.3.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.
 Example of androidX reference: 'androidx/media2/session/MediaBrowser$Builder'
 Example of support library reference: 'android/support/v4/media/session/MediaSessionCompat$Token'
WARNING: [Processor] Library '/Users/vagrant/.gradle/caches/modules-2/files-2.1/com.google.android.exoplayer/exoplayer-ui/2.15.1/5af30e03819b04a3c9dc08befd6beca8f2f60f57/exoplayer-ui-2.15.1.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.
 Example of androidX reference: 'androidx/core/app/NotificationCompat$Builder'
 Example of support library reference: 'android/support/v4/media/session/MediaSessionCompat$Token'
Note: /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/store_redirect-2.0.1/android/src/main/java/com/danieldallos/storeredirect/StoreRedirectPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.11/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-4.2.1/android/src/main/java/com/it_nomads/fluttersecurestorage/FlutterSecureStoragePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/flutter_windowmanager-0.2.0/android/src/main/java/io/adaptant/labs/flutter_windowmanager/FlutterWindowManagerPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/local_auth-1.1.11/android/src/main/java/io/flutter/plugins/localauth/LocalAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+2/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/headless_in_app_webview/HeadlessInAppWebViewManager.java:29: error: package org.jetbrains.annotations does not exist
import org.jetbrains.annotations.NotNull;
                                ^
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+2/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/headless_in_app_webview/HeadlessInAppWebViewManager.java:55: error: cannot find symbol
  public void onMethodCall(final MethodCall call, @NotNull final Result result) {
                                                   ^
  symbol:   class NotNull
  location: class HeadlessInAppWebViewManager
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flutter_inappwebview:compileReleaseJavaWithJavac'.
> 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org/
BUILD FAILED in 9m 48s
Running Gradle task 'bundleRelease'...                            591.5s
Gradle task bundleRelease failed with exit code 1
Run: failed to build Android app: exit status 1

Originally posted by @VladyslavBilomeria in #1159 (comment)

@github-actions
Copy link

👋 @pichillilorenzo

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@pichillilorenzo
Copy link
Owner Author

@VladyslavBilomeria released new version 5.4.3+3 that removes the Java org.jetbrains.annotations.NotNull import.

@VladyslavBilomeria
Copy link

@pichillilorenzo Thanks!

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants