Tag Archives: app

How to Solve Tabbarview error in Column 2021

reason

The tabbarviewcomponent occupies as much space as the parent component. Generally, the outer layer of this layout is scrollable, similar to singlechildscrollview, but there is no clear height constraint in the column, that is, infinite height, so an error is reported.

Solution:

1. Fixed height

It directly solves the problem locally, but there is a big disadvantage. The components loaded by tabbarview may have different heights, so the predetermined height should be their maximum height, and the layout is not good-looking.

SingleChildScrollView(
  child: Column(
    children: [
      MyTabBar(),
     SizedBox(
     	height: 500,
    	child: TabBarView(
    		children:[
  				MyTabView1(),
  				MyTabView2(),
    		],
    	),
     ),
    ],
  ),
)

2. Do not use the tabbarview component

It is recommended to use the indexedstack component instead. The disadvantage is that it lacks the sliding animation of the original tabbarview component, but it can be customized with the animatedswitcher component. Click to learn more

SingleChildScrollView(
  child: Column(
    children: [
      MyTabBar(),
      IndexedStack(
      	index: currentIndex, //currentIndex is the value of my example, in reality it may come from TabController, or Provider, etc.
      	children:[
      		MyTabView1(),
  			MyTabView2(),
      	],
      ),
     ),
    ],
  ),
)

3. To be continued

[app] install and compile libimobililedevice, How to solve the error

Problem Description:

Error: Failure while executing; `tar --extract --no-same-owner --file /Users/xmly/Library/Caches/Homebrew/downloads/58f1d108442b2cdceb8e86e7d05328381fd0a85b67ae46a66fa710f8f1786b02--libtasn1-4.16.0_1.big_sur.bottle.tar.gz --directory /private/tmp/d20210629-40261-ibafl5` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/xmly/Library/Caches/Homebrew/downloads/58f1d108442b2cdceb8e86e7d05328381fd0a85b67ae46a66fa710f8f1786b02--libtasn1-4.16.0_1.big_sur.bottle.tar.gz'

Cause of the problem:

Maybe some of the dependent libraries were not downloaded
later, after the installation environment was prepared, they succeeded


* brew install build-essential automake autoconf git cmake pkg-config libtool

install

* Method 1:
	git clone https://github.com/libimobiledevice/libimobiledevice.git
	cd libimobiledevice
	./autogen.sh
	make
	sudo make install

* Method 2:
	brew install --HADE libmobliedevice
	# If you do not add - HADE installation is an older version, does not support IOS 10 or above

Flash back problem when Android studio plays music in sdcard through intent

Code

Add a button in the layout file, set listening events for button in the main class, and play music through intent

1. Write activity_ main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    
    <Button
        android:id="@+id/btn_click"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:gravity="center"
        android:padding="8dp"
        android:text="@string/click4" />

</LinearLayout>

2. Import music into virtual machine

There is a device file explorer in the lower right corner of Android studio. After opening, you can see the file directory of the virtual machine. Find/MNT/sdcard/music, right-click upload and select the music to be imported. The file name should not appear in Chinese

3. Write mainactivity.class

package com.ch5_2;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

import java.io.File;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        findViewById(R.id.btn_click4).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setAction(Intent.ACTION_VIEW);
                //Get the file path, the path is the virtual machine memory card path
                Uri data = Uri.fromFile(new File("/mnt/sdcard/Music/nogoodbye.mp3"));
                intent.setDataAndType(data,"audio/*");
                startActivity(intent);
            }
        });
    }
}

Questions

1. Flashback

Here, the version of the virtual machine will affect the operation. If the version is too high, it will flash back. I used to use Android 11.0, but as soon as I click button, it will flash back. The reason should be the compatibility problem. Change to a lower version

here is Android 5.0

2. This file type problem is not supported

When changing to a lower version of the virtual machine, you may encounter the problem that Android music playing software does not support this type of file. I used MP3 file at the beginning, and the result shows that it does not support it. It’s OK to change to WAV format.

Wechat applet animate animation does not implement animation effect for the first time

The main problem is that your.wxss file does not set the appropriate properties; For example, if use Animation. Left (number | string value) element to the left, the Animation is a specific execution of Animation from the time of the elements of the left value to the left you new set value; So if you don’t have an attribute in your original element style you’re not going to get the initial value, you’re not going to be able to animate it, so you’re going to do a left assignment and you’re not going to animate it.

Common errors and solutions of Qt development application under Ubuntu

Error: HelloWorld directly report error… :-1: error: cannot find -lGL
Reason: Lack of GL library
Sudo apt-get install libgl1-mesa-dev

I downloaded the latest version of QT-everywhere5.3.1, after porting it to the board directly created a Qt Quick program to run on the board, prompted the following error, can not find the solution online, ask how to solve this problem, thank you.
# ./qmlpng
QEglFSImx6Hooks will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.
If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1
QQmlApplicationEngine failed to load component
qrc:///main.qml:1 module “QtQuick” is not installed
qrc:///main.qml:2 module “QtQuick.Controls” is not installed
qrc:///main.qml:1 module “QtQuick” is not installed
qrc:///main.qml:2 module “QtQuick.Controls” is not installed

Qrc :// main. QML :1 module “QtQuick” is not installed. $QTDIR/ QML will be installed in a folder if you install it.

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
Failed to create OpenGL context for format QsurfaceFormat (version 2.0, options QFlags(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaB

Or try export QML_IMPORT_PATH=$QTDIR/ QML. It is not clear what it is, it may be different from project to project.

Export QML2_IMPORT_PATH=$QTDIR/ QML =$QTDIR/ QML
If this is not desired, you can override this via:
QEglFSImx6Hooks will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.
If this is not desired, you can override this via: Export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1
=1
=1
=1
=1
=1
=1
=1
=1
=1
=1
=1

The original address: http://www.qtcn.org/bbs/read-htm-tid-56902.html

The solution of Android package error

Before, when I was working on the company’s APP, the functions had been fully realized and it could also run normally on the mobile phone, but it kept reporting errors when packaging

\build\intermediates\res\ resources-anzhi-debug-ap_ ‘specified for property ‘resourceFile’ does not exist, so I found a lot of information on the web.
Some say that the version of SDK is lower than the version of ADT. It is suggested to upgrade the SDK version. Some say that an option of the Android Studio setting is removed.
Finally on the net or found a solution to the code, now record.
In fact, we only need to modify the build.gradle code

BuildTypes {
release {
does not display the LOG/* * * */confused
/* * * */

/minifyEnabled false Zipalign optimization * * * */
zipAlignEnabled true
Remove useless resource files/* * * */
shrinkResources true
proguardFiles getDefaultProguardFile (‘ proguard – android. TXT), ‘proguard – rules. Pro’
}
The debug {

minifyEnabled false shrinkResources false
proguardFiles getDefaultProguardFile (‘ proguard – android. TXT), ‘proguard – rules. Pro’

}}

ShrinkResources = false Release ShrinkResources = false Interested can go to the Internet to check the reason.

The Android packaging problem is solved.

It’s as simple as that.

Using Fiddler to capture mobile app

Use Fiddler to capture mobile APP package detailed tutorial
There were two very difficult problems in the process of grasping the package in the mobile APP with Fiddler. One was that the phone could not connect To the network after setting the proxy, and the download certificate on the phone always indicated that the download failed. The other was that the information of grasping the package on the Fiddler was all displayed as Tunnel To. It took a long time to solve, and now share it to let some novices walk less detours, maybe my method can solve your problem, may not solve it, but also provide a way to try.
To set the fiddler
1. Download Fiddler from the website and install it. https://www.telerik.com/download/fiddler
2. First configure Fiddler, open Fiddler, and then click Tools –>; The Options… – & gt; HTTPS, check and install the certificate as shown in the installation diagram.


3 4.

3 4.

3 4 Click the OK button to close Fiddler and reopen it again. At this point, the Fiddler part is set up in the normal way, followed by some Settings on the phone.
5. Here I use millet portable WiFi, mobile phone connected to millet portable WiFi, so that the phone and computer connected is the same network segment.
Set the cell phone
6. Go to the WiFi Settings page on the mobile phone, change the agent to “Manual”, and the hostname is the IP address

after the computer is connected to the WiFi network. Open the mobile browser, enter the address open http://ipv4.fiddler:8866, (because I set the port number is 8866), click in the page FiddlerRoot certificate, certificate of download. I have encountered a problem here, is the certificate can not download, keep telling download failed. Up to now, I have encountered two problems that are difficult to solve. One is that the download certificate in the webpage fails to download; the second is that after opening the APP on the mobile phone, all the packages caught in Fiddler are displayed as Tunnelto. Now, how do I solve these two problems
Solution to the problem:
1. Download Cermaker from the Fiddler website, download it and run the plug-in.
download address: https://www.telerik.com/fiddler/add-ons

2. After the installation, we found that the TunnelTo problem was still not solved, and there is a new problem. On the mobile phone, open http://ipv4.fiddler:8866, instead, it shows No Root Certificate was found.Have you enabled HTTPS traffic decryption in fiddler yet?
3. So I tried the following solutions.
makecert.exe-r-ss my-n “CN= do_not_trust_fiddlerRoot, O=DO_NOT_TRUST, OU=Created by http://www.fiddler2.com “-Sky Signature -EKU 1.3.6.1.5.5.7.3.1-h 1-cy Authority -a sha1-m 120-b 09/05/2012
If you want to run the fiddler, you can restart the fiddler
4. Then open http://ipv4.fiddler:8866 in the browser on the phone, download the certificate, download and install it successfully, open the test APP, and find that the packet was captured successfully. HTTPS can catch the packet normally, but HTTP still shows Tunnel to, but it does not affect the use.

Error:Execution failed for task ‘:app:processDebugGoogleServices’. > Please fix the version conflict

After integrating Google login and Google map, run the project, report

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

Look at the project. The build

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.novoda:bintray-release:0.3.4'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

Moreover is app. The build

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
     //google map
    compile 'com.google.android.gms:play-services-maps:9.8.0'
    compile 'com.google.android.gms:play-services-location:9.8.0'
    //google login
    compile 'com.google.android.gms:play-services-auth:9.8.0'
    }

According to the latest version of the document, if 9.8.0 is changed to 9.0.0, then the map’s mmapView.onstop (), mmapView.onstart (); The method is not integrated, nor is it possible to change Google-Services :3.0.0 to document query 3.1.1.
The final solution will be

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

Instead of

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'

Can be

Invalid keystore format

When signing the app, the keyStore changes, causing all the projects to fail to run

find debug.keystore and delete
path User\ User name \android\debug.keystore
after deletion re-run the project, it will automatically generate a file.

Error:Execution failed for task ‘:app:preDexDebug’. > com.android.ide.common.process.ProcessExceptio

error :

Error:Execution failed for task ‘:app:preDexDebug’.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.7.0_67\bin\java.exe’ finished with non-zero exit value 1

reason: the configuration in gradle

compileSdkVersion 23
buildToolsVersion ‘24.0.0 rc3’

compileSdkVersion and buildToolsVersion are inconsistent

changes compileSdkVersion as well as buildToolsVersion

compileSdkVersion 23
buildToolsVersion ‘23.0.0’

and then just compile it once.