react-native-nearby-api icon indicating copy to clipboard operation
react-native-nearby-api copied to clipboard

Duplicate symbols for architecture

Open Procaseycash opened this issue 6 years ago • 8 comments

I have ran ./renameLogger.sh to resolve this issue but did not get to work as React-Native version 0.60+ do not contains the third-party folder. see details below;

"dependencies": {
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-nearby-api": "0.0.5"
  },

Currently running the example provided here. this works for IOS & Android on 0.56 of react-native.

Thanks.

Procaseycash avatar Dec 09 '19 13:12 Procaseycash

Same issue here. Did you figure it out?

zaptrem avatar Feb 24 '20 06:02 zaptrem

Might have solved this issue by pasting this at bottom of podfile:

puts "Renaming logging functions"

  root = File.dirname(installer.pods_project.path)
  Dir.chdir(root);
  Dir.glob("**/*.{h,cc,cpp,in}") {|filename|
    filepath = root + "/" + filename
    text = File.read(filepath)
    addText = text.gsub!(/(?<!React)AddLogSink/, "ReactAddLogSink")
    if addText
      File.chmod(0644, filepath)
      f = File.open(filepath, "w")
      f.write(addText)
      f.close
    end

    text2 = addText ? addText : text
    removeText = text2.gsub!(/(?<!React)RemoveLogSink/, "ReactRemoveLogSink")
    if removeText
      File.chmod(0644, filepath)
      f = File.open(filepath, "w")
      f.write(removeText)
      f.close
    end
  }

zaptrem avatar Feb 24 '20 08:02 zaptrem

Please check the fix from https://github.com/adrianso/react-native-nearby-api. Also works with latest version of react native too

Procaseycash avatar Feb 24 '20 11:02 Procaseycash

I tried that but got an error “Multiple commands create (some path)/Assets.car.” When I tried the legacy build system I got some error about multiple arm symbols conflicting.

zaptrem avatar Feb 24 '20 19:02 zaptrem

@zaptrem I'm getting the same error, did you manage to fix it?

mrousavy avatar May 25 '20 19:05 mrousavy

I fixed it (at least in part) by deleting the [CP] Copy Pods Resources -> Assets.car build phase (not the whole phase, just Assets.car). I can’t remember if this caused any problems that I mitigated some other way but I don’t think it did. I wrote a script in my cocoa pods install to do it automatically but it never worked:

post_install do |installer|
  puts “Deleting [CP] Copy Pods Resources”
  project_path = ‘ReLearn.xcodeproj’
    project = Xcodeproj::Project.open(project_path)
    project.targets.each do |target|
        build_phase = target.build_phases.find { |bp| bp.display_name ==
‘[CP] Copy Pods Resources’ }
        assets_path =
‘${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Assets.car’
        if build_phase.present? &&
build_phase.output_paths.include?(assets_path) == true
            puts(“DELETING”)
   build_phase.output_paths.delete(assets_path)
   #build_phase.remove_from_project
        end
    end
    project.save(project_path)

Any idea why this script didn’t work? Also, let me know if that fixed it for you.

On Mon, May 25, 2020 at 3:47 PM Marc Rousavy [email protected] wrote:

@zaptrem https://github.com/zaptrem I'm getting the same error, did you manage to fix it?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/badfeatures/react-native-nearby-api/issues/33#issuecomment-633697679, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMJTRSGBC24NC7A6XH7BBLRTLDOHANCNFSM4JYJOI2Q .

zaptrem avatar May 25 '20 19:05 zaptrem

@zaptrem Awesome it worked! Seems really weird to me to manually remove Assets, hopefully this doesn't have any side effects.

mrousavy avatar May 25 '20 20:05 mrousavy

I've created a new library for the Nearby API here: https://github.com/mrousavy/react-native-google-nearby-messages because apparently this one is dead. It uses the latest version, supports autolinking and was made with Swift. The Assets.car issue still exists, it's Google's fault on the NearbyMessages pod.

mrousavy avatar Jun 03 '20 10:06 mrousavy