Cannot find type 'PiPViewCoordinator' in scope in swift

I’m getting following error after adding newly built Jitsi meet SDK to my project.

This issue comes only for PipViewCoordinator, all other Jitsi related imports such as JitsiMeetView works fine.

What SDK version are you using?

@saghul I’m using a sdk built by myself using the latest Jitsi-meet release 2.0.7001

I’m using a sdk built by myself using the latest Jitsi-meet release 2.0.7001

That’s odd, we have a PiP sample which runs fine.

FYI we have not released SDK 5 yet, and you are building it off a random commit, which is usually not a good idea.

I tried building the SDK with Jitsi-meet release 2.0.6726 which I believe it would include SDK 4. I followed the steps and ran following command which failed.

xcodebuild archive \
    -workspace ios/jitsi-meet.xcworkspace \
    -scheme JitsiMeetSDK  \
    -configuration Release \
    -sdk iphonesimulator \
    -destination='generic/platform=iOS Simulator' \
    -archivePath ios/sdk/out/ios-simulator \
    VALID_ARCHS=x86_64 \
    ENABLE_BITCODE=NO \
    SKIP_INSTALL=NO \
    BUILD_LIBRARY_FOR_DISTRIBUTION=YES

It gives the following error.

warning: the transform cache was reset.
Loading dependency graph, done.
error node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js: Unexpected token punc «{», expected punc «(» in file node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js at 10250:22. Run CLI with --verbose flag for more details.
Error: Unexpected token punc «{», expected punc «(» in file node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js at 10250:22
    at /Users/local/Documents/JitsiMeet/ios/jitsi-meet-stable-jitsi-meet_6726/node_modules/metro/src/JSTransformer/worker.js:430:17
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/local/Documents/JitsiMeet/ios/jitsi-meet-stable-jitsi-meet_6726/node_modules/metro/src/JSTransformer/worker.js:75:24)
    at _next (/Users/local/Documents/JitsiMeet/ios/jitsi-meet-stable-jitsi-meet_6726/node_modules/metro/src/JSTransformer/worker.js:95:9)
    at /Users/local/Documents/JitsiMeet/ios/jitsi-meet-stable-jitsi-meet_6726/node_modules/metro/src/JSTransformer/worker.js:100:7
    at new Promise (<anonymous>)
    at /Users/local/Documents/JitsiMeet/ios/jitsi-meet-stable-jitsi-meet_6726/node_modules/metro/src/JSTransformer/worker.js:92:12
    at JsTransformer._minifyCode (/Users/local/Documents/JitsiMeet/ios/jitsi-meet-stable-jitsi-meet_6726/node_modules/metro/src/JSTransformer/worker.js:437:7)
    at /Users/local/Documents/JitsiMeet/ios/jitsi-meet-stable-jitsi-meet_6726/node_modules/metro/src/JSTransformer/worker.js:367:33
+ [[ false != true ]]
+ [[ ! -f /Users/local/Library/Developer/Xcode/DerivedData/jitsi-meet-glotjibepudfeigsftdihqbqjmvx/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeetSDK/BuildProductsPath/Release-iphonesimulator/JitsiMeetSDK.framework/main.jsbundle ]]
+ echo 'error: File /Users/local/Library/Developer/Xcode/DerivedData/jitsi-meet-glotjibepudfeigsftdihqbqjmvx/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeetSDK/BuildProductsPath/Release-iphonesimulator/JitsiMeetSDK.framework/main.jsbundle does not exist. This must be a bug with'
error: File /Users/local/Library/Developer/Xcode/DerivedData/jitsi-meet-glotjibepudfeigsftdihqbqjmvx/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeetSDK/BuildProductsPath/Release-iphonesimulator/JitsiMeetSDK.framework/main.jsbundle does not exist. This must be a bug with
+ echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
React Native, please report it here: https://github.com/facebook/react-native/issues
+ exit 2

** ARCHIVE FAILED **


The following build commands failed:
	PhaseScriptExecution Package\ React\ bundle /Users/local/Library/Developer/Xcode/DerivedData/jitsi-meet-glotjibepudfeigsftdihqbqjmvx/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeetSDK/IntermediateBuildFilesPath/sdk.build/Release-iphonesimulator/JitsiMeetSDK.build/Script-0BCA49651EC4B77500B793EE.sh (in target 'JitsiMeetSDK' from project 'sdk')
(1 failure)

We have tags for each SDK release, the latest is ios-sdk-4.1.0. Mobile releases don’t follow the frontend “stable” releases.

Thank you for the clarification. As you suggested I downloaded iOS-sdk-4.10 from https://github.com/jitsi/jitsi-meet/releases/tag/ios-sdk-4.1.0
I followed the same steps as before and still gets the following issue when executing xcodebuild archive \ -workspace ios/jitsi-meet.xcworkspace \ -scheme JitsiMeetSDK \ -configuration Release \ -sdk iphonesimulator \ -destination='generic/platform=iOS Simulator' \ -archivePath ios/sdk/out/ios-simulator \ VALID_ARCHS=x86_64 \ ENABLE_BITCODE=NO \ SKIP_INSTALL=NO \ BUILD_LIBRARY_FOR_DISTRIBUTION=YES

This is the error

warning: the transform cache was reset.
Loading dependency graph, done.
error node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js: Unexpected token punc «{», expected punc «(» in file node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js at 10250:22. Run CLI with --verbose flag for more details.
Error: Unexpected token punc «{», expected punc «(» in file node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js at 10250:22
    at /Users/local/Documents/JitsiMeet/ios/jitsi-meet-ios-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:430:17
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/local/Documents/JitsiMeet/ios/jitsi-meet-ios-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:75:24)
    at _next (/Users/local/Documents/JitsiMeet/ios/jitsi-meet-ios-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:95:9)
    at /Users/local/Documents/JitsiMeet/ios/jitsi-meet-ios-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:100:7
    at new Promise (<anonymous>)
    at /Users/local/Documents/JitsiMeet/ios/jitsi-meet-ios-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:92:12
    at JsTransformer._minifyCode (/Users/local/Documents/JitsiMeet/ios/jitsi-meet-ios-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:437:7)
    at /Users/local/Documents/JitsiMeet/ios/jitsi-meet-ios-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:367:33
+ [[ false != true ]]
+ [[ ! -f /Users/local/Library/Developer/Xcode/DerivedData/jitsi-meet-hjwewezlobdmtwdwimcvqkuoanuc/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeetSDK/BuildProductsPath/Release-iphonesimulator/JitsiMeetSDK.framework/main.jsbundle ]]
+ echo 'error: File /Users/local/Library/Developer/Xcode/DerivedData/jitsi-meet-hjwewezlobdmtwdwimcvqkuoanuc/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeetSDK/BuildProductsPath/Release-iphonesimulator/JitsiMeetSDK.framework/main.jsbundle does not exist. This must be a bug with'
error: File /Users/local/Library/Developer/Xcode/DerivedData/jitsi-meet-hjwewezlobdmtwdwimcvqkuoanuc/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeetSDK/BuildProductsPath/Release-iphonesimulator/JitsiMeetSDK.framework/main.jsbundle does not exist. This must be a bug with
+ echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
React Native, please report it here: https://github.com/facebook/react-native/issues
+ exit 2

** ARCHIVE FAILED **


The following build commands failed:
	PhaseScriptExecution Package\ React\ bundle /Users/local/Library/Developer/Xcode/DerivedData/jitsi-meet-hjwewezlobdmtwdwimcvqkuoanuc/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeetSDK/IntermediateBuildFilesPath/sdk.build/Release-iphonesimulator/JitsiMeetSDK.build/Script-0BCA49651EC4B77500B793EE.sh (in target 'JitsiMeetSDK' from project 'sdk')
(1 failure)

For android sdk build also I get the same error when executing ./android/scripts/release-sdk.sh /tmp/repo command.

The error is

> Configure project :react-native-reanimated
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

> Task :sdk:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
Error: Unexpected token punc «{», expected punc «(» in file node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js at 10250:22
error node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js: Unexpected token punc «{», expected punc «(» in file node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js at 10250:22. Run CLI with --verbose flag for more details.
    at /Users/local/Downloads/jitsi-meet-android-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:430:17
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/local/Downloads/jitsi-meet-android-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:75:24)
    at _next (/Users/local/Downloads/jitsi-meet-android-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:95:9)
    at /Users/local/Downloads/jitsi-meet-android-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:100:7
    at new Promise (<anonymous>)
    at /Users/local/Downloads/jitsi-meet-android-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:92:12
    at JsTransformer._minifyCode (/Users/local/Downloads/jitsi-meet-android-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:437:7)
    at /Users/local/Downloads/jitsi-meet-android-sdk-4.1.0/node_modules/metro/src/JSTransformer/worker.js:367:33

> Task :sdk:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sdk:bundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 36s
81 actionable tasks: 81 executed

What Node and npm versions are you using?

node version is 14.19.1
npm version is 7.24.2

Try node 16 and npm 8.

node 16 and rpm 8 also gives the same error

@saghul any solution?

SDK v5 has been released, can you please give that a try?