Closed NamekMaster closed 2 years ago
The issue is happening most likely as you updated/downgraded the version of AGP.
Which version of AGP are you using? You can find in your template/android/build.gradle
file:
classpath("com.android.tools.build:gradle:7.0.4")
The issue is happening most likely as you updated/downgraded the version of AGP. Which version of AGP are you using? You can find in your
template/android/build.gradle
file:classpath("com.android.tools.build:gradle:7.0.4")
I'm using 7.0.4, this is my dependencies block.
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
You can run gradle :myLib:tasks --all
print all tasks for library, there is no packageDebug
or packageRelease
task.
But for application, for example gradle :app:tasks --all
, There are packageDebug
and packageRelease
tasks.
Here is the example.
For application:
❯ ./gradlew :app:tasks --all|grep packageDebug
packageDebug
packageDebugAndroidTest
packageDebugBundle
packageDebugUniversalApk
For library:
❯ ./gradlew :tasdk:tasks --all|grep packageDebug
packageDebugAndroidTest
packageDebugAssets
packageDebugRenderscript
packageDebugResources
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Description
Apply the react gradle plugin in Android library causes a NullPointerException in react.gradle.
I found this bug was fixed in issue https://github.com/facebook/react-native/pull/32026, but when I check the file history, I saw the code has been changed back in issue https://github.com/facebook/react-native/pull/32257.
Is it a mistake? It seems like a wrong code merging.
Here are my stacktraces
Version
0.68
Output of
npx react-native info
info Fetching system and libraries information... System: OS: macOS 12.3 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 135.43 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.7.2 - ~/.asdf/installs/nodejs/17.7.2/bin/node Yarn: 1.22.18 - ~/.asdf/installs/nodejs/17.7.2/.npm/bin/yarn npm: 8.5.2 - ~/.asdf/plugins/nodejs/shims/npm Watchman: 2022.03.21.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 27, 28, 29, 30, 31, 32 Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 32.0.0 System Images: android-10 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom_64, android-28 | Polestar 2, android-29 | Google Play Intel x86 Atom_64, android-29 | Volvo XC40, android-29 | Polestar 2, android-29 | Telenav Automotive x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64, android-30 | Telenav Automotive x86, android-30 | Telenav Automotive x86 Atom_64, android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play Intel x86 Atom_64 Android NDK: 22.1.7171670 IDEs: Android Studio: Bumblebee 2021.1.1 Patch 3 Bumblebee 2021.1.1 Patch 3 Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: 11.0.14 - /Users/user/.jenv/shims/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: ^0.68.0 => 0.68.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
apply the react gradle plugin in Android Library.
Snack, code example, screenshot, or link to a repository
No response