Tag Archives: Error Record

[Solved] Phone Debug Program Error: The application could not be installed: INSTALL_FAILED_TEST_ONLY

1. Error message

17:18	Gradle build finished in 2 s 904 ms

17:18	Failed to commit install session 1905086282 with command cmd package install-commit 1905086282. Error: INSTALL_FAILED_TEST_ONLY

17:18	Error
		Installation did not succeed.
		The application could not be installed: INSTALL_FAILED_TEST_ONLY
		Retry

17:18	Session 'app': Installation did not succeed.
		The application could not be installed: INSTALL_FAILED_TEST_ONLY
		Retry

 

2. Solution

1. Problem analysis

 

When you click to run the debugging program, it will be automatically generated in the application tab of the manifest file

android:testOnly="true"

Some mobile phones do not support the installation of such applications;

 

2. Solution 1

Under menu bar/build:

  • Debug apps compiled with Build APK(s) can run;
  • The debug version of the application compiled with Make Project can be run;
  • Released apps packaged with Generate Signed APK signatures will also work;

 

3. Solution 2

Configure in gradle.properties

android.injected.testOnly=false

[Solved] Android Studio Compile Error: Could not determine java version from ‘11.0.8‘.

There are two solutions to solve Error: Could not determine java version from '11.0.8'.

Method 1: downgrade Android Studio and use the historical version of Android Studio environment;

Method 2: upgrade Gradle version;

1. Error reporting information


 

Open an old project and report the following error:

Could not determine java version from '11.0.8'.

The project uses Gradle version which is incompatible with Studio running on Java 10 or newer.
See details at https://github.com/gradle/gradle/issues/8431
Possible solution:
 - Upgrade Gradle wrapper to 4.8.1 version and re-import the project

Select the “menu bar/file/Project Structure” option,

Check that the Android Gradle plug-in version of the Android project is 3.2.0 and the Gradle version is 4.6. This is the version used a few years ago. At present, the project cannot be compiled using the latest Android studio;

 

 

 

 

2. Solution

Select the menu bar/file/project structure option,

In the pop-up project structure dialog box, update the Android gradle plug-in version to 4.2.1 and the gradle plug-in version to 6.7.1;

[Solved] Android Studio Compile Error: Execution failed for task ‘:APP_MIDI:lintVitalRelease‘.

1. Error reporting information

When compiling Android application, the following error is reported:

Execution failed for task ':app:lintVitalRelease'.
> Lint found fatal errors while assembling a release target.

* 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.

 

2. Solution

Method I

lint checks for errors, which are output in the build/reports/lint-results-release-fatal.xml file, and can be changed by changing the error message in the file to modify the syntax error;

Example of error message:

<?xml version="1.0" encoding="UTF-8"?>
<issues format="5" by="lint 4.1.0">

    <issue
        id="NotSibling"
        severity="Fatal"
        message="`@+id/button` is not a sibling in the same `RelativeLayout`"
        category="Correctness"
        priority="6"
        summary="Invalid Constraints"
        explanation="Layout constraints in a given `ConstraintLayout` or `RelativeLayout` should reference other views within the same relative layout (but not itself!)"
        errorLine1="        android:layout_below=&quot;@+id/button&quot;"
        errorLine2="        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="D:\Application\app\src\main\res\layout\activity_main.xml"
            line="836"
            column="9"/>
    </issue>

</issues>

Method II:

Configure in build.gradle to remove lint checks:

android{
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

[Solved] Android Gradle configure error: Location: Class buildconfig

Error message:

D:\002_Project\002_Android_Learn\ClassLoader_Demo\app\build\generated\source\buildConfig\debug\com\example\classloader_demo\BuildConfig.java:15: Error: Symbol not found
  public static final String market = GooglePlay;
                                      ^
  Symbol: Variable GooglePlay
  Location: Class BuildConfig

In the gradle.properties configuration file in the root of the Android Studio project, configure as:

# Configure whether to be on Google Play
isGooglePlay=true
# Configure the current app marketplace
market=GooglePlay

The corresponding configuration in build.gradle is as follows :

android {

    defaultConfig {
        // Whether the app is available on Google Play
        buildConfigField("boolean", "isGooglePlay", isGooglePlay)
        // The current app marketplace
        buildConfigField("String", "market", market)
    }
}

The generated BuildConfig.java configuration is as follows :

/**
 * Automatically generated file. DO NOT MODIFY
 */
package com.example.classloader_demo;

public final class BuildConfig {
  public static final boolean DEBUG = Boolean.parseBoolean("true");
  public static final String APPLICATION_ID = "com.example.classloader_demo";
  public static final String BUILD_TYPE = "debug";
  public static final int VERSION_CODE = 1;
  public static final String VERSION_NAME = "1.0";
  // Field from default config.
  public static final boolean isGooglePlay = true;
  // Field from default config.
  public static final String market = GooglePlay;
}

The last googleplay string has no double quotation marks, resulting in an error;

 

2. Solution

use

buildConfigField("String", "market", "\"${market}\"")

Groovy code , you can generate the following configuration in BuildConfig.java :

public static final String market = "GooglePlay";

The double quotes in the string need to be added with their own escape characters, otherwise they are invalid;

The first level of double quotes in “\”${market}\”” is because the buildConfigField function requires three string variables to be passed in, and the third parameter must be a string;

The second double-quote \” \”” uses the transfer character, which is the double-quote displayed in BuildConfig, and the internal ${market} is the GooglePlay configuration content ;

[Solved] LaTex Error: Critical Package ctex Error: CTeX fontset `fandol‘ is unavailable in current(ctex) mode. }

Problem description

I use the downloaded latex template to run, and the following error messages appear

resolvent

Switch the default compilation method, because Chinese appears in in the content

1. Click Options–>Configure TeXstudio...

2. Click build ->Default Compiler

Switch to xelatex


OK, solve the problem

Error reported when Windows builds docker image: failed to create LLB definition: 403 Forbidden

preface

Use the docker build command to build a mirror: “failed to solve with frontend dockerfile. V0: failed to create LLB definition: unexpected status code [manifests 18.04]: 403 Forbidden”. The specific screenshot of the error is as follows:

resolvent

It happens during the build process. It is an error in the buildkit, considering that the buildkit is still unstable. If you use the docker desktop on MAC/windows, you may also have to disable it in the “docker engine” JSON configuration
docker desktop – & gt; Settings – & gt; Docker engine – & gt; “Features”: {buildkit: true} will “features”: {buildkit: false}

Note that this is not a fix, it is a solution until someone in the docker team implements the correct fix. Please try again when the buildkit is more stable

Reference articles

github issues

PyCharm Error: RuntimeError: CUDA out of memory [How to Solve]

Error:
RuntimeError: CUDA out of memory.Tried to allocate 48.00 MiB (GPU 0; 2.00 GiB total capacity; 1001.96 MiB already allocated; 36.14 MiB free; 1.12 GiB reserved in total by PyTorch)

Solution:

C:\Users\hp>nvidia-smi
'nvidia-smi' is not an internal or external command, nor a runnable program
or batch file.

C:\Users\hp>cd C:\Program Files\NVIDIA Corporation\NVSMI

C:\Program Files\NVIDIA Corporation\NVSMI>nvidia-smi
Sun Oct 24 19:31:25 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 462.80       Driver Version: 462.80       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050   WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   42C    P8    N/A/ N/A |     70MiB/ 2048MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      4248    C+G   ...bbwe\Microsoft.Photos.exe    N/A      |
+-----------------------------------------------------------------------------+

C:\Program Files\NVIDIA Corporation\NVSMI>taskkill -PID 4248 -F
成功: 已终止 PID 为 4248 的进程。

C:\Program Files\NVIDIA Corporation\NVSMI>nvidia-smi
Sun Oct 24 19:38:39 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 462.80       Driver Version: 462.80       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050   WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   40C    P8    N/A/ N/A |     70MiB/ 2048MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

C:\Program Files\NVIDIA Corporation\NVSMI>

ERROR Invalid options in vue.config.js: “plugins“ is not allowed

Problem Description:

When importing jQuery, if index. JS is not found, it is directly added to Vue. Config. JS , and the following error occurs

Reason: unknown

resolvent:

Add configurewebpack to the outer layer

const path = require('path')

var webpack = require('webpack')


function resolve(dir) {
    return path.join(__dirname, dir)
}
module.exports = {
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                $: "jquery",
                jQuery: "jquery",
                "windows.jQuery": "jquery"
            })
        ]
    }
}

org.thymeleaf.exceptions.TemplateInputException: Error resolving template [XXX]

Error record:

org.thymeleaf.exceptions.TemplateInputException: Error resolving template [currentUserCartItems]

Background: Spring + thymeleaf reports an error

Reason: no @ respontroller or @ ResponseBody annotation is written on the method of data returned by the controller, and the returned data will be converted to JSON format

note: if it is necessary to return page Jump, it is best to add @ ResponseBody annotation on the specific method of data returned, otherwise other controllers cannot jump to the page normally

[Solved] Android Studio Compile error: Cannot use connection to Gradle distribution . as it has been stopped.

Article catalog

1、 Error message II. Solution

 

 

 

 

1、 Error message


 

Cannot use connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-5.6.4-all.zip' as it has been stopped.

 

 

 

 

2、 Solution


 

Occasional errors disappear after recompilation. This problem is encountered only once, and a record is made here;