Tag Archives: Report an error

Android Studio Error: Some file crunching failed, see logs for details

Error description:
Error:Some file crunching failed, see logs for details
Recently, a lot of readers have asked me why I still report an error after adding in according to my method. So let me add a little bit here.
Note ⚠ ️ : this is a kind of problem! So if you read the error log for Gradle, you can read the error log for Gradle. The specific methods are as follows:
Click the Gradle Console in the lower right corner. View gradle detail log:

Reasons for the problem 1:
The image in the resource file is not a PNG file. (As shown in the error report below)

Cause 2:
No margins are set for figure.9.

 

Log Log 1:
AAPT: libpng error: Not a PNG file
Error: Some file crunching failed, see logs for details
:app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:app:mergeDebugResources’.
> Error: Some file crunching failed, see logs for details

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

BUILD FAILED
Solutions for Reason 1:
In the build.gradle file of the project app, add in the Android TAB:

aaptOptions {
        cruncherEnabled = false
        useNewCruncher = false
}


Solutions for Reason 2:

We looked at the log and found that there is no margin. What is margin?Let’s look at the following two pictures

Boundless space (with no black edges)

There are margins and there are black edges all around.

 

So how do you set it up?Very simple:

Click the white edge around, the position of the click will be black, left or right or drag up and down to make the black edge change, so as to achieve the size of the set margin.

Error may not have more than the above two kinds of log, if you encounter other reasons, welcome everyone harassment!!

LaTeX Error: Can be used only in preamble

LaTeX Error: Can be used only in preamble
translation: Xovee
translation time: June 11, 2020
LaTeX Error: Can be used only in preamble
This error occurs if you introduce a package or class in the body of the text, rather than in the preamble. Before the command \begin{document}, everything is called a prologue. In the prologue, you define the type of document, the language of the document, and many basic Settings. For example, the preface to a general document looks something like this:

\documentclass[12pt, letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\title{First document}
\author{Hubert Farnsworth \thanks{funded by the ShareLaTeX team}}
\date{February 2014}

If you introduce the package in the body (after \begin{document}) instead of in the preface, you will get this error:

To resolve this error, you must ensure that all packages introduce the command \usepackage{… }, and \ documentClass []{… }, before the \begin{document} command. If you want to learn more about LaTeX document structure, please refer to this document.

How to Fix java.net.ConnectException: Connection refused: connect

java.net.ConnectException: Connection refused: connect

1. Error as above.
2. Reasons and Solutions:
 
1) The port number is occupied: kill the process occupying the port number (generally 8080) and release the port; Shut down the Tomcat server completely, or restart the project.
2) Use the following command to check the maximum number of processes allowed on the server: ulimit-u. If this value is set to a lower value, such as 1024, then increase it to 131072 or unrestricted with the following value: ulimit-u 131072 or ulimit-u unrestricted.
 
3) Client and server, either or both of which are not in the network.
They may not be connected to a LAN or the Internet or any other network, in which case Java will be thrown
The client “java.net.ConnectException:Connection refused” exception.

4) server not running
The server is down but not running. In this case, you will also get java.net.ConnectException: connection refused error. Ping to check if the server is running and listening on the port.

5) server running but not listening port, client trying to connect.
The server is running but listening on a different port. Verify the configuration. If you are working on a large project and have a hierarchical configuration file, it may be the default configuration or some other Settings overwrite your correct Settings.
 
6) Host port combination is not allowed to use firewall
Almost every corporate network is protected by a firewall. If you are connecting to other corporate networks, such as in any electronic trading system, you need to improve the firewall
Both parties are required to ensure that they allow each other’s IP address and port number. If the firewall is not allowed to connect, will also receive the same java.net.ConnectException:Java connection refused to abnormal in application.
 
7) Incorrect host port combination.
The host port combination provided is incorrect, or the earlier host port combination on the server side has changed. Check the latest configuration on both the client and server sides.
 
8) The protocol in the connection string is incorrect
TCP is the basis for many advanced protocols, including HTTP, RMI, and so on. Through the connection string, you need to make sure that you pass the correct protocol that the server expects. For example, if the server is exposed, a service that passes through RMI instead of a connection string should start with RMI: //.
 
 
3. My situation:
, my reason is relatively simple, which probably belongs to the 5th, 7th and 8th points above, but the configuration is not correct anyway. I just miswrote the IP address of the server where the database is located.

spring.datasource.url=jdbc:mysql://数据库所在服务器IP:3306/gaei_ms?useUnicode=true&characterEncoding=utf-8&useSSL=false

———————————————————————————————
July 4, 2019:
From the comments:
“The same can happen if all parameters are not added to the comment.”
Join the article, for reference, also very grateful to this friend: ‘Seven.
 
 
 
Reference: https://javarevisited.blogspot.com/2013/02/java-net-ConnectException-Connection-refused.html

Solve the problem that the Raspberry Pi cannot start (dependency failed for Local File Systems)

A mobile hard disk was mounted the day before yesterday, so it could not be started yesterday. The following error is reported:
dependency failed for /mnt/my_hd
dependency failed for Local File Systems

Ideas:
Since /dev/sda1 has not been found at boot time and cannot be loaded to report an error, comment out the contents of the fstab file about /dev/sda1 so that it does not work.
Specific solutions:
1, CTRL + D
2. Enter the password yahboom
3. Type:

nano /etc/fstab

4. Add “#” to the first string on the third line

5. CTRL + X, yes (save the file)
6, CTRL + T
7. Select “FSTAB” and press Enter.
8, CTRL + Alt + DELETE, restart.
9. After entering the system, in the console window:

su
mount /dev/sda1 /mnt/my_hd

Problem solving.

Error in compiling rmarkdown to PDF file` xxx.sty ‘ not found.

as: https://github.com/rstudio/rmarkdown/issues/39

error message

LaTeX Error: File 'framed.sty' not found.
LaTeX Error: File 'titling.sty' not found.

solution

method 1

USES Tex’s TLMGR package to manage the installation of the missing.sty file

tlmgr install framed

method 2

on my system, TLMGR install: package already present: framed but still reported an error, the following method successfully installed

yum install missing file

yum -y install texlive-framed
yum -y install texlive-titling

Assertion failed: Assertion failed on expression: ‘pred(* previous, *i)’

Assertion failed: Assertion failed on expression: ‘pred(* previous, *i)’
UnityEngine.Object:Instantiate(GameObject)
IdleLogic:OnLoadCompleted(Object, Object) (at Assets/BLAZGame/Script/GameScript/Idle/IdleLogic.cs:149)
c__Iterator2:MoveNext() (at Assets/BLAZ/Script/Function/AssetBundleManager/BaseLoader.cs:192)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

is an assertion error that doesn’t affect the project, but it looks pretty ugly.

error timing: when the game is running and one of the game resources is loaded, an error is found.

locates this resource

and then click through the resource hierarchy, the assertion error disappears

Speculation

should be an error in the editor Inspector because the editor was previously developed in the project.

[Keras] ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to

problem description

what happened was, when I was happily building a model with Keras, I found that there was an official function for drawing the model plot_model(), so I happily called the function keras.utils.plot_model(model, 'model.png', show_shapes=True), and the result was the following error:

InvocationException: GraphViz's executables not found
...
ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.

I thought, was it because I didn’t install , pydot and graphviz?So I happily turned on PyCharm and loaded my virtual environment with pydot and graphviz, but it was still reporting an error.

then I shut myself up for a while. After I closed myself up, I went to baidu and Google to find a solution. Sure enough, many people met the same problem as me. According to the big guy [1], this is an environmental problem, the solution is to PIP install graphviz or something, or manually download the graphviz installation package on the official website, and then add the system environment variable Path, such as C:\Program Files (x86)\Graphviz2.38\bin something.

I thought this solution made sense, and I happily tried it out, and still got an error.

and then I shut myself down again and went back to looking for a solution. Some people [2] say that the order of installation is very important. First install pydot, then install graphviz; Someone [3] said to use keras.utils.vis_utils.plot_model instead of keras.utils.plot_model. In short, the feeling is not reliable.

finally, you guessed it, I uninstalled PyCharm and pydot in pydot ( PIP install pydot0) in PyCharm and pydot) in the pydot). Success!

then I thought about what was causing the error for a while, I tried to delete the system variable of graphviz, but the error didn’t occur. Oh, calculate, calculate, just work!

environment

  • Windows 10
  • Python 3.6
  • TensorFlow 2.0 Beta (built-in Keras)

effect

Reference

  1. Rob. (August 25, 2018). Graphviz and Pydotplus not working. Retrieved from https://datascience.stackexchange.com/questions/37428/graphviz-and-pydotplus-not-working
  2. web_ninja. (August 26, 13). Why is pydot unable to find GraphViz’s Executables in Windows 8?Retrieved from https://stackoverflow.com/questions/18438997/why-is-pydot-unable-to-find-graphvizs-executables-in-windows-8
  3. XifengGuo. (November, 6, 2017). pydot issue. Retrieved from https://github.com/XifengGuo/CapsNet-Keras/issues/7

MongoDB Error: Failed to start mongod.service: Unit mongodb.service is masked

Reference:

reference: http://club.verimake.com/topics/36 http://stackoverflow.com/questions/37014186/running-mongodb-on-ubuntu-16-04-lts

on MongoDB: Failed to start mongod. Service: Unit MongoDB. Service is masked, you can follow the following steps:
opens the following file:

sudo vim /etc/systemd/system/mongodb.service

Paste the following into the file and save

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf

[Install]
WantedBy=multi-user.target

execute the following command:

sudo systemctl enable mongod.service
sudo systemctl daemon-reload
sudo service mongod start

Android studio failed to resolve: junit:junit : 4.12 solutions

when importing someone else’s project in Android Studio, the project Failed to resolve: junit:junit:4.12:

solution:

1, direct comment out, this is actually a way to avoid mistakes;

2. Add maven:

to the build.gradle file under E:\android\app (project file directory)

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'http://repo1.maven.org/maven2' }
    }
}

or junit was deleted in file — Project Structure and then added again:

if it still doesn’t work, it’s best to change the version to match the current SDK for good.

gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildPr

骗取犯错!建立错误
gyp ERR!堆栈错误:make failed with exit code: 2
gyp ERR!在ChildProcess堆栈。onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR!在ChildProcess堆栈。emit (events.js:182:13)
gyp ERR!在Process.ChildProcess._handle堆栈。onexit (internal/child_process.js:239:12)
gyp ERR达尔文系统16.7.0
gyp ERR!命令“/ usr /地方/地窖/节点/ 10.9.0/bin /节点”“/ usr /地方/ lib/node_modules/npm node_modules/node-gyp/bin/node-gyp。js ” “重建” gyp ERR!cwd /Users/zhangying/Documents/www/kurento/kurento-client-js/node_modules/utf-8-validate gyp ERR!node-gyp -v v3.8.0
不ok
npm WARN [email protected]需要一个对等的[email protected]~0.4.1,但没有安装。您必须自己安装对等依赖。

npm犯错!代码ELIFECYCLE
npm ERR!ERR!
npm [email protected]安装:node-gyp rebuild
npm ERR!退出状态1
npm ERR!
npm犯错!安装脚本[email protected]失败。
npm犯错!这可能不是npm的问题。上面可能有额外的日志输出

npm犯错!此运行的完整日志可在以下文件中找到:
npm ERR!/用户/ zhangying/.npm/_logs/2018 – 09 – 08 – t03_07_51_380z debug.log

方法一:
npm安装- g bcrypt
方法二:
删除~ /。node-gyp
方法三:
切换到当前项目下即可。

rm射频.node-gyp/

npm install -g node-gyp

rm射频项目/ node_modules

再次,npm安装即可。

Android Studio Error:Some file crunching failed, see logs for details

error description:

Error:Some file crunching failed, see logs for details

recently a lot of readers have asked me why I still get an error after I add it according to my method. So let me add a little bit here.

note ⚠ ️ : this is a question! So if you read the error log for Gradle, you can read the error log for Gradle.

click on the Gradle Console in the lower right corner. View gradle detail log:


problem 1:

images in resource files are not PNG files.


problem 2:

is not given. Figure 9 has margins.




Log Log 1:

AAPT: libpng error: Not a PNG file
Error: Some file crunching failed, see logs for details
:app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:app:mergeDebugResources’.
> Error: Some file crunching failed, see logs for details

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

BUILD FAILED

reason 1 solution:

in the build.gradle file of project app, add:

in the android TAB

aaptOptions {
        cruncherEnabled = false
        useNewCruncher = false
}

reason 2 solution:

We looked at the log and found that there is no margin. What is margin?Let’s look at the following two pictures

Boundless space (with no black edges)


There are margins and there are black edges all around.

so how to set up?

Click on the white edge, the position of the click will be black, left and right or drag up and down to change the black edge, so as to set the size of the margin.

error reasons may not only have the above two kinds of log, if you encounter other reasons, welcome everyone harassment!!