尝试与其他用户在React Native项目上进行协作。该项目在我的计算机上成功编译,但遇到异常。
将我的项目推送到GitHub存储库以与其他用户一起工作后。
他克隆了项目,安装了节点模块(npm install),并尝试运行react-native run-android。
他遇到以下错误,我们似乎无法解决:无法解决项目:libs:SalesforceReact。
此错误似乎表明这可能是gradle问题,但阅读以前的gradle帖子似乎表明settings.gradle和build.gralde决定了构建时的gradle版本。
他的机器: Windows 8.1 64位 JDK:1.8.0_191
我的机器: Windows 10 64位 JDK:1.8.0_171
settings.gradle:
rootProject.name = 'testforce'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':tipsi-stripe'
project(':tipsi-stripe').projectDir = new File(rootProject.projectDir, '../node_modules/tipsi-stripe/android')
def libsRootDir = new File( settingsDir, '../mobile_sdk/SalesforceMobileSDK-Android/libs' )
include ':app'
include ':libs:SalesforceAnalytics'
project( ':libs:SalesforceAnalytics' ).projectDir = new File( libsRootDir, 'SalesforceAnalytics' )
include ':libs:SalesforceSDK'
project( ':libs:SalesforceSDK' ).projectDir = new File( libsRootDir, 'SalesforceSDK' )
include ':libs:SmartStore'
project( ':libs:SmartStore' ).projectDir = new File( libsRootDir, 'SmartStore' )
include ':libs:SmartSync'
project( ':libs:SmartSync' ).projectDir = new File( libsRootDir, 'SmartSync' )
include ':libs:SalesforceReact'
project( ':libs:SalesforceReact' ).projectDir = new File( libsRootDir, 'SalesforceReact' )
Build.gradle依赖项:
dependencies {
compile project(':react-native-vector-icons')
implementation project(':tipsi-stripe')
implementation project(':react-native-vector-icons')
implementation(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation 'com.google.android.gms:play-services-base:12.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:appcompat-v7:23.0.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-analytics:16.0.3'
implementation "com.facebook.react:react-native:+"
//implementation project(path: ':libs:SalesforceReact', configuration: 'default')
api project(':libs:SalesforceReact') // From node_modules
}