Tag Archives: xcode

[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

[Solved] Unity Import Xcode Project Error: iOS framework addition failed due to a CocoaPods installation failure.

iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.

When unity exports the Xcode project, it relies on the third-party cocoapods library. The error is as follows.

Solution:

Although the warning is written in the error, the warning problem is solved and the error is no longer reported.

cd ~
vim .profile  # If not, execute the following command, if yes, fill in export LANG=en_US.UTF-8
touch .profile # New .profile
source .profile # Let it take effect

The specific error reports are as follows (part):

iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.

After the failure, "pod repo update" was executed and succeeded. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: https://guides.cocoapods.org/using/troubleshooting.html for potential solutions.

pod install output:



    [33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
    Consider adding the following to ~/.profile:

    export LANG=en_US.UTF-8
    [0m
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `installation_root'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:226:in `podfile_path'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:30:in `report'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in `report_error'
	from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
	from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
	from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
	from /usr/local/bin/pod:25:in `load'
	from /usr/local/bin/pod:25:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `installation_root'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:226:in `podfile_path'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:205:in `podfile'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:160:in `verify_podfile_exists!'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:46:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
	from /usr/local/bin/pod:25:in `load'
	from /usr/local/bin/pod:25:in `<main>'



pod repo update output:

Updating spec repo `cocoapods`
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/cocoapods fetch origin --progress
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/cocoapods rev-parse --abbrev-ref HEAD
  master
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/cocoapods reset --hard origin/master
  HEAD 现在位于 9734315382c8 [Add] HBS-UI 1.1.0
Updating spec repo `ftsview-the-fotoable-cocoapods-specs`
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/ftsview-the-fotoable-cocoapods-specs fetch origin --progress
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/ftsview-the-fotoable-cocoapods-specs rev-parse --abbrev-ref HEAD
  master
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/ftsview-the-fotoable-cocoapods-specs reset --hard origin/master
  HEAD 现在位于 8984dba [Update] FtAdsPlatform (4.4.8.4)


    [33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
    Consider adding the following to ~/.profile:

    export LANG=en_US.UTF-8

Cocoapods Install ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.

Cocoapods installation failed

Complete error message trying to install my problem

Using alamofire needs to be based on cocoapods, but there are many problems in the process of trying to install cocoapods. It has failed for a long time. Finally, the installation is successful only after the on-demand broadcast of the leaders in the group. In fact, sometimes the solution to the problem is very simple. I hope this blog can help you.

Complete error reporting

yusael@air ~ % sudo gem install -n /usr/local/bin cocoapods
Fetching cocoapods-trunk-1.6.0.gem
Fetching cocoapods-search-1.0.1.gem
Fetching cocoapods-plugins-1.0.0.gem
Fetching cocoapods-try-1.2.0.gem
Fetching cocoapods-downloader-1.5.1.gem
Fetching cocoapods-deintegrate-1.0.5.gem
Successfully installed cocoapods-try-1.2.0
Successfully installed cocoapods-trunk-1.6.0
Successfully installed cocoapods-search-1.0.1
Successfully installed cocoapods-plugins-1.0.0
Successfully installed cocoapods-downloader-1.5.1
Successfully installed cocoapods-deintegrate-1.0.5
Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20211110-79554-472vcj.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-ffi_c-dir
	--without-ffi_c-dir
	--with-ffi_c-include
	--without-ffi_c-include=${ffi_c-dir}/include
	--with-ffi_c-lib
	--without-ffi_c-lib=${ffi_c-dir}/lib
	--enable-system-libffi
	--disable-system-libffi
	--with-libffi-config
	--without-libffi-config
	--with-pkg-config
	--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
	from extconf.rb:10:in `system_libffi_usable?'
	from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.4/gem_make.out

Try to install

Steps: first install homebrew, then update ruby, and then install cocoapods

Note: many online blogs require the installation of RVM, in fact, RVM does not have to be </ font>, but is just a way to update ruby

The blog of the boss is directly quoted here. The reference is as follows:

    1. Mac OS system install homebrew Mac OS system update Ruby Mac OS system restart cocoapods

My question

Generally speaking, the installation can be basically completed according to the above process. Here is my problem. My problem is that the version of ruby is too low. Before successful installation, my version is 2.6.3p62. I will update the ruby version to 3.0.2_ After 1, execute: sudo gem install - N/usr/local/bin cocoapods and the installation is successful!

The main problem here is that the latest ruby is updated through homebrew, but it is not necessarily the latest, so the installation fails.

(in fact, in the article of the boss cited above, it is written to configure the latest Ruby environment variables, but I didn’t read it carefully at the beginning)

Here are two ways to configure Ruby environment variables:

Method 1:

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc

Method 2:

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

Check whether the ruby version is updated through Ruby - V and try to install it later

Error: Your CLT does not support macOS 11.6 [How to Solve]

After upgrading MacOS to MacOS Big Sur, we will encounter an error: your CLT does not support MacOS 11.6. When installing or updating software with brew , we just need to reinstall Xcode select
solution:
enter the following command

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install 

At this time, you will be prompted to install Xcode select. In the pop-up box, we click Install, then the agreement will pop up, and then we click agree. Then wait for the installation to complete.

[Solved] Searching for inspections failed: undefined method `map‘ for nil:NilClass“

Recently, the new project of pod reported this error. My Mac M1, record it

[cocoapods error]: searching for inspections failed: undefined method ` map ‘for nil: nilclass “error

Solution: execute the following command line

sudo arch -x86_64 gem install ffi

Then pop install

[Solved] validateNewTexture:89: failed assertion `BytesPerRow of a buffer-backed texture with pixelFormat

IPA runtime tips compiled after Xcode upgrade (version 13.1)

validateNewTexture:89: failed assertion `BytesPerRow of a buffer-backed texture with pixelFormat(MTLPixelFormatBGRA8Unorm) must be aligned to 64 bytes, found bytesPerRow(5344)'

Solution:
Product->Scheme->Edit Scheme->Diagnostics->Cancel API Validation

Reference: https://stackoverflow.com/questions/58043738/validatenewtexture89-failed-assertion-bytesperrow-of-a-buffer-backed-texture/58051893

Runtime error – [xcodeproj] unknown object version. [How to Solve]

Error during pod install:

### Error

“`
RuntimeError – [Xcodeproj] Unknown object version.
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.15.0/lib/xcodeproj/project.rb:227:in `initialize_from_file’
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.15.0/lib/xcodeproj/project.rb:112:in `open’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1177:in `block (2 levels) in inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1176:in `each’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1176:in `block in inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1171:in `inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:106:in `analyze’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:410:in `analyze’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:234:in `resolve_dependencies’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:156:in `install!’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:52:in `run’
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>’
/usr/local/bin/pod:23:in `load’
/usr/local/bin/pod:23:in `<main>’
“`

Reason: Xcode version and CocoaPods version do not match, need to update CocoaPods
Solution.
Enter the command in the terminal

gem install cocoapods --pre

Error Messages:

ERROR:  While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

Plus permissions:

sudo gem install cocoapods --pre

Execute pod install again successfully!

Xcode12 error in compiling cocos2d [How to Solve]

Using xcode12 to build the cocos2d 3.17 project has the following similar problems:

the linked framework is missing one or more architectures required by this target arm64

The reason: because V8 does not support 32-bit CPU, that is, it does not support armv7. If you do not need to support 32-bit devices, you can directly remove the compilation of armv7

Amend as follows:

 

  Basically, the above four modifications can solve the project running in the debug mode. It has not been tried on the real machine for the time being. It should also directly modify the configuration in the release.

There will be some minor problems after modifying the above:

1.Argument value 10880 is outside the valid range [0, 255]

Amend as follows:

Need to

#define BT_ SHUFFLE(x,y,z,w) ((w)<& lt; 6 | (z)<& lt; 4 | (y)<& lt; 2 | (x))

Change to

#define BT_ SHUFFLE(x, y, z, w) (((w) <& lt; 6 | (z) <& lt; 4 | (y) <& lt; 2 | (x)) & 0xff)

2.The application’s Info.plist does not contain CFBundleShortVersionString.

Modify as follows: add cfbundleshortversion in info.plist

Xcode debugging for the real iPhone Error: code signature version is no longer supported

Details

Unable to install "MyApp"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
-

The code signature version is no longer supported.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
User Info: {
  DVTRadarComponentKey = 261622;
  MobileDeviceErrorCode = "(0xE8008029)";
  "com.apple.dtdevicekit.stacktrace" = (
0  DTDeviceKitBase           0x000000011edd83b8 DTDKCreateNSErrorFromAMDErrorCode + 220
1  DTDeviceKitBase           0x000000011ee16ae1 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
2  DVTFoundation            0x0000000107881b7c DVTInvokeWithStrongOwnership + 71
3  DTDeviceKitBase           0x000000011ee16822 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1440
4  IDEiOSSupportCore          0x000000011eccf999 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.294 + 3534
5  DVTFoundation            0x00000001079b4931 __DVT_CALLING_CLIENT_BLOCK__ + 7
6  DVTFoundation            0x00000001079b655b __DVTDispatchAsync_block_invoke + 1191
7  libdispatch.dylib          0x00007fff20508603 _dispatch_call_block_and_release + 12
8  libdispatch.dylib          0x00007fff205097e6 _dispatch_client_callout + 8
9  libdispatch.dylib          0x00007fff2050f5ca _dispatch_lane_serial_drain + 606
10 libdispatch.dylib          0x00007fff2051008d _dispatch_lane_invoke + 366
11 libdispatch.dylib          0x00007fff20519bed _dispatch_workloop_worker_thread + 811
12 libsystem_pthread.dylib       0x00007fff206b04c0 _pthread_wqthread + 314
13 libsystem_pthread.dylib       0x00007fff206af493 start_wqthread + 15
);
}
-

It may be caused by inconsistent signatures on the framework, such as do not embed , and embed and sign

Possible solutions:
app targets -> General -> Frameworks,Libraries,and EmbeddedContent -> Modify embed and sign to do not embed .

[Solved] Xcode Reportduplicate symbols for architecture x86_64

phenomenon

// error
// a.h
template<typename T>
struct A {
public:
    A(int a):a_(a){std::cout << "A";}
private:
    int a_;
};


template<>
A<std::string>::A(int a):a_(a){std::cout << "string A";}
template<>
A<std::vector<int>>::A(int a):a_(a){std::cout << "vector A";}

// aa.h
void func_aa();

// aa.cpp
#include "a.h"
#include "aa.h"
void func_aa() {
    auto aa = A<std::string>(1);
}

// ab.h
void func_ab();

// ab.cpp
#include "a.h"
#include "ab.h"
void func_ab() {
    auto ab = A<std::string>(1);
    auto ab1 = A<std::vector<int>>(1);
}

// main.cpp
#include "aa.h"
#include "ab.h"
int main(){  
    func_aa();
    func_ab();
    return 0;
}

Solution

Option 1

Merge aa.h aa.cpp ab.h ab.cpp into AA_ ab.h aa_ Ab.cpp this scheme can solve the problem of error reporting, but the reason cannot be explained clearly=_= Welcome experts to solve doubts!

// aa_ab.h
void func_aa();
void func_ab();

// aa_ab.cpp
#include "a.h"
#include "aa_ab.h"
void func_ab() {
    auto ab = A<std::string>(1);
    auto ab1 = A<std::vector<int>>(1);
}
void func_aa() {
    auto aa = A<std::string>(1);
}

Option 2

Change the constructor of a into a function template and move the specialization to the class. Standard practice: specialize the function template

// a.h
template<typename T>
struct A {
public:
    template<typename T1>
    A(T1 a):a_(a){std::cout << "A";}

    template<>
    A(std::string a):a_(a){std::cout << "string A";}

    template<>
    A(std::vector<int> a):a_(a){std::cout << "vector A";}

    T a_;
};

Option 3

Standard Practice for specialization of class template a: specialization of class template

// a.h
template<typename T>
struct A {
public:
    A(int a):a_(a){std::cout << "A";}
    void print(){std::cout << "A print";}
    

private:
    int a_;
};

template<>
struct A<std::string> {
public:
    A(int a){std::cout << "string A";}

private:
    int a_;
};

template<>
struct A<std::vector<int>> {
public:
    A(int a){std::cout << "vector A";}

private:
    int a_;
};