Rollbar plugin - ios build failed

I wonder if anyone have tried to build IOS with resgrid-cordova-plugins-rollbar? Android works fine with this plugin but IOS generate an error:

fatal error: 'Rollbar/Rollbar.h' file not found
        #import <Rollbar/Rollbar.h>
             
        1 error generated.
  @ionic/cli-utils : 1.2.0
  Cordova CLI      : 6.5.0 
  Ionic CLI        : 3.2.0
  @ionic/app-scripts              : 1.3.7
  @ionic/cli-plugin-cordova       : 1.2.1
  @ionic/cli-plugin-ionic-angular : 1.2.0
  Cordova Platforms               : ios 4.3.1
  Ionic Framework                 : ionic-angular 3.3.0
  Node       : v6.10.0
  OS         : macOS Sierra
  Xcode      : Xcode 8.3.1 Build version 8E1000a 
  ios-deploy : 1.9.1 
  ios-sim    : 5.0.13

Link to that plugin maybe?
What did you do to implement it?

Hi,

Plugin repo:

Installation:

ionic cordova plugin add resgrid-cordova-plugins-rollbar --variable ROLLBAR_ACCESS_TOKEN="TOKEN" --variable ROLLBAR_ENVIRONMENT="ENV"
npm install @ionic-native/rollbar 
npm install angular-rollbar

app.module.ts:

import { Rollbar } from '@ionic-native/rollbar';
import { RollbarModule } from 'angular-rollbar';
...
providers: [
 ...
    Rollbar
  ],

app.component.ts:

import { RollbarService } from 'angular-rollbar';
import { Rollbar } from '@ionic-native/rollbar';

constructor(
...
    public rollbar: Rollbar,
    public rollbarService: RollbarService
)

 ngOnInit() {
    this.platform.ready().then(() => {
      this.rollbar.init();
})

someErrorEvent() {
 this.rollbarService.error("Error message");
}

Isn’t this the opposite of the Cordova plugin you are trying to use?[quote=“pe1, post:1, topic:92201”]
fatal error: ‘Rollbar/Rollbar.h’ file not found
[/quote]

Could you please post the complete error message?
Also please run the build with --verbose and post the error message.

Normally the plugin should take care of copying the Rollbar files over. I suggest you remove and re-add the ios platform, reinstall the plugin etc to see if this fixes stuff.

Just to be clear, i am using 2 types of rollbar notifications: first one is releated to the plugin to catch native Android/IOS errors, and the socond one to catch JS errors (import { RollbarModule } from 'angular-rollbar):

app.module.ts:

import { Rollbar } from '@ionic-native/rollbar'; // catch native errors
import { RollbarModule } from 'angular-rollbar'; // catch JS errors

@NgModule({
   
  imports: [
...
    RollbarModule.forRoot({
            accessToken: 'TOKEN'
        }),
  ],

providers: [
...
   Rollbar 

  ],
})

Back to the plugin issue, i am trying to remove/add plugin without success so far

ionic cordova build ios --prod --verbose:


In file included from /Users/artur/work/scooploop/app/scooploop/platforms/ios/Scooploop/Plugins/resgrid.cordova.plugins.rollbar/CDVRollbar.m:7:
        Scooploop/Plugins/resgrid.cordova.plugins.rollbar/CDVRollbar.h:9:9: fatal error: 'Rollbar/Rollbar.h' file not found
        #import <Rollbar/Rollbar.h>
                ^
        1 error generated.
        
        ** BUILD FAILED **
        
        
        The following build commands failed:
        	CompileC /Users/artur/Library/Developer/Xcode/DerivedData/Scooploop-cunkfkklepigkuejpzeluohqdpoj/Build/Intermediates/Scooploop.build/Debug-iphonesimulator/Scooploop.build/Objects-normal/x86_64/CDVRollbar.o Scooploop/Plugins/resgrid.cordova.plugins.rollbar/CDVRollbar.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
        (1 failure)
        Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/artur/work/scooploop/app/scooploop/platforms/ios/cordova/build-debug.xcconfig,-workspace,Scooploop.xcworkspace,-scheme,Scooploop,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 5s,build,CONFIGURATION_BUILD_DIR=/Users/artur/work/scooploop/app/scooploop/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/artur/work/scooploop/app/scooploop/platforms/ios/build/sharedpch

Hi, i have the same problem, did you find a solution?

nope I had resigned from this plugin, currently using only RollbarService from ‘angular-rollbar’

bad news… i will try… :confused:

1 Like

add

to platforms/ios/ Podfile. then run pod install