Rightpoint / ios-template

A `cookiecutter` template for iOS projects
MIT License
94 stars 26 forks source link

iOS-template script generates incorrect bundle identifier in app #135

Open joeycheek opened 5 years ago

joeycheek commented 5 years ago

Xcode version: 10.2.1

Description:

App built from template using Cookiecutter prompts creates app with incorrect company name in bundle identifier. App fails to install with error message: “Failed to install the requested application… The bundle identifier of the application could not be determined.”

Steps taken:

Downloaded and installed Cookiecutter, followed guidelines for creating a template app, disregarding ‘Hockey config’ and ‘Jira key’. When running app, bundle identifier in project editor is incorrect; app fails to install to simulator with error message: “Failed to install the requested application… The bundle identifier of the application could not be determined." By manually updating the id in the project editor problem is solved.

Expected Results:

Bundle identifier would be set during script initiated setup.

Actual Results:

Bundle Identifier incorrect.

Script inputs:

Screen Shot 2019-06-17 at 3 56 46 PM

Project info:

Screen Shot 2019-06-17 at 3 57 33 PM

Notes:

It appears that the default value is populating the build regardless of user inputed value for bundle identifier.

mattwhitlock commented 4 years ago

Probably due to generate_template.sh replace ordering on lines 90+:

replace "PRODUCTNAME" "{{ cookiecutter.project_name | replace(' ', '') }}"
replace "ORGANIZATION" "{{ cookiecutter.company_name }}"
replace "LEADDEVELOPER" "{{ cookiecutter.lead_dev }}"
replace "APPLEID" "{{ cookiecutter.apple_id }}"
replace "com.raizlabs.PRODUCTNAME" "{{ cookiecutter.bundle_identifier }}"

should probably be:

replace "com.raizlabs.PRODUCTNAME" "{{ cookiecutter.bundle_identifier }}"
replace "PRODUCTNAME" "{{ cookiecutter.project_name | replace(' ', '') }}"
replace "ORGANIZATION" "{{ cookiecutter.company_name }}"
replace "LEADDEVELOPER" "{{ cookiecutter.lead_dev }}"
replace "APPLEID" "{{ cookiecutter.apple_id }}"
mattwhitlock commented 4 years ago

I believe this fixed it. Generating PR shortly.