flutter混编集成jitsi meet的记录

jitsi meet的Android和iOS原生SDK

https://github.com/jitsi/jitsi-meet-sdk-samples

集成调用原生Android、iOS主要是参考:

https://flutter.dev/docs/development/platform-integration/platform-channels

 

iOS端 :

iOS端报错主要是podfile.lock not found ,搞了很久,最后是先执行 flutter run,然后就能跑了。

之后出现的问题是,点击跳转到原生iOS界面,在界面的点击,事件会穿透到下一层。 

在该viewcontroller加上touchesBegan就解决了

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    
}

Android端:

主要问题是flutter_webview_plugin和jitsi-meet的sdk冲突问题

引入jitsi-meet的sdk后报错如下

Attribute application@label value=(moa_flutter) from AndroidManifest.xml:11:9-36
    is also present at [org.jitsi.react:jitsi-meet-sdk:2.1.0] AndroidManifest.xml:32:9-41 value=(@string/app_name).
    Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:9:5-35:19 to override.

按照错误在AndroidManifest.xm中标签加入 tool:replace="android:lebel"属性,结果还报类似的错需要tool:replace="xxx",然后陷入错误循环。

看到https://blog.csdn.net/u014644594/article/details/85095831,才知道原来是引入的flutter_webview_plugin依赖AndroidX 和jitsi meet依赖的Android support冲突了。然后我选择迁移AndroidX方式来解决这个问题。

迁移至AndroidX后报错如下:

flutter混编集成jitsi meet的记录_第1张图片

在终端执行 ./gradlew app:dependencies 可以看到是不同版本依赖的问题,引入jitsi meet 迁移到androidx就出现了版本冲突,有将近30个……:

flutter混编集成jitsi meet的记录_第2张图片

flutter混编集成jitsi meet的记录_第3张图片

 

https://www.jianshu.com/p/ef10de6fc6a0的方法,一个一个过滤显然不太行,然后研究了用gradle脚本进行过滤

def map = [:]
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        def dep = requested.group + '/' + requested.name
        if (dep.startsWith('androidx')){
            if (!map.containsKey(dep)) {
                map.put(dep , requested.version)
            } else {
                println(map.get(dep))
                details.useVersion map.get(dep) as String
            }
        }
    }
}

终于build 成功了

点开闪退,看log,一大堆红字,不过最后这个报错很熟悉

xxxx ,couldn't find "libflutter.so" 

build.gradle 中加入 

buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
        debug {
            ndk {
                abiFilters 'armeabi-v7a'
            }
        }
    }

终于!跑起来了 

 

 

你可能感兴趣的:(flutter混编集成jitsi meet的记录)