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

用cra创建好的electron项目,能正常打包,npm install trtc-electron-sdk后报错如下,请问怎么解决? #34

Open
songyunbiao opened this issue Jan 20, 2024 · 5 comments

Comments

@songyunbiao
Copy link

dlopen(/electron-cra-react-ts/node_modules/trtc-electron-sdk/build/Release/trtc_electron_sdk.node, 0x0001): Library not loaded: '@rpath/TXFFmpeg.framework/TXFFmpeg'
Referenced from: '
/electron-cra-react-ts/node_modules/trtc-electron-sdk/build/Release/trtc_electron_sdk.node'
Reason: tried: '/electron-cra-react-ts/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/TXFFmpeg.framework/TXFFmpeg' (no such file), '/electron-cra-react-ts/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS/../../../TXFFmpeg.framework/TXFFmpeg' (no such file), '/Library/Frameworks/TXFFmpeg.framework/TXFFmpeg' (no such file), '/System/Library/Frameworks/TXFFmpeg.framework/TXFFmpeg' (no such file)

@songyunbiao
Copy link
Author

"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"concurrently": "^8.2.2",
"electron-builder": "^24.9.1",
"eslint-plugin-react-refresh": "^0.4.5",
"file-loader": "^6.2.0",
"native-ext-loader": "^2.3.0",
"node-sass": "^7.0.3",
"wait-on": "^7.2.0"
}

@songyunbiao
Copy link
Author

"trtc-electron-sdk": "^11.4.503",

@songyunbiao
Copy link
Author

{
test: /.node$/,
loader: 'native-ext-loader',
options: {
// rewritePath: targetPlatform === 'win32' ? './resources' : '../Resources'
// 针对开发环境
rewritePath: '../node_modules/trtc-electron-sdk/build/Release/x64/trtc_electron_sdk.node'
}
},

@songyunbiao
Copy link
Author

"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js",
"electron:start": "concurrently "yarn start" "wait-on http://127.0.0.1:3000 && electron ."",
"electron:build": "yarn build && electron-builder",
"electron:build:linux": "yarn build && electron-builder --linux deb tar.xz",
"electron:build:win": "yarn build && electron-builder --windows"
},

@songyunbiao
Copy link
Author

在electron的preload.js文件下,导入const TRTCCloud = require('trtc-electron-sdk').default;就会报错。

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