在应用RN开发跨平台APP阶段,从git中拉取项目,应用Jenkins进行组包时,发现最终生成的ipa安装包版本号始终与项目中设置的版本号不一致。
二、问题描述
经过仔细排查,发现Jenkins在Archive
编译、归档阶段失败,但是后续Export
阶段生成了ipa包。
error: Multiple commands produce '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-eomylkmdzkgaughihoblturddotc/Build/Products/Debug-iphonesimulator/PopNews.app':
1) Target 'xxx' has create directory command with output '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-eomylkmdzkgaughihoblturddotc/Build/Products/Debug-iphonesimulator/PopNews.app'
2) That command depends on command in Target 'xxx': script phase “[CP] Copy Pods Resources”
三、问题解决
- 在xCode中打开应用,选中项目 target -> Build phase -> Copy Pods Resources -> Output Files -> 移除
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH} /*
。 - 将项目源码压缩上传至Jenkins预设指定目录,进行流水线组包作业。
四、拓展阅读
4.1 版本号查看
android
中 android/app/build.gradle
文件中版本设置如下:
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.china.shq5785"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 18072801
versionName "2.2.5"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
// This will later be used to control the test apk build type
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
ndk {
//设置支持的SO库架构
abiFilters "armeabi", "armeabi-v7a", "x86\_64" //, "arm64-v8a"
}
missingDimensionStrategy &