Tag Archives: flutter

Flutter project package IOS error [How to Solve]

Flutter packs IPA and reports an error course not find an option named “track widget creation”.
it should be caused by the different forms of dart language in debug mode and release mode.
in debug mode, flutter supports more dynamic language features such as hot overload, and these features are turned off in release mode

$flutter build ios --release

 

[Solved] flutter:NoSuchMethodError: The method ‘>’ was called on null.

I wrote a list and found that it would not come out, and an error was reported

flutter: Another exception was thrown: RenderBox was not laid out: _RenderScrollSemantics#81b3a relayoutBoundary=up3 NEEDS-PAINT
flutter: Another exception was thrown: ‘package:flutter/src/rendering/shifted_box.dart’: Failed assertion: line 314 pos 12: ‘child.hasSize’: is not true.
flutter: Another exception was thrown: NoSuchMethodError: The method ‘<=’ was called on null.
flutter: Another exception was thrown: NoSuchMethodError: The getter ‘visible’ was called on null.

A search revealed that a Flexible should be added inside the Column or Row to wrap the contents.

https://github.com/flutter/flutter/issues/21628

Column(
    children: <Widget>[
        Flexible(
           child: ListView(
              children: <Widget>[
                 ListTitle(leading:Icon(Icons.code),title:Text('hahaha'))
              ],
           ),
        )
    ],
)

Yes, but I don’t know why

 

About fluent reference image_ Error reported by picker plug-in

Let’s first thank our predecessors for planting trees:

https://juejin.im/post/5d312549f265da1b6f43aebf

https://www.jianshu.com/p/5ef065abfe07

http://www.bubuko.com/infodetail-3079263.html

Use image today_The build of the picker plug-in reported an error. In fact, I didn’t encounter many problems when writing the flutter application before. This time, there are still many problems when writing the integration of the flutter module into the native project. We should consider solving integration problems, hybrid routing stack management, cooperative development and other problems. Of course, there are still some problems on the way, such as the compatibility of android.support.xxx package and Android X in Android history, which involves the migration of the shuttle project to Android X

The error is reported as follows. The reason is that when using the Android x library, other old libraries are inadvertently used indirectly

Add gradle.properties in the. Android directory of the fluent module project, and try build

android.useAndroidX=true
android.enableJetifier=true

An error is reported. The compiled and running versions are different

Modify the flutter module directory. Android/APP/build.gradle and add it in the dependencies attribute. I’m not only different from Android x.versionedsearchable, but also add it

    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support' && !details.requested.name.contains('multidex') ) {
                details.useVersion "27.1.1"
            }else if(details.requested.group == "androidx.versionedparcelable") {
                details.useVersion "1.0.0-rc01"
            }else if(details.requested.group == "androidx.lifecycle") {
                details.useVersion "2.0.0-rc01"
            }else if(details.requested.group == "androidx.core") {
                details.useVersion "1.0.0-rc01"
            }
        }
    }

Error reporting

 

Because the things in the old package can’t be found with Android x, there is a mapping table here https://blog.csdn.net/Comestudy123/article/details/84785440

.android\Flutter\src\main\java\io\flutter\facade\FlutterFragment.java

//import android.support.annotation.NonNull;
//import android.support.v4.app.Fragment;
import androidx.annotation.NonNull;
import androidx.fragment.app.*;

.android\Flutter\src\main\java\io\flutter\facade\Flutter.java

//import android.arch.lifecycle.Lifecycle;
//import android.arch.lifecycle.LifecycleObserver;
//import android.arch.lifecycle.OnLifecycleEvent;
//import android.support.annotation.NonNull;
import androidx.lifecycle.*;
import androidx.annotation.NonNull;

Build starts, but there are still old problems. The Android directory will be deleted at any time, and you need to put the modified configuration file and code into the root directory copy and build. This will be solved later. You should be able to integrate with the fluent application project. Try it later

 

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

curl: (7) Failed to connect to raw.githubusercontent.com Port 443: several solutions to connection reused?

Preface:
recently, with the release of flutter, most companies begin to use it. But if you want to develop, you need to build a flutter development environment first. You can follow the official website for the installation of flutter. Here we are going to talk about homebrew

curl: (7) Failed to connect to raw.githubusercontent.com Port 443: connection reused note that the suffix is connection reused

My guess: the possible reason for the failure of the installation is that the Xcode environment was not initialized. This is for MAC computers. I found a lot of information on the Internet, and it was said that I could open this website https://raw.githubusercontent.com/Homebrew/install/master/install , I can’t open it
so here’s my solution:

    1. solution 1
    1. (1) open the website:

https://www.ipaddress.com/
check out raw.githubusercontent.com corresponding IP address

(2) replace the host file of the system
note: it's better to copy it before changing


this is actually equivalent to the solution to the problem of network failure. If a web address can be opened on your computer, we will ping it at the terminal (DOS system).
for example:

this is the status of connection. Generally, timeout will be displayed if it is not available. You can try to see if your GitHub is connected( The same is true for general telecom companies to check network problems, to see if there is packet loss.)

(3) Then install
/bin/bash - C "$(curl - fssl) https://raw.githubusercontent.com/Homebrew/install/master/install.sh )"
explain: this line/bin/bash – C” $(curl – fssl) https://raw.githubusercontent.com/Homebrew/install/master/install.sh )”The command is actually the command to install homebrew, You can check the official website address by yourself.

2. Solution 2
execute the following command sudo gem install redis
and then execute /usr/bin/Ruby - e "$(curl - fssl) https://raw.githubusercontent.com/Homebrew/install/master/install )

3. Solution 3
I read other people’s brew_ install.rb The document, which is the website that can’t be opened, is the website https://raw.githubusercontent.com/Homebrew/install/master/install , the corresponding content is brew_ install.rb In fact, many people on the Internet have posted this file, and I have also posted one:
link: Baidu cloud download
password: 1ogr

Enter store brew_ install.rb Execute Ruby brew_ install.rb just follow the prompts to install

4. Solution 4
if the above three methods still have some problems in the installation process, you can try this method.

Step 1: go directly to the GitHub address of homebrew [portal], and pay attention to select the version when downloading. Click branch to switch to tags. Generally, this is the release version
Step 2: after downloading and decompressing, right-click visit, select go to folder…, and enter /usr/local Enter. Just find the homebrew folder in it and replace it with the content you downloaded from GitHub

After that, check whether brew is installed on your Mac, and enter brew

on the terminal to indicate that the installation is completed.

Flutter: Android dependency ‘com.android.support:support-v4’ has different version …

Launching lib\main.dart on Nokia X6 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:preDebugBuild'.
&> Android dependency 'com.android.support:support-v4' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s
Finished with error: Gradle task assembleDebug failed with exit code 1

How to Solve:

Add a new line in android/app/build.gradle,dependencies

dependencies {
    //PART TO ADD

    implementation "com.android.support:support-v4:27.1.1" 
}

There is another way online:

subprojects {

    project.evaluationDependsOn(':app')
    //[PART TO ADD START]
    project.configurations.all {

        resolutionStrategy.eachDependency { details -&>

            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "27.1.0"
            }
        }
    }
    //[PART TO ADD END]
    }