Closed yhj200722 closed 6 years ago
@yhj200722 please ensure you've added the NuGet package to each platform project in addition to the PCL, as stated in the setup instructions.
@NateRickard does this work ONLY for PCL and not for SHARED projects? I get the same error in my Android/iOS Shared Xamarin Project!?
Just tried using it inside an activity just like in your Sample (https://github.com/NateRickard/Plugin.AudioRecorder/blob/master/Samples/AudioRecord.Android/MainActivity.cs)
recorder = new AudioRecorderService { StopRecordingOnSilence = false, StopRecordingAfterTimeout = true, TotalAudioTimeout = TimeSpan.FromSeconds(30) };
Still throwing NotImplementedException Error :(
@sushibear Should work for any iOS/Android/UWP platform project(s) since there are assemblies in the NuGet package specific to those platforms. You have to install the NuGet package in each of the platform projects the shared project is referenced from.
I've added a Xamarin.Forms sample using a shared project, you can find it here: https://github.com/NateRickard/Plugin.AudioRecorder/tree/master/Samples/Forms
i really have no clue but... it is not working no matter what i do. and... "NotImplementedException" only occurs when... well the method we are calling simple does not exist. is there maybe something wrong with the NuGet project?
@Kokujou shouldn't be anything wrong with the package - the working samples included in this repo use the package. As stated above, this error would typically indicate you haven't included the package in a platform-specific project (Android, iOS, UWP), so it can't find the proper dll to load.
@NateRickard but i downloaded it via nuget and included it in all my subprojects! this line is in my packages.config:
i don't know what i could've done wrong. and i do even find the DLL in the path which is shown commented when i go to the definition of AudioRecorderService
the dll is even listed under "references"
and now, just to be sure, i deleted the reference under android which was pointing to "portable45-net45+win8+wpa81" and replaced it to the one lying in monoandroid 71 (btw: i'm using android 7.0 as target framework. it says yours is compatible with api 16+ I don't know if maybe there is something wrong) - still not working.
@NateRickard, I'm also experiencing this same thing. I even uninstalled and re-installed the Nuget package to the Droid project and it's still throwing this issue. I've double checked I have all the correct Android permissions set. I'm using Android packages 25.3.1, the same as your Forms sample. I'm not sure what the issue could be. iOS seems to be working perfectly fine.
@NateRickard not sure if this makes the difference, but I have my Xamarin Forms project setup as PCL. I noticed your sample has the Forms shared project as a Shared code project.
@NateRickard i don't wanna nag but it's kind of urgent because my deadline is at the 24th. could you please help?
@quinnhoener See here for a PCL-based Forms project that's using this plugin.
@Kokujou can you create a repo that reproduces your issue? I can clone and review the issue that way.
I'd be interested to know the details in (both of) your projects... this lib should work fine with legacy PCL-based projects, provided it uses the proper PCL profile (profile111). As PCL is now deprecated, newer Forms projects are based on .NET Standard 2.0, which may be another story. Need to find time to migrate this whole lib to .NET Standard or find someone who can create a PR.
it's not like there has something to be cloned... it happens if you just open a new Xamarin Project and use that line AudioRecorderServer x = new AudioRecorderService(); but i have to say i'm very new to everything which has to do with Xamarin. i just created an empty app as shared project and Xamarin.Forms. then i updated Forms to ... 2.4.0.282, downloaded your nuget package's latest version and wrote that line into my App() constructor. nothing else.
i mean it's not like i'm gonna get exmatriculated if i don't use that audio stuff but it'd be nice to have it, i wanted to use it for speech recognition and maybe text to speech.
Still can't reproduce this and many people are using it w/o experiencing this issue, which leads me to believe it's a project config issue or similar. Closing this again for now - if anyone can create a reproduction and put it on GitHub I can try and troubleshoot.
Hi I am also facing the same issue when I try to access the camera in android phone using Xam.plugin.media. I am using visual studio 2017, Xamarin - 4.11.0.756, Xamarin.Android SDK - 9.0.0.19. here is the full stack trace of the exception i am getting :--
{System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotImplementedException: The method or operation is not implemented.
at System.Reflection.Assembly.GetName (System.Boolean copiedName) [0x00000] in 2[TKey,TValue] gargs, Mono.Cecil.MethodReference m, System.Object[] createInstanceArgs) [0x00305] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.interpretBlock (System.Object[] args, System.Object[] locals, Mono.Cecil.Cil.Instruction initialInstruction, Microsoft.FSharp.Collections.FSharpSet
1[T] inTries, Microsoft.FSharp.Core.FSharpOption1[T] lastException) [0x03d5e] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.interpret (System.Object[] args) [0x00098] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.callAMethod (NInterpret.AMethod m, NInterpret.AType[] ptypes, NInterpret.AType[] genericMethodArgs, System.Collections.Generic.Dictionary
2[TKey,TValue] genericArgsIndex, System.Object[] args, System.Collections.Generic.List1[T] byRefArgs, Microsoft.FSharp.Core.FSharpOption
1[T] byRefTarget, System.Object target, System.Boolean virtualCall) [0x00183] in <5b4cad727eef0f2aa745038372ad4c5b>:0
at NInterpret.Interpreter.callMethodReference (System.Collections.Generic.Dictionary2[TKey,TValue] gargs, Mono.Cecil.MethodReference ms, System.Boolean virtualCall) [0x00383] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.interpretBlock (System.Object[] args, System.Object[] locals, Mono.Cecil.Cil.Instruction initialInstruction, Microsoft.FSharp.Collections.FSharpSet
1[T] inTries, Microsoft.FSharp.Core.FSharpOption1[T] lastException) [0x00fba] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.interpret (System.Object[] args) [0x00098] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.callAMethod (NInterpret.AMethod m, NInterpret.AType[] ptypes, NInterpret.AType[] genericMethodArgs, System.Collections.Generic.Dictionary
2[TKey,TValue] genericArgsIndex, System.Object[] args, System.Collections.Generic.List1[T] byRefArgs, Microsoft.FSharp.Core.FSharpOption
1[T] byRefTarget, System.Object target, System.Boolean virtualCall) [0x00183] in <5b4cad727eef0f2aa745038372ad4c5b>:0
at NInterpret.Interpreter.callMethodReference (System.Collections.Generic.Dictionary2[TKey,TValue] gargs, Mono.Cecil.MethodReference ms, System.Boolean virtualCall) [0x00383] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.interpretBlock (System.Object[] args, System.Object[] locals, Mono.Cecil.Cil.Instruction initialInstruction, Microsoft.FSharp.Collections.FSharpSet
1[T] inTries, Microsoft.FSharp.Core.FSharpOption1[T] lastException) [0x00fba] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.interpretBlock (System.Object[] args, System.Object[] locals, Mono.Cecil.Cil.Instruction initialInstruction, Microsoft.FSharp.Collections.FSharpSet
1[T] inTries, Microsoft.FSharp.Core.FSharpOption1[T] lastException) [0x0013b] in <5b4cad727eef0f2aa745038372ad4c5b>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 at System.Runtime.CompilerServices.TaskAwaiter
1[TResult].GetResult () [0x00000] in 2[TKey,TValue] genericArgsIndex, System.Object[] args, System.Collections.Generic.List
1[T] byRefArgs, Microsoft.FSharp.Core.FSharpOption1[T] byRefTarget, System.Object target, System.Boolean virtualCall) [0x0049c] in <5b4cad727eef0f2aa745038372ad4c5b>:0 at NInterpret.Interpreter.callMethodReference (System.Collections.Generic.Dictionary
2[TKey,TValue] gargs, Mono.Cecil.MethodReference ms, System.Boolean virtualCall) [0x00383] in <5b4cad727eef0f2aa745038372ad4c5b>:0
at NInterpret.Interpreter.interpretBlock (System.Object[] args, System.Object[] locals, Mono.Cecil.Cil.Instruction initialInstruction, Microsoft.FSharp.Collections.FSharpSet1[T] inTries, Microsoft.FSharp.Core.FSharpOption
1[T] lastException) [0x00fba] in <5b4cad727eef0f2aa745038372ad4c5b>:0
at NInterpret.Interpreter.interpretBlock (System.Object[] args, System.Object[] locals, Mono.Cecil.Cil.Instruction initialInstruction, Microsoft.FSharp.Collections.FSharpSet1[T] inTries, Microsoft.FSharp.Core.FSharpOption
1[T] lastException) [0x0013b] in <5b4cad727eef0f2aa745038372ad4c5b>:0 }
Please let me know if i am missing something here Or suggest me some solution for this
@DivyaG014 you should log your issue on that plugin's repo: https://github.com/jamesmontemagno/MediaPlugin
System.NotImplementedException: The method or operation is not implemented occured in my xamarin.forms app when "new AudioRecorderService{......} operation"