plugin update failed

Hi 

Hi

I have build a plugin regarding microphone power. It’s was working fine for version 1. some days ago i added new methods in plugin and push and update for plugin and it broke everything. After the update when i require my plugin it crashes at the very start of the app says plugin not found. When i test my plugin locally on Xcode project it works fine but on update it does not work at all. It seems like there is something wrong with my ‘.a’ file. Can anyone please help me with this. How can i test my ‘.a’ file. I want to test my ‘.a’ file before pushing an update of plugin. Is there a way i can test it and see what’s inside the ‘.a’ file. 

Thanks

Is this post by you? It seems to be an exact copy.

Rob

Yes it’s by me. The other post was also by me but i thought that was not published that’s why i post it from this account.

Any solution regarding my issue.

Please only post once.

When did it break? Do you have your source in source control that you can roll back to a previous version?

Rob

When i push the update for my plugin then it stops working. I needed to add new functions in my plugin and after i added new functions and make new ‘.a’ file and uploaded the new ‘.a’ file on repo then my plugin failed to response. It starts crashing on start of app and saying plugin not found. 

I think the issue is with my new ‘.a’ file i tried to look into ‘.a’ file but it seems we can not see what’s inside that file. Can you please look into it and see what’s the issue with it.

yes i can roll back to my previous version and the previous version is working fine. 
 

I can’t look into a .a file any more than you can. Can you post your specific changes you’re making?

Rob

#import "PluginMicrophonePower.h" #include \<CoronaRuntime.h\> #import \<UIKit/UIKit.h\> // ---------------------------------------------------------------------------- class microphonePower { public: typedef microphonePower Self; public: static const char kName[]; static const char kEvent[]; protected: microphonePower(); public: bool Initialize( CoronaLuaRef listener ); public: CoronaLuaRef GetListener() const { return fListener; } public: static int Open( lua\_State \*L ); protected: static int Finalizer( lua\_State \*L ); public: static Self \*ToLibrary( lua\_State \*L ); public: static int init( lua\_State \*L ); static int getPower( lua\_State \*L ); static int startRecording( lua\_State \*L ); static int stopRecording( lua\_State \*L ); static int startSession( lua\_State \*L ); private: CoronaLuaRef fListener; }; // ---------------------------------------------------------------------------- // This corresponds to the name of the library, e.g. [Lua] require "plugin.library" const char microphonePower::kName[] = "plugin.microphonePower"; // This corresponds to the event name, e.g. [Lua] event.name const char microphonePower::kEvent[] = "power"; FrequencyCheck \*frequecyCheck; microphonePower::microphonePower() : fListener( NULL ) { } bool microphonePower::Initialize( CoronaLuaRef listener ) { // Can only initialize listener once bool result = ( NULL == fListener ); if ( result ) { fListener = listener; } return result; } int microphonePower::Open( lua\_State \*L ) { // Register \_\_gc callback const char kMetatableName[] = \_\_FILE\_\_; // Globally unique string to prevent collision CoronaLuaInitializeGCMetatable( L, kMetatableName, Finalizer ); // Functions in library const luaL\_Reg kVTable[] = { { "init", init }, { "getPower", getPower }, { "startRecording", startRecording }, { "stopRecording", stopRecording }, { "startSession", startSession }, { NULL, NULL } }; // Set library as upvalue for each library function Self \*library = new Self; CoronaLuaPushUserdata( L, library, kMetatableName ); luaL\_openlib( L, kName, kVTable, 1 ); // leave "library" on top of stack return 1; } int microphonePower::Finalizer( lua\_State \*L ) { Self \*library = (Self \*)CoronaLuaToUserdata( L, 1 ); CoronaLuaDeleteRef( L, library-\>GetListener() ); delete library; return 0; } microphonePower \* microphonePower::ToLibrary( lua\_State \*L ) { // library is pushed as part of the closure Self \*library = (Self \*)CoronaLuaToUserdata( L, lua\_upvalueindex( 1 ) ); return library; } int microphonePower::init( lua\_State \*L ) { frequecyCheck = [[FrequencyCheck alloc] init]; const char \*word = lua\_tostring(L, 1); NSString \*filename = [NSString stringWithUTF8String:word]; [frequecyCheck createRecorder:filename]; int listenerIndex = 2; if ( CoronaLuaIsListener( L, listenerIndex, kEvent ) ) { Self \*library = ToLibrary( L ); CoronaLuaRef listener = CoronaLuaNewRef( L, listenerIndex ); library-\>Initialize( listener ); } return 0; } // [Lua] library.show( word ) int microphonePower::getPower( lua\_State \*L ) { // NSLog(@"Mic blow detected, %f", [frequecyCheck checkFrequency]); double frequencyValue = [frequecyCheck checkFrequency]\*100; Self \*library = ToLibrary( L ); // Create event and add message to it CoronaLuaNewEvent( L, kEvent ); lua\_pushnumber( L, frequencyValue ); lua\_setfield( L, -2, "value" ); // Dispatch event to library's listener CoronaLuaDispatchEvent( L, library-\>GetListener(), 0 ); return 0; } int microphonePower::startRecording( lua\_State \*L ) { [frequecyCheck startRecording]; return 0; } int microphonePower::stopRecording( lua\_State \*L ) { [frequecyCheck stopRecording]; return 0; } int microphonePower::startSession( lua\_State \*L ) { [frequecyCheck startSession]; return 0; } // ---------------------------------------------------------------------------- CORONA\_EXPORT int luaopen\_plugin\_microphonePower( lua\_State \*L ) { return microphonePower::Open( L ); }

Here is my ‘PluginMicrophonePower.mm’ but i think issue is not within this issue. Issue is in ‘.a’ maybe when i am making ‘.a’ i am missing something. How can i detect my issue with ‘.a’ file. Can i see into my ‘.a’ file?

What did you add that started the plugin to break?

int microphonePower::startRecording( lua\_State \*L ) { [frequecyCheck startRecording]; return 0; } int microphonePower::stopRecording( lua\_State \*L ) { [frequecyCheck stopRecording]; return 0; } int microphonePower::startSession( lua\_State \*L ) { [frequecyCheck startSession]; return 0; }

I have added these three new methods in it.