A problem occurred evaluating project ':realm'.
Could not find method register() for arguments [forwardDebugPort, class org.gradle.api.tasks.Exec, build_cghwnz32kddbmy2s72tcptzbh$_run_closure2@3bb29db9] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
Having the same issue when attempting to upgrade gradle
Facing similar issue. Anybody figured out the fix yet ?
Facing the same issue.
Changing
tasks.register('forwardDebugPort', Exec) {
to
task forwardDebugPort(type: Exec) {
at
node_modules/realm/android/build.gradle' line: 24
is working, certainly not the solution, but for now, we can use it until the issue's fixed.
I believe it has been fixed in #2468 and released in v2.29.2. If not, please comment and reopen issue.
@kneth I checked on v2.29.2. we're still getting that build error. Can you please reopen the issue?
@vishalenrique Please post the error message.
I also encountered the same problem
> Configure project :realm
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\project\rn\orthExpert\node_modules\realm\android\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':realm'.
> Could not find method register() for arguments [forwardDebugPort, class org.gradle.api.tasks.Exec, build_bw1dth7e6p21pla7l7q1rzxzs$_run_closure2@7174db6a] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
* 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
@kneth it's the same error that @Lance-Mao posted
I am not able to reproduce it using a simple app (RN v0.60.5, Realm JS v2.29.2, Android 9 device connected through USB).
@vishalenrique @Lance-Mao Please post your set up to help me to reproduce. Or even better, post a small app which can reproduce it easily.
Facing similar issue
Facing similar issue
I also meet this problem, solved this by fallback version to 2.29.1
what cause this problem is task.register() is available from Gradle 4.9 which can be found in offical blog HERE, follow with android gradle plugin map table HERE means project's plugin should be over 3.2.0, also the [email protected] changelog says Fixed Gradle build error with Android Studio 3.5+, for my project is plugin version 3.1.2 and gradle verion 4.4
gradle-wrapper over 4.9 and gradle plugin over 3.2realm version to 2.29.1Hope this helps!
@dogbutcat Thanks for the details. It sounds like we should be more explicit in our documentation about which version of Gradle is required.
Same issue here.
Downgraded to 2.29.1. Works fine now.
@lsteixeira Did you try https://github.com/realm/realm-js/issues/2485#issuecomment-526075212 before downgrading?
@lsteixeira Did you try #2485 (comment) before downgrading?
Hi! :)
I can't migrate gradle plugin for now. I'm kinda "stuck" in React-Native 0.58 and I don't want to mess with gradle at the moment. Migrating React-Native to the latest or at least >= 0.59 brings some challenges to our project. :)
We're planning the upgrade in the next upcoming weeks. Then, I'll move to the latest realm. ;)
Thanks. ;)
Cheers,
Luis Teixeira
I'm on a rn 57 project with realm 2.26.1. Some other dep encouraged use to use gradle 5.6.2 (android plugin 3.5.0) but now realm won't build. so realm 2.26.1 requires which version of gradle?
specifically I got this error https://stackoverflow.com/questions/57329362/error-could-not-find-method-platform-for-arguments-react-native-firebase which encourages us to move to gradle 5.6.2
update: maybe I should update realm instead. Let me try.
Update: installing realm 0.29.2 let me get past the error. Now we are on gradle 5.x and realm 0.29.2
@morenoh149 Good to hear. Yes, v2.29.2 has a fix for building for RN Android.
@lsteixeira Did you have progress in your RN update?
"react-native": "0.57.8", "realm": "^2.29.1", Facing similar issue. Anybody figured out the fix yet ?
If only someone could help me!
@jishuke Which version of Gradle do you use? You might have to upgrade Gradle to get it to work.
I am closing the issue, and I suggest that you upgrade to a recent version. If you experience a similar issue in the future, please create a new issue.
Most helpful comment
Solved
I also meet this problem, solved this by fallback version to 2.29.1
Details
what cause this problem is
task.register()is available fromGradle 4.9which can be found in offical blog HERE, follow with android gradle plugin map table HERE means project's plugin should be over3.2.0, also the[email protected]changelog says Fixed Gradle build error with Android Studio 3.5+, for my project is plugin version3.1.2and gradle verion4.4There is two approach work for me to solve this:
gradle-wrapperover4.9andgradle pluginover3.2realmversion to2.29.1Hope this helps!