cordova-rtc / cordova-plugin-iosrtc

Cordova iOS plugin exposing the WebRTC W3C API
MIT License
689 stars 339 forks source link

ios not build after cordova-plugin-iosrtc #642

Closed hyejinlim closed 3 years ago

hyejinlim commented 3 years ago

YOU MUST read first!

Please use Community Forum for general technical discussions and questions.

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed, removing this checkbox will result in automatic closed issue.

Versions affected

Description

Hi. I use ionic framework. An error occurred when building ios after adding cordova-plugin-iosrtc.

iosrtc-swift-support.js [INFO] checking file: ./platforms/ios/.xcodeproj/project.pbxproj
Error: value.replace is not a function
@ui-MacBookPro project % events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at process.target._send (internal/child_process.js:832:20)
    at process.target.send (internal/child_process.js:703:19)
    at Object.<anonymous> (/project/name/node_modules/xcode/lib/parseJob.js:28:13)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
Emitted 'error' event on process instance at:
    at internal/child_process.js:836:39
    at processTicksAndRejections (internal/process/task_queues.js:75:11) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

What should I do?...

Steps to reproduce

Expected results

Actual results

hthetiot commented 3 years ago

@hyejinlim

And post console result here in the issue

And see why the function convertToFloat is not a String

function convertToFloat(value) {
    return parseFloat(value.replace(/[^\d.-]/g, ''), 10);
}
hyejinlim commented 3 years ago

@hthetiot my cordova plugin list

cordova-open-native-settings 1.5.3 "Native settings"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-android-enumeratedevices 0.0.1 "EnumerateDevicesPlugin"
cordova-plugin-android-permissions 1.1.2 "Permissions"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-androidx 2.0.0 "cordova-plugin-androidx"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-fcm-with-dependecy-updated 7.8.0 "Cordova FCM Push Plugin"
cordova-plugin-firebasex 10.1.0-cli "Google Firebase Plugin"
cordova-plugin-geolocation 4.1.0 "Geolocation"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-ios-camera-permissions 1.2.0 "iOS Permissions"
cordova-plugin-nativeaudio 3.0.9 "Cordova Native Audio"
cordova-plugin-nativegeocoder 3.4.1 "NativeGeocoder"
cordova-plugin-splashscreen 5.0.4 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-sqlite-storage 5.1.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
im.ltdev.cordova.UserAgent 1.0.1 "User-Agent"

It worked in version 6.0.17. I hope this problem is solved.

hthetiot commented 3 years ago

I hope this problem is solved.

LOL, if you help yourself i will help you.

try the next instructions 1,2,3 and 4 i asked you in previous comment (0 plugin is check now):

hthetiot commented 3 years ago

cc @hyejinlim see reply above

hyejinlim commented 3 years ago

@hyejinlim

console.log(buildSettings) To thie line (L296) and file (plugins/cordova-plugins-iosrtc/extra/hooks/iosrtc-swift-support.js) https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/extra/hooks/iosrtc-swift-support.js#L296

And post console result here in the issue

And see why the function convertToFloat is not a String

function convertToFloat(value) {
  return parseFloat(value.replace(/[^\d.-]/g, ''), 10);
}
  • [x] 4. may be change to
  return parseFloat(String(value).replace(/[^\d.-]/g, ''), 10);

I got the console result below.

{
  ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: 'YES',
  CLANG_ENABLE_MODULES: 'YES',
  CLANG_ENABLE_OBJC_ARC: 'YES',
  CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING: 'YES',
  CLANG_WARN_BOOL_CONVERSION: 'YES',
  CLANG_WARN_COMMA: 'YES',
  CLANG_WARN_CONSTANT_CONVERSION: 'YES',
  CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS: 'YES',
  CLANG_WARN_EMPTY_BODY: 'YES',
  CLANG_WARN_ENUM_CONVERSION: 'YES',
  CLANG_WARN_INFINITE_RECURSION: 'YES',
  CLANG_WARN_INT_CONVERSION: 'YES',
  CLANG_WARN_NON_LITERAL_NULL_CONVERSION: 'YES',
  CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF: 'YES',
  CLANG_WARN_OBJC_LITERAL_CONVERSION: 'YES',
  CLANG_WARN_RANGE_LOOP_ANALYSIS: 'YES',
  CLANG_WARN_STRICT_PROTOTYPES: 'YES',
  CLANG_WARN_SUSPICIOUS_MOVE: 'YES',
  CLANG_WARN_UNREACHABLE_CODE: 'YES',
  CLANG_WARN__DUPLICATE_METHOD_MATCH: 'YES',
  ENABLE_STRICT_OBJC_MSGSEND: 'YES',
  ENABLE_TESTABILITY: 'YES',
  GCC_C_LANGUAGE_STANDARD: 'c99',
  GCC_NO_COMMON_BLOCKS: 'YES',
  GCC_THUMB_SUPPORT: 'NO',
  GCC_VERSION: '""',
  GCC_WARN_64_TO_32_BIT_CONVERSION: 'YES',
  GCC_WARN_ABOUT_RETURN_TYPE: 'YES',
  GCC_WARN_UNDECLARED_SELECTOR: 'YES',
  GCC_WARN_UNINITIALIZED_AUTOS: 'YES',
  GCC_WARN_UNUSED_FUNCTION: 'YES',
  GCC_WARN_UNUSED_VARIABLE: 'YES',
  IPHONEOS_DEPLOYMENT_TARGET: 11,
  LD_RUNPATH_SEARCH_PATHS: '"@executable_path/Frameworks $(inherited)"',
  ONLY_ACTIVE_ARCH: 'YES',
  PRODUCT_BUNDLE_IDENTIFIER: 'com.project.name',
  SDKROOT: 'iphoneos',
  SKIP_INSTALL: 'NO',
  SWIFT_OBJC_BRIDGING_HEADER: '"$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h"',
  SWIFT_OPTIMIZATION_LEVEL: '"-Onone"',
  SWIFT_VERSION: '4.0',
  WK_WEB_VIEW_ONLY: 1
}

And after changing No. 4, not build....

The following build commands failed:
        CompileSwift normal x86_64 /project/platforms/ios/project/Plugins/cordova-plugin-iosrtc/PluginEnumerateDevices.swift
        CompileSwift normal x86_64 /project/platforms/ios/project/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift
        CompileSwift normal x86_64 /project/platforms/ios/project/Plugins/cordova-plugin-iosrtc/PluginRTCAudioController.swift
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
hthetiot commented 3 years ago

thx @hyejinlim for proper reporting and helping debuging and therefor fixing the issue and replying quickly. For now this is your fix, i will makr PR and releaase 6.0.19 later at some point you can use master tp test if fix available befpre 6.0.19, i try to keep master as stable as possible.

hthetiot commented 3 years ago

wait you edit from:

And after changing No. 4, the build was successful!!

hthetiot commented 3 years ago
The following build commands failed:
        CompileSwift normal x86_64 /project/platforms/ios/project/Plugins/cordova-plugin-iosrtc/PluginEnumerateDevices.swift
        CompileSwift normal x86_64 /project/platforms/ios/project/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift
        CompileSwift normal x86_64 /project/platforms/ios/project/Plugins/cordova-plugin-iosrtc/PluginRTCAudioController.swift
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler

That a different issue

hthetiot commented 3 years ago

That you build failing try add and remove platform ios I think you have some shit in buildSettings

try 6.0.17 but im pretty sure that not related.

hyejinlim commented 3 years ago

@hthetiot good! After running 4 times, the ios platform was removed, re-added, and built. Thank you!!!!!


I have another question, can I register as a new issue?

hthetiot commented 3 years ago

I have another question, can I register as a new issue

I rather not, for better tracking and also this time try to fill the issue with all requirements and if issue is well reported will help the same.

hthetiot commented 3 years ago

You can also fork, patch and make a PR for this bug this will help a lot and you can assist the community.

hyejinlim commented 3 years ago

@hthetiot

okay.

When you run the app after installing the plug-in, the following phenomenon appears.

-When connecting AirPods and listening to music, the sound quality of AirPods is degraded if you start an app with a plugin installed.

-I tried specifying a value in selectAudioOutput() or turnOnSpeaker(), but when I ran the app, the sound was cut off or not heard.

-The peculiar thing is that the sound quality does not break if you open the app again after playing music with AirPods after turning the app in the background.

Is there a workaround?

hthetiot commented 3 years ago

LOL

I rather not,

Mean create another issue ;)

hthetiot commented 3 years ago

Last comment hidden please create proper issue.

See last comment: https://github.com/cordova-rtc/cordova-plugin-iosrtc/issues/642#issuecomment-776754674

Try to provide code to reproduce and all information add ionic in the version info.

I play that game all day, don't try to abuse me.

hthetiot commented 3 years ago

Fixed by 75fe523d0209fe18979fd6d051e681bdac519f2f