phonegap / phonegap-plugin-barcodescanner

cross-platform BarcodeScanner for Cordova / PhoneGap
MIT License
1.27k stars 1.39k forks source link

global variable #866

Open jseter opened 4 years ago

jseter commented 4 years ago

Expected Behaviour

no global variables

Actual Behaviour

the variable _soundFileObject is written in such a way that it is a global variable instead of an instance member of the interface. SystemSoundID _soundFileObject;

expected: @implementaotin CDVbcsProcessor { SystemSoundID _soundFileObject; }

or if intended global, should have a prefix to make it unique or static scope to the file.

Reproduce Scenario (including but not limited to)

linked with another plugin that has the same variable name fails to build finding the symbol in multiple objects.

Steps to Reproduce

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 13.4 cordova-ios 5.1.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Cordova CLI version and cordova platform version

cordova 9.0.0
cordova platforms

Plugin version

cordova plugin version | grep phonegap-plugin-barcodescanner

Sample Code that illustrates the problem

Logs taken while reproducing problem

duplicate symbol '__soundFileObject' in: /Users/seterj/Library/Developer/Xcode/DerivedData/Application-cqhviyvaewutwwgivjthnvddaipw/Build/Intermediates.noindex/ArchiveIntermediates/Application/IntermediateBuildFilesPath/Application.build/Debug-iphoneos/Application.build/Objects-normal/arm64/TestCbsProcessor.o /Users/seterj/Library/Developer/Xcode/DerivedData/Application-cqhviyvaewutwwgivjthnvddaipw/Build/Intermediates.noindex/ArchiveIntermediates/Application/IntermediateBuildFilesPath/Application.build/Debug-iphoneos/Application.build/Objects-normal/arm64/CDVBarcodeScanner.o ld: 1 duplicate symbol for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.