Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OneSignalNotificationServiceExtension bitcode error on build #659

Closed
Style87 opened this issue May 2, 2020 · 11 comments
Closed

OneSignalNotificationServiceExtension bitcode error on build #659

Style87 opened this issue May 2, 2020 · 11 comments

Comments

@Style87
Copy link

Style87 commented May 2, 2020

Description:

When I go to build to my target device I get the error below.

ld: '/Users/lucashartzell/Library/Developer/Xcode/DerivedData/Runner-dpeadbdaauvfpbgyhkflubgrwpbm/Build/Products/Debug-iphoneos/libPods-OneSignalNotificationServiceExtension.a(Pods-OneSignalNotificationServiceExtension-dummy.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/lucashartzell/Library/Developer/Xcode/DerivedData/Runner-dpeadbdaauvfpbgyhkflubgrwpbm/Build/Products/Debug-iphoneos/libPods-OneSignalNotificationServiceExtension.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have bitcode_enabled set to no everywhere it can be. I've looked through all the values in Xcode and I've greped for it in the code base to confirm so.

Environment
iOS 13.4 -sdk iphoneos13.4
The one signal sdk was added through cocoapods. The onesignal_flutter version in the pubspec is 2.3.4.

Steps to Reproduce Issue:

  1. Install iOS SDK version 2.8.2 with Cocoapods into project
  2. Attempt to build to a physical device

Anything else:
I have already tried running flutter clean and doing a full reinstall on the pods with no luck.

Podfile.txt

@Graig123git
Copy link

@Style87 +1, did you manage to figure this out ?

@Style87
Copy link
Author

Style87 commented May 24, 2020

@Graig123git, unfortunately I have not. I've been at this error off and on for a weeks now.

@rgomezp
Copy link
Contributor

rgomezp commented May 28, 2020

It looks like bitcode is still enabled somewhere. The problem arises since the app was compiled without bitcode. Make sure it is set to No in both the project and library settings

@Style87
Copy link
Author

Style87 commented May 29, 2020

Is it possible that grepping my entire code base from the root for BITCODE would not show an instance where it's set to yes? I have done this and every value is set to no.

@osmanc777
Copy link

How about you guys, this error is really a headache since a few days ago everything was working fine for me but suddenly I threw myself that error when trying to subscribe the user.

Today I managed to find a solution or at least make it work.

Steps to follow:

  1. Have the Push Notifications added in Xcode
    enable these options by the background push:
    -Background Fetch
    -Remote notifications

xcodepush

  1. Check if they have any updates to cocoa pods
pod repo update

pods1

sudo gem install cocoapods

pods2

then in the root folder of your project run again

pod repo update

pods3

in my case as I am working with ionic, enable onesignal debugging options, building an object of each persimo that requests onesignal

      this.oneSignal.startInit('#####', ####');

      //important debuggin info
      this.oneSignal.setLogLevel({logLevel: 6, visualLevel: 0});

      this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.Notification);

      this.oneSignal.handleNotificationReceived().subscribe((respNoti) => {
        // do something when notification is received
      });

      this.oneSignal.handleNotificationOpened().subscribe((respNoti) => {
        // do something when a notification is opened
      });

      this.oneSignal.getIds().then(info => {
        this.userId = info.userId;
        this.userToken = info.pushToken;
        console.log('ID OneSignal: ',this.userId);
        console.log('Token push: ', this.userToken);
      });

      this.oneSignal.endInit();

//function get log status user (debug for safari)

  getStatusUser() {
    this.oneSignal.getPermissionSubscriptionState().then((resp:OSPermissionSubscriptionState) => {
      let Obj:any = {
        Promt:       resp.permissionStatus.hasPrompted,
        PermisosIOS: resp.permissionStatus.status,
        PermisosAnd: resp.permissionStatus.state,
        Suscrito:    resp.subscriptionStatus.subscribed,
        ConfigUser:  resp.subscriptionStatus.userSubscriptionSetting,
        UserID:      resp.subscriptionStatus.userId,
        UserToken:   resp.subscriptionStatus.pushToken
      }


      console.log('OneDebug: ',Obj);
      console.log('iOS: 0 = Not Determined, 1 = Denied, 2 = Authorized ', resp.permissionStatus.status);
      console.log('Android: 1 = Authorized, 2 = Denied ', resp.permissionStatus.state);
      console.log('FCM/APNs: ', resp.subscriptionStatus.pushToken);
    })
  }

pushInfo

then proceed to generate project build again

to know if your push subscription was successful the userId and pushToken must contain a string of strings must not be null

basically the problem is fixed when updating cocoa pods.

@rgomezp
Copy link
Contributor

rgomezp commented Jun 16, 2020

Thank you for the solution! I will close this issue. Cheers

@rgomezp rgomezp closed this as completed Jun 16, 2020
@nomicool
Copy link

nomicool commented Oct 3, 2020

The solution did not help with flutter

@robertohuertasm
Copy link

I'm getting this in Flutter too. @rgomezp should we reopen this issue?

@rgomezp
Copy link
Contributor

rgomezp commented Oct 21, 2020

Howdy @nomicool @robertohuertasm

Before reopening here, would you please take a look at this Flutter-specific thread and try the suggestions from there?

@dasundev
Copy link

Set Enable Bitcode to NO Then it should be work.
image

@xinatcg
Copy link

xinatcg commented Mar 28, 2023

for Unity, check this thread: OneSignal/OneSignal-Unity-SDK#540 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants