这是我的 build.gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven {
url 'https://dl.google.com/dl/android/maven2/'
name 'Google'
}
maven { url "https://jitpack.io" }
google()
jcenter ()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
// classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
//mavenLocal()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
// maven { url 'http://jcenter.bintray.com' }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// ADD THIS
maven { url 'https://maven.google.com' }
// ADD THIS
maven { url "https://jitpack.io" }
jcenter()
flatDir {
dirs 'src/main/assets/libs'
}
}
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.0.2"
}
}
}
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
ext {
buildToolsVersion = "28.0.3"
compileSdkVersion = 28
targetSdkVersion = 28
//compileSdkVersion = 27
//targetSdkVersion = 27
//buildToolsVersion = "27.0.3"
supportLibVersion = "28.0.3"
googlePlayServicesVersion = "15.0.1"
minSdkVersion = 19
// firebaseVersion = "16.0.3"
// firebaseMessageVersion = "17.3.2"
googlePlayServicesAuthVersion = "15.0.1"
googlePlayServicesAuthVersionNew = "16.0.0"
// firebaseDatabase = "16.0.2"
}
我收到此错误消息:
* What went wrong:
A problem occurred configuring project ':@segment/analytics-react-native'.
> The project name '@segment/analytics-react-native' must not contain any of the following characters: [/, \, :, <, >, ", ?, *, |]. Set the 'rootProject.name' or adjust the 'include' statement (see https://docs.gradle.org/5.6.4/dsl/org.gradle.api.initialization.Settings.html#org.gradle.api.initialization.Settings:include(java.lang.String[]) for more details).
我的依赖:
"dependencies": {
"@segment/analytics-react-native": "^1.1.0",
"axios": "^0.19.2",
"buffer": "^5.2.1",
"crypto-js": "^3.1.9-1",
"jalali-moment": "^3.2.1",
"jetifier": "^1.6.2",
"moment": "^2.22.2",
"native-base": "^2.6.1",
"node-forge": "^0.7.6",
"paths-js": "^0.4.7",
"perf_hooks": "0.0.1",
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-autoheight-webview": "^1.1.5",
"react-native-base64": "^0.0.2",
"react-native-chart-kit": "^1.1.5",
"react-native-contacts": "^2.2.5",
"react-native-document-picker": "^2.1.0",
"react-native-floating-action": "^1.14.1",
"react-native-fs": "^2.11.15",
"react-native-geocoder": "^0.5.0",
"react-native-geolocation-service": "^4.0.2",
"react-native-image-resizer": "^1.0.0",
"react-native-image-zoom-viewer": "^2.2.26",
"react-native-linear-gradient": "^2.5.3",
"react-native-maps": "^0.21.0",
"react-native-material-bottom-navigation": "^1.0.0",
"react-native-modal": "^6.5.0",
"react-native-multiple-select": "^0.5.5",
"react-native-persian-calendar-picker": "^2.2.2",
"react-native-progress-bar-animated": "^1.0.6",
"react-native-ratings": "^6.0.0",
"react-native-rename": "^2.4.1",
"react-native-render-html": "^4.2.0",
"react-native-slider": "^0.11.0",
"react-native-snap-carousel": "^3.7.5",
"react-native-svg": "^6.5.2",
"react-native-swiper": "^1.5.13",
"react-native-vector-icons": "^6.1.0",
"react-native-webview": "5.8.1",
"react-navigation": "^2.8.0",
"react-navigation-fluid-transitions": "^0.2.72",
"react-navigation-transitions": "^1.0.5",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0",
"watchman": "^1.0.0"
},