Skip to content

Commit

Permalink
fix(): Fixed offline jCenter servers and React Native bug since 4 nov…
Browse files Browse the repository at this point in the history
… 2022.
  • Loading branch information
sampie777 committed Nov 7, 2022
1 parent 86e8953 commit 809b946
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 8 deletions.
81 changes: 78 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,49 @@ buildscript {
multiDexEnabled = true
}
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://repo.huaweicloud.com/repository/maven' }
maven { url 'https://www.jitpack.io' }

google()
jcenter()
def REPOSITORY_URL = 'https://maven.aliyun.com/nexus/content/groups/public/'
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
maven {
url REPOSITORY_URL
}

//hms
maven {url 'http://developer.huawei.com/repo/'}
//fcm
maven { url "https://maven.google.com" }
maven { url "https://plugins.gradle.org/m2/" }

maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.4")
Expand All @@ -30,9 +71,43 @@ allprojects {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://repo.huaweicloud.com/repository/maven' }
maven { url 'https://www.jitpack.io' }

google()
jcenter()
maven { url 'https://www.jitpack.io' }
def REPOSITORY_URL = 'https://maven.aliyun.com/nexus/content/groups/public/'
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
maven {
url REPOSITORY_URL
}

//hms
maven {url 'http://developer.huawei.com/repo/'}
//fcm
maven { url "https://maven.google.com" }
maven { url "https://plugins.gradle.org/m2/" }

maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
}
configurations {
all*.exclude group: 'com.google.firebase:firebase-common', module: 'firebase-common'
all*.exclude group: 'com.google.firebase', module: 'firebase-components'
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@react-navigation/native-stack": "^6.2.5",
"abcjs": "git+https://github.com/paulrosen/abcjs.git",
"react": "17.0.2",
"react-native": "0.63.4",
"react-native": "0.63.5",
"react-native-config": "^1.4.5",
"react-native-device-info": "^8.3.1",
"react-native-gesture-handler": "^1.10.3",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6332,10 +6332,10 @@ react-native-vector-icons@^8.1.0:
prop-types "^15.7.2"
yargs "^16.1.1"

[email protected].4:
version "0.63.4"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.63.4.tgz#2210fdd404c94a5fa6b423c6de86f8e48810ec36"
integrity sha512-I4kM8kYO2mWEYUFITMcpRulcy4/jd+j9T6PbIzR0FuMcz/xwd+JwHoLPa1HmCesvR1RDOw9o4D+OFLwuXXfmGw==
[email protected].5:
version "0.63.5"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.63.5.tgz#2c0d5dca527fb69bb481e89b2c86068f2641b62d"
integrity sha512-unjHZOcHek2xxPkBbyqGO//2Z/AriKTwtDzGTT/ujGMRE3odDJk8wKtZregurQ9cpTUtu1Bj5R5bJv3gQIG5zw==
dependencies:
"@babel/runtime" "^7.0.0"
"@react-native-community/cli" "^4.10.0"
Expand Down

0 comments on commit 809b946

Please sign in to comment.