Tag Archives: ios

Failed to register bundle identifier. The app identifier “xxx” cannot be registered to your developm

Error

Failed to register bundle identifier. The app identifier “xxx” cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string to try again.

Provisioning profile “iOS Team Provisioning Profile: *” doesn’t support the Associated Domains and Push Notifications capability.

Provisioning profile “iOS Team Provisioning Profile: *” doesn’t include the aps-environment and com.apple.developer.associated-domains entitlements.

Please add picture description

Solution:

Log in to Xcode with the apple account that supports the APP, and select the team where the account is locatedPlease add a picture description

As shown in the picture, Select the team corresponding to the account
Please add a picture description

How to Solve Xcode 14 Pod Signature Error

Background:

After pod install with Xcode 14, If there are bundle resource files in the library, an error will be reported during compilation, error: “igning for “xxxxx” requires a development team. Select a development team in the Signing & Capabilities editor.”

Solution:

Option 1:
Set the bundle identifier and team for the pod library that reported the error one by one.

Disadvantages: Our configuration will disappear after each execution of pod install, Need to manually set it again

Option 2:

Add the following configuration in Podfile, add and then re-pod update

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = " Your Team ID &# 34;
         end
    end
  end
end

If you don’t want to set a specific team ID, try the following configuration:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" 
      target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      end
    end
  end
end

The above solution comes from: https://github.com/CocoaPods/CocoaPods/issues/11402

[Solved] SyntaxError: Invalid regular expression: invalid group specifier name

SyntaxError: Invalid regular expression: invalid group specifier name

Regular problem

SafariSyntaxError: Invalid regular expression: invalid group specification name
FirefoxSyntaxError: invalid regexp group
Mobile terminal: Android is normal, iOS is not

reason

Firefox, IE, and IOS do not support the following writing methods: ?<=, ?<!, ?!, ?=

Look ahead is a kind of conditional judgment, such as if statement
(?=exp) the position that satisfies expression exp after positive look ahead match
(?!exp) the position that does not satisfy expression exp after negative look ahead match

Solution:

let reg = /ab?<=cd/
Modify to
let reg = new RegExp('ab(?<=cd)')

pod install error: Oh no, an error occurred. (Ultimate Solution)

Project scenario:

There was an error in pod install recently

[!] Oh no, an error occurred.


Problem description


JSON::ParserError - 416: unexpected token at '"SharedTestUtilities/FIROptionsMock'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/json.rb:61:in `from_json'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:748:in `from_string'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:722:in `from_file'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source.rb:188:in `specification'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/set.rb:58:in `block in specification_name'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/set.rb:56:in `each'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/set.rb:56:in `specification_name'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:216:in `search'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source/aggregate.rb:83:in `select'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source/aggregate.rb:83:in `search'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:416:in `create_set_from_sources'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:385:in `find_cached_set'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:360:in `specifications_for_dependency'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:165:in `search_for'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:267:in `each'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:267:in `sort_by'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:267:in `sort_by!'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:60:in `block in sort_dependencies'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:77:in `with_no_such_dependency_error_handling'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:59:in `sort_dependencies'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:754:in `push_state_for_requirements'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:744:in `require_nested_dependencies_for'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:727:in `activate_new_spec'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/Users/tiger/.rvm/gems/ruby-2.6.3/bin/pod:23:in `load'
/Users/tiger/.rvm/gems/ruby-2.6.3/bin/pod:23:in `<main>'
/Users/tiger/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/Users/tiger/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=416%3A+unexpected+token+at+%27%22SharedTestUtilities%2FFIROptionsMock%27&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Found no similar issues. To create a new issue, please visit:
https://github.com/cocoapods/cocoapods/issues/new


Cause analysis:

In fact, after upgrading cocoapods, you need to clear it…


Solution:

Use this following command to clear the cache:

sudo rm -rf ~/.cocoapods/repos

IOS Adds C File Error [How to Solve]

Reason: This is actually the logic of using pch files in Xcode compilation, after introducing c files in the project, pch will mix #include and #import, in order to reduce compiler workload, you need to use precompiled macros to make a slight distinction.

Solution: Check all pch files in the project and put “#import xxx”, which is only used in OC, in “#indef __OBJC__” and “#endif”

#ifndef PrefixHeader_pch
#define PrefixHeader_pch

#ifdef __OBJC__

#import "Masonry.h"

#endif


#endif /* PrefixHeader_pch */

[Solved] Flutter Error: No MediaQuery widget ancestor found.

Error reporting is shown in figure

Problem code

import 'package:flutter/material.dart';

void main() {
  runApp(SampleAppPage());
}

class SampleAppPage extends StatefulWidget {
  const SampleAppPage({Key?key}) : super(key: key);

  @override
  _SampleAppPageState createState() => _SampleAppPageState();
}

class _SampleAppPageState extends State<SampleAppPage>
    with SingleTickerProviderStateMixin {
  late AnimationController controller;
  late CurvedAnimation curve;

  @override
  void initState() {
    super.initState();
    controller = AnimationController(
      duration: const Duration(milliseconds: 2000),
      vsync: this,
    );
    curve = CurvedAnimation(
      parent: controller,
      curve: Curves.easeIn,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: GestureDetector(
          child: RotationTransition(
            turns: curve,
            child: const FlutterLogo(size: 200.0),
          ),
          onDoubleTap: () {
            if (controller.isCompleted) {
              controller.reverse();
            } else {
              controller.forward();
            }
          },
        ),
      ),
    );
  }
}

Reason: the root component of the fluent interface must be MaterialApp

Code after repair

import 'package:flutter/material.dart';

void main() {
  runApp(SampleApp());
}

class SampleApp extends StatelessWidget {
  // This widget is the root of your application.
  const SampleApp({Key?key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Sample App',
      home: SampleAppPage(),
    );
  }
}

class SampleAppPage extends StatefulWidget {
  const SampleAppPage({Key?key}) : super(key: key);

  @override
  _SampleAppPageState createState() => _SampleAppPageState();
}

class _SampleAppPageState extends State<SampleAppPage>
    with SingleTickerProviderStateMixin {
  late AnimationController controller;
  late CurvedAnimation curve;

  @override
  void initState() {
    super.initState();
    controller = AnimationController(
      duration: const Duration(milliseconds: 2000),
      vsync: this,
    );
    curve = CurvedAnimation(
      parent: controller,
      curve: Curves.easeIn,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: GestureDetector(
          child: RotationTransition(
            turns: curve,
            child: const FlutterLogo(size: 200.0),
          ),
          onDoubleTap: () {
            if (controller.isCompleted) {
              controller.reverse();
            } else {
              controller.forward();
            }
          },
        ),
      ),
    );
  }
}

 

[Solved] FlutterIOS CDN trunk Repo update failed – 34 error(s)

FlutterIOS CDN trunk Repo update failed – 34 error(s)

Add the following codes behind the Podfile:
[!] CDN: trunk Repo update failed – 34 error(s):

source 'https://github.com/CocoaPods/Specs.git'

First, you have to execute the following commands

git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master

Then view the pod repo list

remove the selected
by executing pod repo remove trunk. Finally, execute pod install

If this problem occurs

just change the platform in podfile: IOS, ‘13.0’
adapt to the IOS version of cocoapods

[Solved] pod CDN: trunk Repo update failed – 56 error(s):

pod CDN: trunk Repo update failed – 56 error(s):

An error is reported when performing pod install: (reason for this problem: cocoapods 1.8 switches the CDN to the default spec repo source)

[!] CDN: trunk Repo update failed - 56 error(s):
---
---

1. Check the version number to see if the version is 1.8 or later

pod --version

2. Remove trunk

pod repo remove trunk

3. Enter this directory

cd ~/.cocoapods/repos

4. Execute command

git clone --depth 1 https://github.com/CocoaPods/Specs.git master

5. Here you are. Just execute pod install again.

How to Solve Xcode M1 simulator Error

Error reported by Xcode M1 simulator

Operation error:

1.building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
2.The linked framework ‘Pods.framework’ is missing one or more architectures required by this target: arm64

Solution:
1 Build settings change:

2 Podfile add:

 post_install do |installer|
   installer.pods_project.build_configurations.each do |config|
     config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
   end
 end

3.xcode clean;
4. pod install

Pod installation errors:

sudo arch -x86_64 gem install ffi
gem install ffi --version 1.13.1 --user-install
arch -x86_64 pod install

[Solved] cocopod Error: failed: undefined method `map‘ for nil:NilClass

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command


/usr/local/bin/pod install


### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack


   CocoaPods : 1.8.4
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
    RubyGems : 3.0.6
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 11.3.1 (11C504)
         Git : git version 2.19.0
Ruby lib dir : /Users/huanghaipo/.rvm/rubies/ruby-2.6.3/lib
Repositories : HPSpecs - git - https://github.com/HuangHaiPo/HPSpecs.git @ 87ca8ef48b56269780abb0e14211ca1f2e121217
               HuModularizationSpecs - git - [email protected]:HuModularizationLibrary/HuModularizationSpecs.git @ cd28555226d424e50e8e7454c3a8a5b287e4b9f2
               master - git - https://github.com/CocoaPods/Specs.git @ 061335ab06da5c1f542cdb56bc0d73f9af2d1984




### Podfile

ruby
source 'https://github.com/CocoaPods/Specs.git'

# Uncomment this line to define a global platform for your project
 platform :ios, '9.0'


――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
pe=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass

Solution:

Execute the following command to update the local library. If the version is low, upgrade cocoapods

pod repo update
upgrade
sudo gem update --system
sudo gem install cocoapods
pod setup