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

Crash at launch after upgrading to 1.4 #45

Open
thanhhai08sk opened this issue Dec 9, 2020 · 4 comments
Open

Crash at launch after upgrading to 1.4 #45

thanhhai08sk opened this issue Dec 9, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@thanhhai08sk
Copy link

thanhhai08sk commented Dec 9, 2020

Describe the bug
I was using 1.3.1 but then encounter the issue "Could not open env for DB (12)". I try to upgrade to 1.4.1 and 1.4.0 but the app crash at launch with:

dyld: symbol '_$s9ObjectBox13EntityBindingP09generatorD7VersionSiyFTq' not found, expected in '/private/var/containers/Bundle/Application/4D3A6114-9D36-4C10-856E-9FD825083863/Journal it!.app/Frameworks/ObjectBox.framework/ObjectBox', needed by '/private/var/containers/Bundle/Application/4D3A6114-9D36-4C10-856E-9FD825083863/Journal it!.app/Frameworks/CoreIOS.framework/CoreIOS'

ObjectBox is used in the common module CoreIOS. The generator script seems to work:
"$PODS_ROOT/ObjectBox/generate_sources.sh" -- --output "$PROJECT_DIR/generated/EntityInfo-CoreIOS.generated.swift" --model-json "$PROJECT_DIR/model-CoreIOS.json" # add this parameter to make entities exportable: --visibility public

Basic info (please complete the following information):

  • ObjectBox version 1.4.1/1.4.0
  • Reproducibility: always
  • Device: iPhone 6s
  • OS: iOS 14.2

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade Objectbox following https://swift.objectbox.io/install
  2. Build
  3. Crash at launch
@thanhhai08sk thanhhai08sk added the bug Something isn't working label Dec 9, 2020
@thanhhai08sk thanhhai08sk changed the title Crash after upgrading to 1.4 Crash at launch after upgrading to 1.4 Dec 9, 2020
@greenrobot
Copy link
Member

Upgrade Objectbox following https://swift.objectbox.io/install

So, you did the following?

pod repo update
pod update ObjectBox
Pods/ObjectBox/setup.rb

Can you paste the output of running setup.rb, please?

@thanhhai08sk
Copy link
Author

thanhhai08sk commented Dec 10, 2020

Yes, I did.
The output:

MacBook-Pro:CoreIOS HaiNguyen$ Pods/ObjectBox/setup.rb
 ObjectBox Project Setup 

🔸 Looking for project files in the current directory ...
🔸 Found a single project.
🔸 Using "/Users/HaiNguyen/Documents/githubProject/JournalIt/journal_it/ios/CoreIOS/CoreIOS.xcodeproj"
🛑 No launchable Xcode targets found in "/Users/HaiNguyen/Documents/githubProject/JournalIt/journal_it/ios/CoreIOS/CoreIOS.xcodeproj"
ℹ️ Please specify project and target explicitly; run with --help for help

Not sure if there's anything wrong but CoreIOS is a framework module, EntityInfo-CoreIOS.generated.swift was refreshed on each build, and I didn't have problem with version 1.3.1

When specify the target:

MacBook-Pro:CoreIOS HaiNguyen$ Pods/ObjectBox/setup.rb --skip-modified /Users/HaiNguyen/Documents/githubProject/JournalIt/journal_it/ios/CoreIOS/CoreIOS.xcodeproj CoreIOS
 ObjectBox Project Setup 

🔸 Using "/Users/HaiNguyen/Documents/githubProject/JournalIt/journal_it/ios/CoreIOS/CoreIOS.xcodeproj"

Target "CoreIOS":

  🔸 Script was modified.
  🔸 Existing script: "$PODS_ROOT/ObjectBox/generate_sources.sh" -- --output "$PROJECT_DIR/generated/EntityInfo-CoreIOS.generated.swift" --model-json "$PROJECT_DIR/model-CoreIOS.json" # add this parameter to make entities exportable: --visibility public
  🔸 Expected script: "$PODS_ROOT/ObjectBox/generate_sources.sh" -- --output "$PROJECT_DIR/generated/EntityInfo-CoreIOS.generated.swift" --model-json "$PROJECT_DIR/model-CoreIOS.json" # add this parameter to make entities exportable: --visibility public
  🔹 Skipped target "CoreIOS".

 🔸 No changes made to project. 
 ℹ️ If your code generation was not setup properly run with --help to see options

 💬 Please remember to use the .xcworkspace CocoaPods created from now on instead of your project.

@greenrobot
Copy link
Member

Can you please try what is suggested here: # add this parameter to make entities exportable: --visibility public

To do this you have to locate the script in the Xcode build phase "[OBX] Update Sourcery Generated Files".

It might also be helpful to check the following docs: manual-installation, setup-script, and code generation.

Once we know what exactly is going on we'll try to make it simpler in the future. E.g. looking at setup.rb:

  if !target.launchable_target_type? # probably a framework. Add a common use case reminder.
      obx_shell_script << " # add this parameter to make entities exportable: --visibility public"
  end

It might be better to detect a framework reliably, but not sure how exactly that could be done yet with what xcodeproj has to offer.

@thanhhai08sk
Copy link
Author

Unfortunately, I tried to add --visibility public but got the same result.

Checked the docs, though I can't find anything to try out for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants