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

chore(test-app): fix Android build #10

Merged
merged 2 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/test-app/android-workaround.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

// As of today (Oct 23) react-native is broken on Android
// We're fixing this by patching the repository order in the main gradle file of the Android project
// See:
// - https://github.com/facebook/react-native/pull/21910
// - https://github.com/facebook/react-native/issues/21907#issuecomment-432319128

const fs = require('fs')
const path = require('path')

const gradlePath = path.resolve(__dirname, 'project/android/build.gradle')

fs.writeFileSync(
gradlePath,
fs
.readFileSync(gradlePath, 'utf-8')
.replace(/google\(\)/g, '')
.replace(/jcenter\(\)/g, 'google()\njcenter()')
)
2 changes: 2 additions & 0 deletions packages/test-app/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ analytics
.setup('$SEGMENT_WRITE_TOKEN')
.then(() => console.log('Analytics ready'))
EOF

../android-workaround.js