我正在构建一个 Flutter 应用程序并且我已经集成了 Firebase,但是当我点击一个按钮来注册、登录或注销时,我不断收到这个错误。我见过其他人问过同样的问题,但似乎没有一个对我有用。我正在使用 Flutter 和Android Studio。我该如何解决这个问题?
这是我的代码的摘录
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.red,
body: Center(
child: Container(
child: RaisedButton(
onPressed: () {
FirebaseAuth.instance.signOut().then((value) {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
LoginScreen()));
});
},
child: Text("Logout"),
)
)
)
);
}
}
Run Code Online (Sandbox Code Playgroud)
下面是抛出的异常
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> { …Run Code Online (Sandbox Code Playgroud) 我无法构建使用CocoaPods的项目.我收到以下错误:
diff: /../Podfile.lock: No such file or directory
diff: Manifest.lock: No such file or directory error:
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.`
Run Code Online (Sandbox Code Playgroud)
$ pod install似乎工作正常,并将一个Pods项目添加到我的工作区.我试过$ pod update但这没有用.
似乎PODS_ROOT没有设定.
Podfile:
platform :ios, '6.0'
workspace 'Example.xcworkspace'
xcodeproj 'example/Example.xcodeproj'
pod 'TestFlightSDK', '~> 1.3.0-beta.5'
pod 'TestFlightLogger', '~> 0.0.2'
pod 'CocoaLumberjack', '~> 1.6.2'
pod 'Reachability', '~> 3.1.0'
pod 'SBJson', '~> 3.2'
pod 'MKMapViewZoom', '~> 1.0.0'
Run Code Online (Sandbox Code Playgroud) 我刚刚将旧项目升级到新的iOS 7.它已经在使用Cocoapods了.我编译并运行,在模拟器和设备上一切正常.我试图使用Xcode存档它,我得到以下错误.
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
有任何想法吗!
更新:
Pods项目的体系结构设置如下:
Standard architectures (armv7,armv7s)
Run Code Online (Sandbox Code Playgroud)
解决方案:
Cocoapods已从我的项目中删除.现在一切都很好!
我创建了一个名为"ABC"的应用程序.几个月后,我决定将名称改为"ABCD".我相信,我改变了它的方式,在我Podfile,我换target "ABC" do到target "ABCD" do.但是,我记得在我的工作区中经历了很多问题/错误导致了很多压力.很久以前,我不记得了.
现在我准备提交,我想最后一次更改名称.我在iTunes Connect中更改了名称,但现在我想更改我的PRODUCT_NAME和我的捆绑标识符以匹配.
做这个的最好方式是什么?我应该更改Podfile中的目标字段吗?或者我应该离开它们,只是在Xcode中更改其他内容?或者我需要更改两件事还是多件事?
我正在关注一个需要自定义配置的教程(这里是链接),我认为这影响了我的 pod 文件,因为我收到了这个警告:
为了让 CocoaPods 集成工作,请将目标的基本配置设置
iBuilt为Pods/Target Support Files/Pods-iBuilt/Pods-iBuilt.debug.xcconfig或包含Pods/Target Support Files/Pods-iBuilt/Pods-iBuilt.debug.xcconfig在您的构建配置中 (iBuilt/Unity.xcconfig)。[!] CocoaPods 没有设置你的项目的基本配置,因为你的项目已经有一个自定义的配置集。为了让 CocoaPods 集成工作,请将目标的基本配置设置
iBuilt为Pods/Target Support Files/Pods-iBuilt/Pods-iBuilt.release.xcconfig或包含Pods/Target Support Files/Pods-iBuilt/Pods-iBuilt.release.xcconfig在您的构建配置中 (iBuilt/Unity.xcconfig)。
我参考了这些链接:StackOverflow和Github以获得潜在的解决方案,但这些建议都不起作用。所以我需要你的帮助:)
pod install我尝试按照原始指南在 Flutter 中的 iOS 上设置 Firebase,但在终端中输入后收到以下消息:
[!] CocoaPods could not find compatible versions for pod "Firebase/Auth":
In snapshot (Podfile.lock):
Firebase/Auth (= 6.34.0, ~> 6.0)
In Podfile:
firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) was resolved to 1.4.1, which depends on
Firebase/Auth (= 8.0.0)
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* changed the constraints of dependency `Firebase/Auth` inside your development pod `firebase_auth`.
You should run `pod update Firebase/Auth` to …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 MacBook Pro M1 上使用 Firebase 构建 Flutter 项目。一切都很好,直到我添加 Firebase Core 依赖项。现在我无法运行该项目,因为我在调试控制台中遇到了下面指定的错误。
\nLaunching lib/main.dart on iPhone 11 in debug mode...\nlib/main.dart:1\nCocoaPods' output:\n\xe2\x86\xb3\n Preparing\n Analyzing dependencies\n Inspecting targets to integrate\n Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)\n Fetching external sources\n -> Fetching podspec for `Flutter` from `Flutter`\n -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`\n firebase_core: Using Firebase SDK version '8.10.0' defined in 'firebase_core'\n Resolving dependencies of `Podfile`\n CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is …Run Code Online (Sandbox Code Playgroud) cocoapods ×5
firebase ×3
flutter ×3
ios ×3
cocoa-touch ×2
objective-c ×2
xcode ×2
apple-m1 ×1
build-error ×1
dart ×1
ios7 ×1
unity5 ×1
vuforia ×1
xcode5 ×1