Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't unzip zoom sdk #21

Open
edmirmob opened this issue Apr 27, 2022 · 1 comment
Open

can't unzip zoom sdk #21

edmirmob opened this issue Apr 27, 2022 · 1 comment

Comments

@edmirmob
Copy link

can't unzip zoom sdk. I get a pub finished with exit code 255

Unhandled exception:
FileSystemException: Cannot open file, path = 'C: /Users/Name/flutter_zoom-main/flutter_zoom-main/zoom/.dart_tool/pub/bin/zoom/unzip_zoom_sdk.dart-2.15.1.snapshot/ios/MobileRTC.xcfra /ios-arm64_armv7/MobileRTC.framework/MobileRTC '(OS Error: The system cannot
find the path specified.
, errno = 3)

@edmirmob
Copy link
Author

I finally did it when I changed unzip_zoom_sdk.dart file

import 'dart:convert';
import 'dart:core';
import 'dart:io';
import 'package:archive/archive.dart';

void main(List args) async {
var location = Platform.script.toString();
var isNewFlutter = location.contains(".snapshot");
if (isNewFlutter) {
var sp = Platform.script.toFilePath();
var sd = sp.split(Platform.pathSeparator);
sd.removeLast();
var scriptDir = sd.join(Platform.pathSeparator);
var packageConfigPath = [scriptDir, '..', '..', '..', 'package_config.json']
.join(Platform.pathSeparator);
var jsonString = File(packageConfigPath).readAsStringSync();
Map<String, dynamic> packages = jsonDecode(jsonString);
var packageList = packages["packages"];
String? zoomFileUri;
for (var package in packageList) {
if (package["name"] == "zoom") {
zoomFileUri = package["rootUri"];
break;
}
}
if (zoomFileUri == null) {
print("flutter_zoom_sdk package not found!");
return;
}
location = zoomFileUri;
}
if (Platform.isWindows) {
location = location.replaceFirst("file:///", "");
} else {
location = location.replaceFirst("file://", "");
}
if (!isNewFlutter) {
location = location.replaceFirst("/bin/unzip_zoom_sdk.dart", "");
}

await checkAndDownloadSDK(location);

print('Complete');
}

Future checkAndDownloadSDK(String location) async {
var iosSDKFile = location +
'/ios/MobileRTC.xcframework/ios-arm64_armv7/MobileRTC.framework/MobileRTC';
bool exists = await File(iosSDKFile).exists();

if (!exists) {
await downloadFile(
Uri.parse('https://www.dropbox.com/s/44rv7hgvqbgm7j7/MobileRTC?dl=1'),
iosSDKFile);
}

var iosSimulateSDKFile = location +
'/ios/MobileRTC.xcframework/ios-i386_x86_64-simulator/MobileRTC.framework/MobileRTC';
exists = await File(iosSimulateSDKFile).exists();

if (!exists) {
await downloadFile(
Uri.parse('https://www.dropbox.com/s/0qx52d1cb45oxku/MobileRTC?dl=1'),
iosSimulateSDKFile);
}

var androidCommonLibFile = location + '/android/libs/commonlib.aar';
exists = await File(androidCommonLibFile).exists();
if (!exists) {
await downloadFile(
Uri.parse(
'https://www.dropbox.com/s/lcjoc2evrmeucte/commonlib.aar?dl=1'),
androidCommonLibFile);
}
var androidRTCLibFile = location + '/android/libs/mobilertc.aar';
exists = await File(androidRTCLibFile).exists();
if (!exists) {
await downloadFile(
Uri.parse(
'https://www.dropbox.com/s/exe1aa0aflyh53f/mobilertc.aar?dl=1'),
androidRTCLibFile);
}
}

Future downloadFile(Uri uri, String savePath) async {
print('Download ${uri.toString()} to $savePath');
File destinationFile = await File(savePath).create(recursive: true);

final request = await HttpClient().getUrl(uri);
final response = await request.close();
await response.pipe(destinationFile.openWrite());
}

and then copy commonlib.aar and mobilertc.aar and paste it to into zoom/android/libs folder. It's work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant