Closed cdoky closed 3 years ago
If i move WORKSPACE to ios-app
run bazel build :ios-app
in ios-app
ERROR: /ios-app/Pods/AgoraAudio_iOS/BUILD.bazel:3:16: every rule of type apple_framework_packaging implicitly depends upon the target '@build_bazel_rules_ios//rules/framework:framework_packaging', but this target could not be found because of: error loading package '@build_bazel_rules_ios//rules/framework': Unable to find package for @rules_python//python:defs.bzl: The repository '@rules_python' could not be resolved.
ERROR: Analysis of target '//:ios-app' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.173s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 2 targets configured)
load("@build_bazel_rules_ios//rules:framework.bzl", "apple_framework")
apple_framework( name = "AgoraAudio_iOS", platforms = {"ios": "8.0"}, vendored_dynamic_frameworks = [ "AgoraAIDenoiseExtension.framework", "AgoraCore.framework", "AgoraRtcKit.framework", "AgoraSoundTouch.framework", "Agorafdkaac.framework", ], visibility = ["//visibility:public"], )
Can you link to what tutorial exactly you are following? This doesn't seem to be related to cocoapods-bazel
but a general iOS bazel problem.
That said, noticed this in the error msg:
- /tutorial/Pods/AgoraAudio_iOS and referenced by '//ios-app:ios-app_objc'
and that path doesn't exist in the folder structure you shared above, maybe your deps
should look like this instead?
deps = [
":UrlGetClasses",
"//ios-app/Pods/AgoraAudio_iOS"
],
Also, the WORKSPACE
file should always be at the root
@thiagohmcruz
Hi, tutorial from https://docs.bazel.build/versions/main/tutorial/ios-app.html
deps = [
":UrlGetClasses",
# Can't change it like that, because this library might depend on other libraries
"//ios-app/Pods/AgoraAudio_iOS"
],
like generated BUILD by cocoapods-bazel
load("@build_bazel_rules_ios//rules:framework.bzl", "apple_framework")
apple_framework(
name = "Bagel",
srcs = glob([
"iOS/Source/*.h",
"iOS/Source/*.m",
]),
platforms = {"ios": "8.0"},
public_headers = [
"iOS/Source/Bagel.h",
"iOS/Source/BagelBaseModel.h",
"iOS/Source/BagelBrowser.h",
"iOS/Source/BagelCarrierDelegate.h",
"iOS/Source/BagelConfiguration.h",
"iOS/Source/BagelController.h",
"iOS/Source/BagelDeviceModel.h",
"iOS/Source/BagelProjectModel.h",
"iOS/Source/BagelRequestCarrier.h",
"iOS/Source/BagelRequestInfo.h",
"iOS/Source/BagelRequestPacket.h",
"iOS/Source/BagelURLConnectionInjector.h",
"iOS/Source/BagelURLSessionInjector.h",
"iOS/Source/BagelUtility.h",
],
visibility = ["//visibility:public"],
deps = ["//Pods/CocoaAsyncSocket"],
)
May be need move WORKSPACE to ios-app/
but, there is an error:
ERROR: //ios-app/Pods/AgoraAudio_iOS/BUILD.bazel:3:16: every rule of type apple_framework_packaging implicitly depends upon the target '@build_bazel_rules_ios//rules/framework:framework_packaging', but this target could not be found because of: error loading package '@build_bazel_rules_ios//rules/framework': Unable to find package for @rules_python//python:defs.bzl: The repository '@rules_python' could not be resolved.
ERROR: Analysis of target '//Pods/AgoraAudio_iOS:AgoraAudio_iOS' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.144s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets configured)
fixed by import rules_python
and move the WORKSPACE to ios-app/
git_repository(
name = "rules_python",
remote = "https://github.com/bazelbuild/rules_python.git",
tag = "0.3.0",
)
Closing, sounds like the issue is resolved, doesn't appear related to this repo.
run:
bazel build //ios-app:ios-app
objc_library( name = "UrlGetClasses", srcs = [ "UrlGet/AppDelegate.m", "UrlGet/UrlGetViewController.m", "UrlGet/main.m", ], hdrs = glob(["UrlGet/*.h"]), data = ["UrlGet/UrlGetViewController.xib"], )
ios_application( name = "ios-app", bundle_id = "Google.UrlGet", families = [ "iphone", "ipad", ], minimum_os_version = "9.0", infoplists = [":UrlGet/UrlGet-Info.plist"], visibility = ["//visibility:public"], deps = [ ":UrlGetClasses", "//Pods/AgoraAudio_iOS" ], )