Scofield Tran
Scofield Tran

Reputation: 840

Aviary SDK crash on initializing on iOS

I integrate Aviary SDK on my app to enhance my app image editor feature. I read its documents, run its sample code and it works fine. But when run on my app, I face an issue. It crashed EXC_BAD_ACCESS after run over a method

[AFOpenGLManager beginOpenGLLoad];

I followed the setup guide on Aviary document https://developers.aviary.com/docs/ios/setup-guide#project-setup

At first, I just create a Singleton manager to manage. I call [AFOpenGLManager beginOpenGLLoad]; on init function

- (id)init {
     if (self = [super init]) {        
         [AFOpenGLManager beginOpenGLLoad];
     }
     return self;
}

- (void) launchPhotoEditorWithImage:(UIImage *)editingResImage
            highResolutionImage:(UIImage *)highResImage
                 fromController:(UIViewController *)controller
{
       // Customize the editor's apperance. The customization options really only need to be set       
       once in this case since they are never changing, so we used dispatch once here.
       static dispatch_once_t onceToken;
       dispatch_once(&onceToken, ^{
             [self setPhotoEditorCustomizationOptions];
       });

       // Initialize the photo editor and set its delegate
       AFPhotoEditorController * photoEditor = [[[AFPhotoEditorController alloc]   
                                            initWithImage:editingResImage] autorelease];
       [photoEditor setDelegate:self];

       // If a high res image is passed, create the high res context with the image and the 
       photo editor.
       if (highResImage) {
            [self setupHighResContextForPhotoEditor:photoEditor withImage:highResImage];
       }

       // Present the photo editor.
       [controller presentViewController:photoEditor animated:YES completion:nil];
}

After run over the init function, it crashed on

enter image description here

Do I miss somethings, the sample code run well.

Edit 1: compileShader is called from createProgram but I can read this method

enter image description here

Edit 2: I realize somethings. My app project has a lib named libmediastreamer_voip.a . I think there is misunderstanding. I mean maybe Aviary lib and libmediastreamer_voip.a lib also have the function named compileShader. So when on Aviary lib calls compileShader it runs on compileShader on Aviary lib but run into compileShader on libmediastreamer_voip.a. I wonder I could be like that? I create a new project and integrate Avairy SDK, it works well, just integrate to my app it crashes

Upvotes: 1

Views: 275

Answers (2)

Michael Vitrano
Michael Vitrano

Reputation: 106

I am a member of the iOS team at Aviary. This is caused by a conflict between our compileShader function and yours. Our function was not properly namespaced and resulted in the conflict. We will be addressing this in the next release of the SDK.

Michael

Upvotes: 1

Mike
Mike

Reputation: 481

What I think about it. Check your shader value. It should have correct shader path from your resources or somewhere else with appropriate type (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER).

Seems to me you've it's nil

Upvotes: 0

Related Questions