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] error on executing 'gradlew clean' : "Could not get unknown property 'jniLibs' for object of type com.android.build.gradle.internal.dsl.PackagingOptions." #4706

Closed
takanorihirai opened this issue Jul 6, 2022 · 5 comments · Fixed by #4707

Comments

@takanorihirai
Copy link

takanorihirai commented Jul 6, 2022

How frequently does the bug occur?

All the time

Description

on executing "gradlew clean" in react native project (see 'Reproduction Steps')
failed complete with following log (see 'Stacktrace & log output') .

so I edited with patch

node_modules/realm/react-native/android/build.gradle

line 60

@@ -57,7 +57,7 @@ android {
     buildTypes {
         debug {
             packagingOptions {
-                jniLibs.keepDebugSymbols += "**/librealm.so"
+//                jniLibs.keepDebugSymbols += "**/librealm.so"
             }
         }
     }

and re-execute "gradlew clean", I'm temporarily addressing the bug,
and executing "npx react-native run-android" to run with android avd emulator ,is ok.

Stacktrace & log output

cd /Users/develop/Documents/workspace/sample_project
cd android
./gradlew clean
...

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/develop/Documents/workspace/sample_project/app/node_modules/realm/react-native/android/build.gradle' line: 60

* What went wrong:
A problem occurred evaluating project ':realm'.
> Could not get unknown property 'jniLibs' for object of type com.android.build.gradle.internal.dsl.PackagingOptions.

* 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.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 18s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "gradlew:clean" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can you reproduce the bug?

Yes, always

Reproduction Steps

cd  android
./gradlew clean 

Version

10.19.4

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

android

Build environment

Which debugger for React Native: ..

% node -v
v18.4.0
% cat package.json| grep '"react":'
        "react": "17.0.2",
% cat package.json| grep '"react-native":'
        "react-native": "0.64.2",
% cat package.json| grep '"@react-native-async-storage/async-storage":'
        "@react-native-async-storage/async-storage": "^1.17.7",
% cat package.json| grep '"react-native-fs":' 
        "react-native-fs": "^2.20.0",
% cat node_modules/@realm.io/common/package.json | grep version
  "version": "0.1.4",
% java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
OpenJDK 64-Bit Server VM (build 11.0.12+0-b1504.28-7817840, mixed mode)
% brew info android-studio
android-studio: 2021.2.1.15 (auto_updates)
https://developer.android.com/studio/
/usr/local/Caskroom/android-studio/2021.2.1.15 (18.2KB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/android-studio.rb
==> Name
Android Studio
==> Description
Tools for building Android applications
==> Artifacts
Android Studio.app (App)
==> Analytics
install: 3,262 (30 days), 9,829 (90 days), 39,837 (365 days)

Cocoapods version

cocoapods: stable 1.11.3 (bottled)

% brew info cocoapods
Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
cocoapods: stable 1.11.3 (bottled)
Dependency manager for Cocoa projects
https://cocoapods.org/
/usr/local/Cellar/cocoapods/1.11.3 (14,135 files, 29.9MB) *
  Poured from bottle on 2022-06-30 at 19:07:44
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/cocoapods.rb
License: MIT
==> Dependencies
Build: pkg-config ✔
==> Analytics
install: 51,569 (30 days), 159,087 (90 days), 633,160 (365 days)
install-on-request: 51,397 (30 days), 158,428 (90 days), 628,213 (365 days)
build-error: 54 (30 days)
@foneazmi
Copy link

foneazmi commented Jul 6, 2022

build APK also get this issue

@vthunetcompany
Copy link

Same when built by CircleCi machines. Only happens in realm v10.19.4.
My solution: downgrading to 10.19.3 – which is the last stable version

@tomduncalf
Copy link
Contributor

tomduncalf commented Jul 6, 2022

Hey all, apologies, this release inadvertently changed the minimum version of the Android Gradle plugin required to 4.2.x. I'll get a new release together with a fix for this so that you don't have to modify your Android Studio projects. For now using the previous release (or upgrading the Android Gradle plugin version) is a workaround

@vthunetcompany
Copy link

Thank you, @tomduncalf 😁

@tomduncalf
Copy link
Contributor

I've just published Realm JS v10.19.5 which should fix this issue. Please let me know if you are still having issues.

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

Successfully merging a pull request may close this issue.

4 participants