xcode

oakley814 years ago

I am having an issue attempting to archive the Traccar Manager in xcode, I am able to build and run the app but when I attempt to archive I get this error.

"Could not get GOOGLE_APP_ID in Google Services file from build environment"

I have done some research and I believe it has something to do with a missing google plist file, I have attempted to add the file manually but I am unable to find it within the Traccar Manager folder.

Anton Tananaev4 years ago

Check build steps configuration. It copies the file from an external folder.

oakley814 years ago

Thanks, looking at Build Settings, I currently have Embed Swift Standard Libraries > Google set to "yes".

Is there anything specific I should be looking at within build settings?

Thanks for your help!

Anton Tananaev4 years ago

Looks at the Build Phases. There is a script there.

oakley814 years ago

Thanks, I currently have the default script

if [ "${CONFIGURATION}" = "Google" ]; then
cp -r "${PROJECT_DIR}/../traccar-shared/google-services/traccar-manager-ios.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
"${PODS_ROOT}/Fabric/run"
fi
"${PODS_ROOT}/FirebaseCrashlytics/run"
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/TraccarManager/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
oakley814 years ago

I changed the "fi" to "if" within the run script, and it seems to have removed the Google ID error however it then presents a new error "Command PhaseScriptExecution failed with nonzero exit code"

Anton Tananaev4 years ago

You took a perfectly valid script and broke it. You should probably take your time and do some research.

oakley814 years ago

I did alter the script after some research, although the original script reports the Google ID error.

if [ "${CONFIGURATION}" = "Google" ]; then
cp -r "${PROJECT_DIR}/../traccar-shared/google-services/traccar-manager-ios.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
"${PODS_ROOT}/Fabric/run"
fi
Anton Tananaev4 years ago

Do you understand what the script does?

oakley814 years ago

Not exactly, I understand that it creates a second file with the same contents, unsure where it downloads the plist from an external folder and where that external folder is "/../traccar-shared/google-services/"

Anton Tananaev4 years ago

You should have an external folder. Do you have it?

oakley814 years ago

I only have the folders/files that came with the source code, am I missing something else?

Anton Tananaev4 years ago

If you want to build a Google build, you have to have the folder. You have to create it yourself. We obviously don't provide our own keys.

oakley814 years ago

Thanks, I've removed the script and it archives fine now.

Hi!
I'm having the same problem. What is the file/script that I have to delete? Thanks!