Open bnuby opened 3 years ago
same here
same here
+1
Same, the project is not being built. Output:
Running Gradle task 'assembleDebug'...
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\AppVideoEncoder.kt: (221, 59): Type mismatch: inferred type is ByteBuffer? but ByteBuffer was expected
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\AppVideoEncoder.kt: (430, 23): Type mismatch: inferred type is ByteBuffer? but ByteBuffer was expected
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (42, 1): Class 'Camera' is not abstract and does not implement abstract member public abstract fun surfaceChanged(@NonNull p0: SurfaceHolder, p1: Int, p2: Int, p3: Int): Unit defined in android.view.SurfaceHolder.Callback
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (96, 45): Type inference failed. Expected type mismatch: inferred type is Int? but Int was expected
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (856, 5): 'surfaceChanged' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (863, 5): 'surfaceDestroyed' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (866, 5): 'surfaceCreated' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\CameraNativeView.kt: (25, 1): Class 'CameraNativeView' is not abstract and does not implement abstract member public abstract fun surfaceChanged(@NonNull p0: SurfaceHolder, p1: Int, p2: Int, p3: Int): Unit defined in android.view.SurfaceHolder.Callback
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\CameraNativeView.kt: (87, 5): 'surfaceChanged' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\CameraNativeView.kt: (91, 5): 'surfaceDestroyed' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\CameraUtils.kt: (51, 13): Type inference failed: Cannot infer type parameter V in inline operator fun <K, V> MutableMap<K, V>.set(key: K, value: V): Unit
None of the following substitutions
receiver: MutableMap<String, Any> arguments: (String,Any)
receiver: MutableMap<String, Int?> arguments: (String,Int?)
can be applied to
receiver: HashMap<String, Any> arguments: (String,Int?)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rtmp_publisher:compileDebugKotlin'.
> Compilation error. See log for more details
The problem is partially solved: https://github.com/pinkfish/flutter_rtmppublisher/issues/36
But still the following problems remain:
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (42, 1): Class 'Camera' is not abstract and does not implement abstract member public abstract fun surfaceChanged(@NonNull p0: SurfaceHolder, p1: Int, p2: Int, p3: Int): Unit defined in android.view.SurfaceHolder.Callback
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (856, 5): 'surfaceChanged' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (863, 5): 'surfaceDestroyed' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (866, 5): 'surfaceCreated' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\CameraNativeView.kt: (25, 1): Class 'CameraNativeView' is not abstract and does not implement abstract member public abstract fun surfaceChanged(@NonNull p0: SurfaceHolder, p1: Int, p2: Int, p3: Int): Unit defined in android.view.SurfaceHolder.Callback
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\CameraNativeView.kt: (87, 5): 'surfaceChanged' overrides nothing
e: \Pub\Cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\CameraNativeView.kt: (91, 5): 'surfaceDestroyed' overrides nothing
This seems to be a version compatibility issue, it is solved like this:
Camera.kt
override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
// implement here ...
}
override fun surfaceDestroyed(holder: SurfaceHolder) {}
override fun surfaceCreated(holder: SurfaceHolder) {}
CameraNativeView.kt
override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
Log.d("CameraNativeView", "surfaceChanged $width $height")
}
override fun surfaceDestroyed(holder: SurfaceHolder) {
Log.d("CameraNativeView", "surfaceDestroyed")
}
So I was able to build the project and successfully start streaming to the rtmp server. I hope this will be fixed
PLEASE HELP
Hi, Is there any got this error?? only have this error when I run the apps on the android. no issue for ios.
Flutter Doctor
Error Message