Adding firebase framework

184 views
Skip to first unread message

Tuan Nomoty

unread,
Apr 4, 2023, 1:48:19 PM4/4/23
to Chromium-dev
Hi everybody. I'm looking for solution to add firebase framework into chromium. Currently, I use xcode to build Firebase then copy them into chromium app but when I installed to my IPhone, I got code signing error "

Code=13 "Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.0RMybW/extracted/Payload/Chromium.app"

Any help will be precious for me.

Sincerely! 

Sylvain Defresne

unread,
Apr 4, 2023, 1:58:17 PM4/4/23
to nguyentua...@gmail.com, Chromium-dev

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/0cdeb888-9739-4b19-8c82-f0a720ffee13n%40chromium.org.

Tuan Nomoty

unread,
Apr 7, 2023, 1:33:46 PM4/7/23
to Chromium-dev, Sylvain Defresne, Chromium-dev, nguyentua...@gmail.com
Hi Sylvain,
I got error 
"ERROR Input to targets not generated by a dependency.
The file:
  //out/Debug-iphoneos/FirebaseAuth/FirebaseAuth.framework/FirebaseAuth
is listed as an input or source for the targets:
  //build/config/ios:FirebaseAuth_bundle_data(//build/toolchain/ios:ios_clang_arm64)
  //build/config/ios:FirebaseAuth_bundle_data(//build/toolchain/ios:ios_clang_arm64_13_4)
but no targets in the build generate that file."

When I add bundle_data like this 
"bundle_data("FirebaseAuth_bundle_data") 
{ sources = [ "$root_build_dir/FirebaseAuth/FirebaseAuth.framework/FirebaseAuth",
 "$root_build_dir/FirebaseAuth/FirebaseAuth.framework/Info.plist", # List all the other files, if the framework contains directories, you'll # needs to use multiple bundle_data targets, one per sub-directory. ] 
outputs = [ "{{bundle_resources_dir}}/Frameworks/FirebaseAuth.framework/{{source_file_part}}" ] }

Sylvain Defresne

unread,
Apr 11, 2023, 6:54:39 AM4/11/23
to Tuan Nomoty, Chromium-dev
If the third-party library you use is not built as part of building Chromium, you must not put it in $root_build_dir, instead put it in with the source code. If you build the third-party library as part of building Chromium, use ios_framework_bundle template to build the library.
-- Sylvain

Sylvain Defresne

unread,
Apr 18, 2023, 8:11:23 AM4/18/23
to Tuan Nomoty, Chromium-dev
The problem is that you've copied the pre-compiled framework in the build directory (i.e. $root_build_dir).

Instead, put the pre-compiled framework outside of the build directory, and put a path relative to the root of the chromium checkout. E.g. put the pre-compiled framework in src/my_local_changes/FirebaseAuth and use //my_local_changes/FirebaseAuth/... as the path in the BUILD.gn rules.
-- Sylvain


On Tue, Apr 18, 2023 at 1:46 PM Tuan Nomoty <nguyentua...@gmail.com> wrote:
Hi Sylvain,
Can you explain detail to me what your mean with "instead put it in with the source code". I built third-party library before chromium, not as part of building Chromium. Thanks

Tuan Nomoty

unread,
Apr 18, 2023, 1:20:39 PM4/18/23
to Chromium-dev, Sylvain Defresne, Chromium-dev, Tuan Nomoty
Hi Sylvain,
Can you explain detail to me what your mean with "instead put it in with the source code". I built third-party library before chromium, not as part of building Chromium. Thanks

On Tuesday, April 11, 2023 at 5:54:39 PM UTC+7 Sylvain Defresne wrote:

Tuan Nomoty

unread,
Apr 20, 2023, 1:27:06 PM4/20/23
to Chromium-dev, Tuan Nomoty, Sylvain Defresne, Chromium-dev
Thanks Sylvain,
I successfully install Chromium which embedded prebuilt firebase framework.
For those who are struggle with this issue, do following step (Pretending you suppose to build Debug-iphoneos)
- Get Firebase source by Coacapod and built with Xcode (Remember to select correct Team and Sign Certificate for each firebase target)
- Using ninja to build chromium as normal.
- Copy external frameworks to //out/Debug-iphoneos/Chromium.app/Frameworks
- Resign Chromium.app using codesign
- Create .ipa file

Sylvain Defresne

unread,
Jun 25, 2024, 11:00:49 AM (8 days ago) Jun 25
to Chromium-dev, Tuan Nomoty, Diego Olguin
It looks like you only added the configs to some of the targets, but not to the one that compiles ios/chrome/browser/shared/coordinator/scene/scene_delegate.mm, and thus this target has no access to the config.

You need to add the config `"//frameworks:firebase_core_framework_config"` to all targets that import the framework headers. If the framework is included from a header exposed by the target, the config needs to be listed in public_configs in addition to configs. See `gn help public_configs`.

Note: you can also declare a group target that just set `public_configs = [ "//frameworks:firebase_core_framework_config" ]` and instead put dependency on that target (either in deps or public_deps).
-- Sylvain

On Tue, Jun 25, 2024 at 3:42 PM Diego Olguin <diego....@salamancasolutions.com> wrote:
Hi to everyone

I followed Sylvain's steps, but it doesn't work for me, the framework files are not recognized:

In file included from ../../ios/chrome/browser/shared/coordinator/scene/scene_delegate.mm:14:
../../ios/chrome/app/main_application_delegate.h:9:9: fatal error: 'FirebaseCore/FirebaseCore.h' file not found
    9 | #import <FirebaseCore/FirebaseCore.h>
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

I created the configuration as follows:

config("firebase_core_framework_config") {
  frameworks = [ "FirebaseCore.framework" ]
  framework_dirs = [ "/Users/me/Development/chromium/src/frameworks/FirebaseCore" ]
}
bundle_data("firebase_core_framework_bundle_data") {
  sources = [
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Info.plist",

      # List all the other files, if the framework contains directories, you'll
      # needs to use multiple bundle_data targets, one per sub-directory.
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/FirebaseCore",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/FirebaseCore_Privacy.bundle",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/_CodeSignature/CodeResources",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore.h",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Headers/FIRConfiguration.h",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Headers/FIRLoggerLevel.h",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore-umbrella.h",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Headers/FIROptions.h",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Headers/FIRVersion.h",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Headers/FIRApp.h",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Modules/module.modulemap",
  ]
  outputs = [ "{{bundle_resources_dir}}/Frameworks/FirebaseCore.framework/{{source_file_part}}" ]
}


And I included it in the target where I require it:

source_set("app_internal") {
...
configs += [ "//frameworks:firebase_core_framework_config" ]
....
deps = [
    ....
    "//frameworks:firebase_core_framework_bundle_data",
  ]

...

Is there any step that I did not consider? or is my configuration is wrong?

I appreciate your help.

Thank you



Diego Olguin

unread,
Jun 25, 2024, 8:25:38 PM (7 days ago) Jun 25
to Chromium-dev, Tuan Nomoty, Sylvain Defresne, Chromium-dev
Hi to everyone

I followed Sylvain's steps, but it doesn't work for me, the framework files are not recognized:

In file included from ../../ios/chrome/browser/shared/coordinator/scene/scene_delegate.mm:14:
../../ios/chrome/app/main_application_delegate.h:9:9: fatal error: 'FirebaseCore/FirebaseCore.h' file not found
    9 | #import <FirebaseCore/FirebaseCore.h>
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

I created the configuration as follows:

config("firebase_core_framework_config") {
  frameworks = [ "FirebaseCore.framework" ]
  framework_dirs = [ "/Users/me/Development/chromium/src/frameworks/FirebaseCore" ]
}
bundle_data("firebase_core_framework_bundle_data") {
  sources = [
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework",
      "/Users/me/Development/chromium/src/frameworks/FirebaseCore/FirebaseCore.framework/Info.plist",

      # List all the other files, if the framework contains directories, you'll
      # needs to use multiple bundle_data targets, one per sub-directory.

Diego Olguin

unread,
Jun 25, 2024, 8:25:56 PM (7 days ago) Jun 25
to Chromium-dev, Sylvain Defresne, Tuan Nomoty, Diego Olguin
Thanks Sylvain

You are correct, I needed to add the configuration to other targets.

I Added all the necessary frameworks for push notifications and they work without problems in the simulator. But I have a problem when trying to install the app on some device, I have the following error:

Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.Ez3MMZ/extracted/chrome.app/Frameworks/FirebaseCore.framework : 0xe8008014 (The executable contains an invalid signature.)

Do you know how I could solve that problem? I have the provisioning profiles correctly configured and I have already installed on several devices before adding the new frameworks.

Thank you
Diego

Diego Olguin

unread,
Jun 28, 2024, 2:21:55 AM (5 days ago) Jun 28
to Chromium-dev, Diego Olguin, Sylvain Defresne, Tuan Nomoty
Hello

I already found the solution, I just have to sign the added frameworks as follows:

codesign --force --deep --sign "iPhone Developer: Your Name (XXXXXXXXXX)" /path/to/your/project/Frameworks/FirebaseCore.framework

Another issue is the architecture of the simulator may be different from the real device, and that should be considered when building with the precompiled framework.

Regards
Diego

Reply all
Reply to author
Forward
0 new messages