我已经做了一个 Flutter 应用程序。发布的 apk 大约为 14MB。我搜索了缩小这个的方法,发现了这个:https : //flutter.io/android-release/#enabling-proguard
但我的问题是,我怎样才能知道我在第 1 步中使用的所有附加库?是否有任何命令可以了解它们,还是只是我添加到pubspec.yaml
?
我需要如何在这个文件中实现它们/android/app/proguard-rules.pro
?
当我构建iOS应用程序时,它在Macbook的模拟器中完美打开。当我在iTunes商店上发布该应用程序时,该应用程序不再起作用。初始屏幕已显示,但停留在屏幕上。
我正在使用 sklearn 构建朴素贝叶斯分类器(nb)。
该数据集由 4 个受试者组成,每个受试者都有不同数量的标记数据。
我想应用留一主题交叉验证,但我在互联网上找不到类似的例子。
我的数据由以下部分组成:
x = [[2,0],[3,1],[2,1],[3,2]], [[4,2],[5,3],[5,2],[5,3]], [[7,3],[6,2],[7,1],[6,2]], [[2,3],[2,4],[3,4],[2,3]]]
y = [[0,1,3,2],[1,2,3,2],[0,1,1,1],[0,1,2,1]]
Run Code Online (Sandbox Code Playgroud)
因此,每个受试者的数据是 x 中的一个子数组,以及 y 中对应的子数组。输入特征各由 2 个元素组成(例如加速度计的平均值和标准差)。
我在互联网上找到了这样的例子
sklearn.model_selection.LeaveOneOut
但这在我的示例中不起作用,因为我想将整个主题的数据作为测试集。
有满足我需求的好产品吗?
我目前正在制作一个带有卡片小部件列表的应用程序。这是一个代码片段:
new GestureDetector(
onLongPress: () {
showAlert();
//pops up an AlertDialog
},
child: new Card(child: new Text("Hello"))
)
Run Code Online (Sandbox Code Playgroud)
是否可以使卡片小部件可触摸,以便用户可以感觉到/看到卡片被(长)点击?我正在搜索“InkWell-something 结果”。
编辑:当我长按它们时,我想在我的卡片小部件上产生飞溅效果。我的意思是飞溅效果的一个例子在下面的 GIF 中给出:
我正在将 Flutter 与“Firebase_auth”包一起使用。在执行以下注册函数时,我在“UserUpdateInfo”上收到错误消息。
signup(CustomUser user, AuthNotifier authNotifier) async {
UserCredential userCredential = await FirebaseAuth.instance
.createUserWithEmailAndPassword(email: user.email, password: user.password)
.catchError((error) => print(error.code));
if (userCredential != null) {
UserUpdateInfo updateInfo = UserUpdateInfo();
updateInfo.displayName = user.displayName;
User firebaseUser = userCredential.user;
if (firebaseUser != null) {
await firebaseUser.updateProfile(updateInfo);
await firebaseUser.reload();
print("Sign up: $firebaseUser");
User currentUser = await FirebaseAuth.instance.currentUser();
authNotifier.setUser(currentUser);
}}}
Run Code Online (Sandbox Code Playgroud)
显示以下错误:
未定义的类“UserUpdateInfo”
我该怎么办?
我有一个函数 xyz() 返回一个tuple<std::string, double>
. 当我单独调用此函数时,我可以执行以下操作:
auto [tresh, loss] = xyz(i);
Run Code Online (Sandbox Code Playgroud)
这不会导致任何错误,但是如果我想在 if else 块中使用 xyz() 函数,那么我不能在以下代码中再使用tresh
andloss
变量。例子:
if (boolX) {
auto [tresh, loss] = xyz(i);
} else {
auto [tresh, loss] = xyz(j);
}
std::cout << tresh << std::endl;
Run Code Online (Sandbox Code Playgroud)
我还尝试在 if else 块之前初始化 tresh 和 loss 变量并删除auto
,但这会产生以下错误:
Expected body of lambda expression
如何解决这个问题?
我试图在我的 Android 手机上测试我的第一个应用程序,但在扫描后,我收到以下错误消息:
“未捕获的错误:java.error.sockettimeoutexception:10000 毫秒后无法从 192.xxx.x.xx(端口 45513)连接到 192.xxx.x.xx(端口 19000)”
我已经尝试打开端口 19000 的防火墙设置,但这似乎不是问题,因为它没有解决我的问题。我还从 virtualbox 关闭了虚拟网络。
有人能帮我吗?
当我尝试运行我的 Flutter 应用程序时,构建成功,但是当 xcode 尝试在模拟器上自动安装此构建时,出现以下错误:
The parent bundle has the same identifier
(com.abc.def) as sub-bundle at
/Users/jan/Library/Developer/CoreSimulator/Devices/DFF35FBB-FE6C-462E-80964BFBFAF57291/data/Library/Caches/com.apple.mobile.installd.staging/temp.zyu9i6/extracted/Runner.app/Frameworks/App.framework
Run Code Online (Sandbox Code Playgroud)
我已经被这个错误困住了几天。我在 Word Wide Web 上找不到这个问题的答案。
我已经尝试删除模拟器的所有内容和设置,但这并不能解决问题。清理项目也不是解决方案。
谢谢!
flutter ×5
dart ×3
android ×2
ios ×2
c++ ×1
c++17 ×1
expo ×1
firebase ×1
minify ×1
proguard ×1
python ×1
python-3.x ×1
react-native ×1
scikit-learn ×1
timeout ×1
tuples ×1
validation ×1
widget ×1
xcode ×1