react-native-static-server icon indicating copy to clipboard operation
react-native-static-server copied to clipboard

Does not work alongside RN 0.67.x

Open birdofpreyru opened this issue 3 years ago • 8 comments

birdofpreyru avatar Jan 22 '22 12:01 birdofpreyru

What issue are you encountering? We have had it running on iOS in every React-Native release since 0.64

stockhuman avatar Feb 24 '22 19:02 stockhuman

There was something about its gradle config, which crashed gradle build of my host project after the update to 0.67 from 0.66. Though, I am noob regarding Gradle, so it might be I was doing something wrong. I ended up just forking the lib, doing a bunch of changes in its Gradle file, most of whice aren't related, then it worked for me, so I am using my fork, and already forgot what was the issue, and what exactly fixed it for me.

birdofpreyru avatar Feb 24 '22 21:02 birdofpreyru

The issue is related to maven plugin ( also with compileSdkVersion ) due to Gradle version.

React Native 0.66 uses gradle version 7, So works perfect.

React Native 0.67 and onwards uses version 8. In gradle v8, maven is removed and maven-publish should be used ( according to https://stackoverflow.com/questions/69100888/plugin-with-id-maven-not-found ). Issues:-

  1. [Plugin with id 'maven' not found] ( gradlew commands ( clean, assembleDebug )
  2. [compileSdkVersion is not specified. Please add it to build.gradle] ( npx react-native run-android )

Solution:- The error is about gradle config that makes it incompatible with gradle version 8. Need to update build.gradle file in lib android folder to make it compatible with gradle v8

iqbalexperience avatar Apr 29 '22 09:04 iqbalexperience

I needed to modify my branch to make the same changes I found here before I could get this to work:

https://github.com/LucasMonteiro1/react-native-flic2/commit/324575436fe3547a6f9c8bf55b12bc049a11862f

lunarraid avatar May 10 '22 16:05 lunarraid

Ugh... I never mentioned, I have my fork published to NPM: @dr.pogodin/react-native-static-server, just in case anybody bumps into the same problem, can just use it.

birdofpreyru avatar May 17 '22 10:05 birdofpreyru

Ugh... I never mentioned, I have my fork published to NPM: @dr.pogodin/react-native-static-server, just in case anybody bumps into the same problem, can just use it.

Thanks your work,I can't get new version by npm. npm info react-native-static-server

[email protected] | MIT | deps: none | versions: 19
HTTP static file server for React Native
https://github.com/futurepress/react-native-static-server

keywords: react-native

dist
.tarball: https://registry.npmjs.org/react-native-static-server/-/react-native-static-server-0.5.0.tgz
.shasum: 4b396082bfe7dfdbba6fe7d7de894de5ba4ebadb
.integrity: sha512-RGteckPoBZq48p9Y8V67bjZGPxLHKkEOAffLSUJiGC7hkx+H+zuekqCR+04F30NuWB7y+nb8N7Qld2RGjX5DNg==
.unpackedSize: 67.9 kB

maintainers:
- fchasen <[email protected]>

dist-tags:
latest: 0.5.0

published over a year ago by fchasen <[email protected]>

jimzou avatar May 29 '22 09:05 jimzou

@jimzou npm info @dr.pogodin/react-native-static-server image

birdofpreyru avatar May 29 '22 12:05 birdofpreyru

@birdofpreyru Thanks,I asked a low-level question!

jimzou avatar May 30 '22 06:05 jimzou