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

Error when build and install app on Android

aldoalprak opened this issue · comments

Hi, I've issued when I tried to build and install this app on Android. FYI, I've followed all the instruction to install in Android.
Here is the error

JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-svg'.
      > Could not resolve all dependencies for configuration ':react-native-svg:_debugPublishCopy'.
         > Could not resolve com.facebook.fresco:fresco:1.3.0.
           Required by:
               RNGEHandbook:react-native-svg:unspecified > com.facebook.react:react-native:0.48.1
            > Could not resolve com.facebook.fresco:fresco:1.3.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.facebook.fresco/fresco/1.3.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
            > Could not resolve com.facebook.fresco:fresco:1.3.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.facebook.fresco/fresco/1.3.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
         > Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.3.0.
           Required by:
               RNGEHandbook:react-native-svg:unspecified > com.facebook.react:react-native:0.48.1
            > Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.3.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.facebook.fresco/imagepipeline-okhttp3/1.3.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
            > Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.3.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.facebook.fresco/imagepipeline-okhttp3/1.3.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
         > Could not resolve com.facebook.soloader:soloader:0.1.0.
           Required by:
               RNGEHandbook:react-native-svg:unspecified > com.facebook.react:react-native:0.48.1
            > Could not resolve com.facebook.soloader:soloader:0.1.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.facebook.soloader/soloader/0.1.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
            > Could not resolve com.facebook.soloader:soloader:0.1.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.facebook.soloader/soloader/0.1.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
         > Could not resolve com.squareup.okhttp3:okhttp:3.6.0.
           Required by:
               RNGEHandbook:react-native-svg:unspecified > com.facebook.react:react-native:0.48.1
            > Could not resolve com.squareup.okhttp3:okhttp:3.6.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.squareup.okhttp3/okhttp/3.6.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
            > Could not resolve com.squareup.okhttp3:okhttp:3.6.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.squareup.okhttp3/okhttp/3.6.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
         > Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.6.0.
           Required by:
               RNGEHandbook:react-native-svg:unspecified > com.facebook.react:react-native:0.48.1
            > Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.6.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.squareup.okhttp3/okhttp-urlconnection/3.6.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
            > Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.6.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.squareup.okhttp3/okhttp-urlconnection/3.6.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
         > Could not resolve com.squareup.okio:okio:1.13.0.
           Required by:
               RNGEHandbook:react-native-svg:unspecified > com.facebook.react:react-native:0.48.1
            > Could not resolve com.squareup.okio:okio:1.13.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.squareup.okio/okio/1.13.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.
            > Could not resolve com.squareup.okio:okio:1.13.0.
               > Could not parse Ivy file /home/alprak/.gradle/caches/modules-2/metadata-2.16/descriptors/com.squareup.okio/okio/1.13.0/22da77b0d76ea8df17298218f3ec1f87/ivy.xml
                  > Premature end of file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 12.41 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

node version = 8.12.0
npm version = 6.4.1
OS = Ubuntu

In my case, it seems to have failed possibly before than that:

$ react-native run-android
Scanning 682 folders for symlinks in /Users/zatanna/Development/react-native/react-native-game-engine-handbook/node_modules (564ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/zatanna/Development/react-native/react-native-game-engine-handbook/node_modules/react-native-linear-gradient/android/build.gradle' line: 21

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.363 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

The error, in my case is related to the react-native-linear-gradient dependency. In yours it's related to react-native-svg (I believe that my build didn't even get to that one).

I really wanted to see this in action. The iOS port seems also broken 😭

Hi @aldoalprak,

I've never tried running anything react-native related on Ubuntu, so I'm not sure how much help I can be here..

However, I suspect that in both cases it has something do with with the "native" libraries that have been linked (SVG, OpenGL, probably a few others).

If we cannot get this solved - I'll probably create a vanilla branch of this repo with all these native dependencies removed - I will have to remove some examples though, like the OpenGL stuff, but at least you'll be able to get a little taste.

Hi @aldoalprak,

If you're still have troubles getting the master branch to build, I've started a new expo branch that uses the expo-cli to run the project - it could be more stable for you. However, I haven't converted all of the examples to work on the Expo SDK yet - so there will be a few bugs at the moment.

Branch (for building yourself): https://github.com/bberak/react-native-game-engine-handbook/tree/expo
Expo Project (for running without buikding first): https://expo.io/@bberak/react-native-game-engine-handbook

Let me know how it goes, cheers!

Hi @aldoalprak,

Did you get a chance to try the Expo branch and/or app? All the examples should be working, including the OpenGL/WebGL stuff.

Feel free to re-open this issue if required :)