bberak / react-native-game-engine-handbook

A React Native app showcasing some examples using react-native-game-engine 🐒✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not find method compileOnly()

opened this issue · comments

When executing react-native run-android I encounter the following error:

* What went wrong:
A problem occurred evaluating project ':react-native-linear-gradient'.
>Could not find method compileOnly() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHander.

Running:

Kubuntu 18.04
npm 6.4.1
react-native: 0.48.1

Hi @BrianD91,

I'm sorry you had such a difficult time getting this up and running.

I've had a lot of issues lately with third-party components that I have manually linked (like the linear gradient, OpenGL, sensors etc).

I've started a new branch based on Expo that I believe alleviates a lot (if not all) of these issues.

You can find the branch here: https://github.com/bberak/react-native-game-engine-handbook/tree/expo

The README has been updated with the new setup instructions.

Alternatively, if you already have the Expo app on your device - you should be able to run the handbook from here: https://expo.io/@bberak/react-native-game-engine-handbook

Let me know if that works!

Cheers.

Hi @BrianD91, I haven't heard from you for a while. Please feel free to re-open this issue if you need more assistance. Cheers.

@bberak I'm having the same issue compiling the project:

Could not find method compileOnly() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

is using Expo the only solution?

Hi @anchetaWern,

Using expo just helps with these compiler/linker issues when playing around with the handbook. Expo comes pre-packaged and linked with with OpenGL/WebGL, LineearGradient, and other native components the handbook uses (for both iOS and Android).

I believe Expo is the best way to keep this example project stable. WIth all the changes in iOS, Android SDK, React Native, Node and NPM, I've found the manually linked packages to be more and more temperamental.

Note that the core library (https://github.com/bberak/react-native-game-engine) is a JS-only dependency, no linking or anything is required.

@bberak thanks! I've gone ahead and tried it with Expo and it worked, except for the OpenGL examples. The expo app just crashed. Maybe its just my phone.

Ahh okay.. Thanks for trying that out @anchetaWern - to be honest I've never tried the expo app on a physical Android device - only on a simulator.. I'll see if I can borrow a real device and do some debugging (no promises unfortunately!).