小编Dar*_*han的帖子

在Android中运行浓缩咖啡测试时出现内存不足的问题

在Kitkat和Lollipop设备上运行咖啡测试套件时,我一直面临这个问题(OutOfMemory)。该套件可在棉花糖设备上完美运行。以下是更多详细信息,如果能在确定此问题的根本原因方面获得任何帮助,我将不胜感激。以下是更多详细信息:

  1. 仅当我一次运行整个套件(175个测试)时才会发生OutofMemory,并且如果我分别运行每个测试集也不会发生此问题。
  2. 我尝试使用System.gc(),该脚本在运行每个方案后都会被调用,但仍然观察到OutOfmemory异常。
  3. 每次我运行时,异常都会在不同的测试脚本上发生,并且在特定功能/测试脚本上不一致。
  4. 应用程序中使用的位图已被压缩,因此不确定是否与图像大小有关。
  5. 以下是最近运行的日志:

    java.lang.Thread.run(Thread.java:818)01-26 14:42:39.770 3476-4264 /?E /看门狗:!@Sync 579 [01-26 14:42:39.778] 01-26 14:42:42.470 3476-3476 /?E / MotionRecognitionService:支持TA〜01-26 14:42:45.180 4265-4317 /?E / ContactsProvider_EventLog:刷新缓冲区到文件cnt:3大小:0Kb持续时间:39ms lastUpdatedAfter:180367ms 01-26 14:42:52.510 3476-3476 /?E / MotionRecognitionService:支持TA〜01-26 14:42:55.320 446-454 /?E / System:终结器抛出未捕获的异常01-26 14:42:56.900 446-454 /?E / System:java.lang.OutOfMemoryError:尝试抛出OutOfMemoryError时抛出了OutOfMemoryError;没有可用的堆栈跟踪01-26 14:42:56.910 446-1088 /?E / CrashReporting:ParseCrashReporting捕获了com.capitalone.mobilebanking.dev.debug的OutOfMemoryError异常。建筑报告。01-26 14:42:56。910 446-18726 /?E / CrashReporting:ParseCrashReporting捕获了com.capitalone.mobilebanking.dev.debug的OutOfMemoryError异常。建筑报告。01-26 14:42:56.910 446-446 /?E / MonitoringInstrumentation:线程[main,5,main]遇到异常。将线程状态转储到输出并固定到峡湾。 java.lang.OutOfMemoryError:无法分配40字节的分配空间,其中包含3960个空闲字节和3KB,直到OOM 158),位于android.app.ActivityThread.main(ActivityThread.java:7224),位于com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:的java.lang.reflect.Method.invoke(本机方法)处): 1230)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)01-26 14:42:56.910 446-18726 /?E / AndroidRuntime:ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1230)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)01-26 14:42:56.910 446-18726 /?E / AndroidRuntime:ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1230)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)01-26 14:42:56.910 …

java android out-of-memory android-espresso

5
推荐指数
1
解决办法
770
查看次数

使用 android espresso 自动深度链接

我想编写浓缩咖啡脚本来测试深度链接,但不知道如何开始。寻找能够帮助我获得更多想法的解决方案,可能是有关如何开始的分步过程。

例如:我正在寻找一种场景,例如您在 Gmail 中获得一个链接,点击该链接应将哪个用户定向到移动应用程序。我如何开始使用浓缩咖啡测试类似的东西?

提前致谢。

android deep-linking android-espresso

5
推荐指数
1
解决办法
5622
查看次数

type _InternalLinkedHashMap<String, dynamic> 不是 List<dynamic> 类型的子类型

我正在尝试使用网络调用实现一个简单的新闻提要应用程序,其中屏幕将在 Listview 中显示最新故事。

使用当前代码,我从 API 得到响应(因为我在日志中看到了整个响应主体),但似乎无法在 UI 中显示数据。我收到此错误:

type _InternalLinkedHashMap<String, dynamic> 不是 List 类型的子类型

这是 JSON 结构

{
    "response": {
        "status": "ok",
        "userTier": "developer",
        "total": 25095,
        "startIndex": 1,
        "pageSize": 10,
        "currentPage": 1,
        "pages": 2510,
        "orderBy": "relevance",
        "results": [
          {
            "id": "australia-news/2018/aug/13/turnbulls-energy-policy-hangs-in-the-balance-as-euthanasia-debate-given-precedence",
            "type": "article",
            "sectionId": "australia-news",
            "sectionName": "Australia news",
            "webPublicationDate": "2018-08-12T18:00:08Z",
            "webTitle": "Energy policy hangs in balance, as Senate debates euthanasia",
            "webUrl": "https://www.theguardian.com/australia-news/2018/aug/13/turnbulls-energy-policy-hangs-in-the-balance-as-euthanasia-debate-given-precedence",
            "apiUrl": "https://content.guardianapis.com/australia-news/2018/aug/13/turnbulls-energy-policy-hangs-in-the-balance-as-euthanasia-debate-given-precedence",
            "isHosted": false,
            "pillarId": "pillar/news",
            "pillarName": "News"
        }, {
            "id": "media/2018/jun/13/the-rev-colin-morris-obituary-letter",
            "type": "article",
            "sectionId": "media",
Run Code Online (Sandbox Code Playgroud)

对于我的理解,我只是想先webTitle …

json flutter

5
推荐指数
1
解决办法
2万
查看次数

Flutter中如何去除图像和文本之间的空格

我想在图像(fb 图标)正下方显示文本(Facebook),没有任何间距。以下是目前的代码:

@override   Widget build(BuildContext context) {
    return Scaffold(
      // prevent pixel overflow when typing
      resizeToAvoidBottomPadding: false,
      body: Container(
        decoration: BoxDecoration(
            image: DecorationImage(
                image: AssetImage(
                  "assets/login_background.png",
                ),
                fit: BoxFit.cover)),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          //  mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: <Widget>[

           Image(
              image: AssetImage("assets/fb_icon.png"),
              width: 180.0,
              height: 250.0,
            ),
            new Text('Facebook.',
                style: TextStyle(
                    fontStyle: FontStyle.italic,
                    color: Colors.white,)),
            _textFields(),
            _signInButton(),
            _socialMediaSignIns(),
            _accountButtons()
          ],
        ),
      ),
    );
   }
 }
Run Code Online (Sandbox Code Playgroud)

目前,我看到这样的情况,想删除图像和文本之间的空格。

在此输入图像描述

flutter flutter-layout

4
推荐指数
1
解决办法
6563
查看次数

底部溢出 620 像素的 RenderFlex

******更新 ********

这是解决滚动问题的更新body,如下面之前发布的,但现在正在获取A RenderFlex overflowed by 620 pixels on the bottom. 我替换body: listViewbody: Column. 我知道这是一个非常常见的问题,根据 logcat,解决方案是将内容包装在Expanded小部件中。就我而言,我想知道在哪里使用“Expanded”小部件来解决问题。


Widget reviewsSection = Container(
        child: FutureBuilder(
            future: _fetchReviews(),
            builder: (context, snapshot) {
              if (snapshot.data != null) {
                return _buildReviewTiles(snapshot.data);
              } else if (snapshot.hasError) {
                return Text('${snapshot.error}',
                    style: TextStyle(color: Colors.black, fontSize: 12.0),
                    textAlign: TextAlign.justify);
              }
              // By default, show a loading spinner
              return new Container(child: new CircularProgressIndicator());
            }));

// Creates a list view based on …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout

3
推荐指数
1
解决办法
7340
查看次数

如何设置图标按钮的背景色?

我想为图标按钮应用背景色,但没有看到它的显式backgroundColor属性。我想实现这一目标:

在此处输入图片说明

目前,我能够做到:

在此处输入图片说明

下面是到目前为止的代码:

@override
  Widget build(BuildContext context) {

return Scaffold(
    resizeToAvoidBottomPadding: false,
    backgroundColor: Color(0xFF13212C),
    appBar: AppBar(
      title: Text('Demo'),
    ),
    drawer: appDrawer(),
    body: new Center(
    child: new Column(
    crossAxisAlignment: CrossAxisAlignment.stretch,
 //     mainAxisAlignment: MainAxisAlignment.spaceEvenly,
    children: <Widget>[
      new Column(
        children: <Widget>[
       //   new Flexible(
    new TextField(
        style: new TextStyle(
        color: Colors.white,
      fontSize: 16.0),
      cursorColor: Colors.green,
      decoration: new InputDecoration(

        suffixIcon: new IconButton(
            icon: new Image.asset('assets/search_icon_ivory.png'),onPressed: null),

      fillColor: Colors.black,
        contentPadding: new EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
        filled: true,
        hintText: 'What Do You Need Help …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout iconbutton

2
推荐指数
8
解决办法
8789
查看次数

如何将图像从Firebase存储显示到小部件中?

我想将保存的图像firebase storage显示profile picture在屏幕上显示的小部件中。目前,我能够download url但不确定如何使用将图像显示到小部件中的URL。这是显示profile picture我要使用Firebase中的图像更新的UI 的代码(即ClipOval小部件内部)

@override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('Edit Profile'),
          actions: <Widget>[
            new Center(child: new Text('SAVE')),
          ],
        ),
        body: new Stack(
          children: <Widget>[
            Positioned(
              width: 410.0,
              top: MediaQuery
                  .of(context)
                  .size
                  .height / 25,
              child: Column(children: <Widget>[
                Container(
                  child: user.profilePhoto == ""
                      ? Image.asset('icons/default_profile_icon.png',
                      height: 110.0)
                      : ClipOval(
                    child: _imageFile == null ? Image.asset('icons/default_profile_icon.png', height: 110.0,)
                    :Image.file(_imageFile,fit: BoxFit.cover,
                    width: 110.0,
                    height: 110.0,)
                  ), …
Run Code Online (Sandbox Code Playgroud)

firebase flutter firebase-storage

2
推荐指数
1
解决办法
1212
查看次数