react-native-async-storage / async-storage

An asynchronous, persistent, key-value storage system for React Native.
https://react-native-async-storage.github.io/async-storage/
MIT License
4.7k stars 466 forks source link

Could not get unknown property 'com' for extension 'android' of type com.android.build.gradle.LibraryExtension #996

Closed bilalyaqoob closed 1 year ago

bilalyaqoob commented 1 year ago

What happened?

I am working on a project and suddenly one of the camera features of the app stopped working I thought of re creating the build and when I did I get this error.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/home/dell/Desktop/g2g-app/node_modules/@react-native-async-storage/async-storage/android/build.gradle' line: 89

* What went wrong:
A problem occurred evaluating project ':react-native-async-storage_async-storage'.
> Could not get unknown property 'com' for extension 'android' of type com.android.build.gradle.LibraryExtension.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-async-storage_async-storage'.
> compileSdkVersion is not specified.

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s

Version

^1.15.5

What platforms are you seeing this issue on?

System Information

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
     Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.20.1 - ~/.nvm/versions/node/v16.20.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.20.1/bin/yarn
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: AI-222.4459.24.2221.10121639
  Languages:
    Java: 11.0.19 - /usr/bin/javac
    Python: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.5 => 0.63.5 
  npmGlobalPackages:
    *react-native*: Not Found
npm notice 
npm notice New major version of npm available! 8.19.4 -> 9.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.8.1
npm notice Run npm install -g npm@9.8.1 to update!
npm notice

Steps to Reproduce

I tried to make a build and get this error

krizzu commented 1 year ago

You'll need to use Higher version of React Native (0.63 is super old), as I believe it still uses Android Gradle plugin v6

bilalyaqoob commented 1 year ago

@krizzu New version of react native isn't a solution, it generates more bugs with other packages

krizzu commented 1 year ago

In that case, I'd try upgrading AGP to 7±

tido64 commented 1 year ago

Another option is to keep the older version of AsyncStorage.

krizzu commented 1 year ago

@bilalyaqoob If your version in package.json says ^1.15.5 it means you're gonna install latest release (1.19.1) if you don't have lock files (yarn.lock) checked in your repo. That's the only explanation that comes to my mind

SaharTo commented 11 months ago

Hey I'm still facing that error on my project React Native Version : "0.63.4" react-native-async-storage_async-storage version : "^1.15.2"

I also try to upgrade the "@react-native-async-storage/async-storage" dependency but it didnt work

Anyone who solved that issue ??

Haseeba393 commented 11 months ago

any solution for this?

shankar24r commented 8 months ago

Still this issue came, RN 0.63,

`FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 3s`