wonderpush / wonderpush-cordova-sdk

Cordova SDK for WonderPush − Advanced push notification service for mobile applications and Websites. High volume, fast delivery and full-featured starting €1/month.
https://www.wonderpush.com
7 stars 6 forks source link

Cordova iOS 7.0.0 installation problems #23

Open phillipplum opened 1 year ago

phillipplum commented 1 year ago

When I install woderpush-cordova-sdk and running cordova-ios with latest version 7.0.0 I gettings this error:

  stderr: '/Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding\': can\'t modify frozen String: "[!] Dictionary missing \';\' after key-value pair for \\\\"PRODUCT_BUNDLE_IDENTIFIER\\\\", found \\\\".\\\\"\\\\n   #  -------------------------------------------\\\\n   #  \\\\t\\\\t\\\\t\\\\tGCC_DYNAMIC_NO_PIC = NO;\\\\n   #  \\\\t\\\\t\\\\t\\\\tGCC_OPTIMIZATION_LEVEL = 0;\\\\n900>  \\\\t\\\\t\\\\t\\\\tPRODUCT_BUNDLE_IDENTIFIER = \\\\"com.app.demo\\\\".WonderPushNotificationServiceExtension;\\\\n      \\\\t\\\\t\\\\t\\\\t                                              ^\\\\n   #  \\\\t\\\\t\\\\t};\\\\n   #  \\\\t\\\\t\\\\tbaseConfigurationReference = D15E5139FD424B778B214DF9 /* \\\\"wonderpushnotificationserviceextension-debug.xcconfig\\\\" */;\\\\n   #  -------------------------------------------\\\\n" (FrozenError)\n' +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface/error_report.rb:34:in `report'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:66:in `report_error'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/claide-1.1.0/lib/claide/command.rb:396:in `handle_exception'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/claide-1.1.0/lib/claide/command.rb:324:in `run'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/bin/pod:25:in `load'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/bin/pod:25:in `<main>'\n" +
    '/Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:284:in `raise_parser_error\': [!] Dictionary missing \';\' after key-value pair for "PRODUCT_BUNDLE_IDENTIFIER", found "." (Nanaimo::Reader::ParseError)\n' +
    '   #  -------------------------------------------\n' +
    '   #  \t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n' +
    '   #  \t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n' +
    '900>  \t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = "com.app.demo".WonderPushNotificationServiceExtension;\n' +
    '      \t\t\t\t                                              ^\n' +
    '   #  \t\t\t};\n' +
    '   #  \t\t\tbaseConfigurationReference = D15E5139FD424B778B214DF9 /* "wonderpushnotificationserviceextension-debug.xcconfig" */;\n' +
    '   #  -------------------------------------------\n' +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:199:in `parse_dictionary'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:132:in `parse_object'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:193:in `parse_dictionary'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:132:in `parse_object'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:193:in `parse_dictionary'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:132:in `parse_object'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:193:in `parse_dictionary'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:132:in `parse_object'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/nanaimo-0.3.0/lib/nanaimo/reader.rb:107:in `parse!'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/xcodeproj-1.22.0/lib/xcodeproj/plist.rb:27:in `read_from_path'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:211:in `initialize_from_file'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:113:in `open'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1194:in `block (2 levels) in inspect_targets_to_integrate'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in `each'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in `block in inspect_targets_to_integrate'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1188:in `inspect_targets_to_integrate'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:107:in `analyze'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:422:in `analyze'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:243:in `resolve_dependencies'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:162:in `install!'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:52:in `run'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'\n" +
    "\tfrom /Users/username/.rubies/ruby-2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/bin/pod:25:in `load'\n" +
    "\tfrom /Users/username/.gem/ruby/2.7.4/bin/pod:25:in `<main>'\n",
  stdout: '  Preparing\n' +
    '\n' +
    'Analyzing dependencies\n' +
    '\n' +
    'Inspecting targets to integrate\n' +
    '  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update\n',
  code: 1
}
ofavre commented 1 year ago

Hi,

I wonder where those quotes come from.

Can you try to:

  1. Find the file where those quotes come from: grep -F -e '"com.app.demo"' -R .
  2. Remove the quotes. If it does not work, remove the quote in the middle and place it in the end, before the ;
  3. Try to build

If the issues comes back can you find a reproduction to make those quotes appear, we'll then be able to fix our hook.

phillipplum commented 12 months ago

Hello, I've finally been able to do some testing.

If I add the iOS platform completely new and do not install Wonderpush Cordova SDK I find the following results:

./platforms/ios/Demo.xcodeproj/project.pbxproj:  PRODUCT_BUNDLE_IDENTIFIER = "com.app.demo";
./platforms/ios/Demo.xcodeproj/project.pbxproj:  PRODUCT_BUNDLE_IDENTIFIER = "com.app.demo";

If I remove the quotes and then run cordova plugin add, the quotes are added again. The search then returns the following result.

./platforms/ios/Demo.xcodeproj/project.pbxproj:  PRODUCT_BUNDLE_IDENTIFIER = "com.app.demo";
./platforms/ios/Demo.xcodeproj/project.pbxproj:  PRODUCT_BUNDLE_IDENTIFIER = "com.app.demo";
./platforms/ios/Demo.xcodeproj/project.pbxproj:  PRODUCT_BUNDLE_IDENTIFIER = "com.app.demo".WonderPushNotificationServiceExtension;
./platforms/ios/Demo.xcodeproj/project.pbxproj:  PRODUCT_BUNDLE_IDENTIFIER = "com.app.demo".WonderPushNotificationServiceExtension;
ofavre commented 11 months ago

I cannot reproduce the quotes.

Xcode accepts creating a project with a dash in it's bundle identifier and then uses quotes. Otherwise I have no quotes. But since we're talking cordova I have to make cordova create the project and the cordova create command refuses dashes, underscores or accentuated characters.

Can you give me a reproduction with a few commands I would run?

ofavre commented 11 months ago

I've been fiddling a bit and managed to get Xcode to add quotes. Can you test our plugin using the latest commit?

# Remove the plugin if necessary
cordova plugin rm wonderpush-cordova-sdk --variable CLIENT_ID=… --variable CLIENT_SECRET=…

# Checkout out the WonderPush Cordova SDK at the right commit
git clone https://github.com/wonderpush/wonderpush-cordova-sdk.git ../wonderpush-cordova-sdk
cd ../wonderpush-cordova-sdk
git checkout e03152cf950d4837ce3f31cce5c1982f134985af

# Go back to your project
cd -

# Add the WonderPush Cordova SDK from the local checkout
cordova plugin add ../wonderpush-cordova-sdk --variable CLIENT_ID=… --variable CLIENT_SECRET=…

Note the way to add the WonderPush Cordova SDK now uses a (relative) path.

If it works fine for you I'll release it. I'm still interested in your reproduction commands if you can provide them.

phillipplum commented 11 months ago

Hey, I apologise for my delay.

Now I get this error: /platforms/ios/WonderPushNotificationServiceExtension/wonderpushnotificationserviceextension-debug.xcconfig:7:1: error: could not find included file '../Pods/Target Support Files/Pods-WonderPushNotificationServiceExtension/Pods-WonderPushNotificationServiceExtension.debug.xcconfig' in search paths

If I create a new clean cordova project, the problem does not exist. So, I think I have a problem with other plugin(s). I will start with a new project and gradually add more plugins. Maybe I'll find the problem that way.

phillipplum commented 11 months ago

Hey I want to give a small update.

Your fix works but cordova-ios version >= 7 breaks Podfile on build. I create a issue for this: https://github.com/apache/cordova-ios/issues/1389

sevkonline commented 1 week ago

Hey, I apologise for my delay.

Now I get this error: /platforms/ios/WonderPushNotificationServiceExtension/wonderpushnotificationserviceextension-debug.xcconfig:7:1: error: could not find included file '../Pods/Target Support Files/Pods-WonderPushNotificationServiceExtension/Pods-WonderPushNotificationServiceExtension.debug.xcconfig' in search paths

If I create a new clean cordova project, the problem does not exist. So, I think I have a problem with other plugin(s). I will start with a new project and gradually add more plugins. Maybe I'll find the problem that way.

Hi, I'm also trying to deal with this error. Did you find any solution?