Author Archives: Robins

How to Solve Echarts Error: import echarts from ‘echarts‘

The following commands are required for normal angular installation of echarts

1 npm install echarts -S
2 npm install ngx-echarts -S

However, an error prompt is found after installation, and the type is marked in red in the file reference

1. The following commands need to be executed

1 npm install echarts -S
2 npm install ngx-echarts -S
3 npm install @types/echarts -D

2. Introduce modules into modules (such as app.Module.TS):

1 import { NgxEchartsModule } from 'ngx-echarts';
2 @NgModule({
3   imports: [
4     ...,
5     NgxEchartsModule
6   ],
7 })
8 export class AppModule { }

[Solved] ImportError:lib***.so–cannot open shared object file: No such…(pycharm/clion Error but shell No Error)

Problem Description: after the compilation is successful (there is an executable file in the folder), an error is reported when running (Ubuntu) clip, and the error cannot be found So shared library (but shell can execute normally) solution (similar error reporting in pycharm)

/home/luoxinhao/Desktop/mywork/bin/Infantry: error while loading shared libraries: libopencv_features2d.so.4.5: cannot open shared object file: No such file or directory

Reason: the execution of clion may be different from the environment variables of our shell. The following is the solution

Method 1: each time you start the clion, use the terminal to enter the folder where the clion is located and input/clion.SH, it can be executed normally. (feasible but troublesome)

Method 2: soft link method (both shell error reporting and idle error reporting are feasible, but many libraries may need to be linked, one by one)

My clion was successfully modified in this way, but pycharm gave up seven or eight links without completing the chain

1.1 find files

find  / -name  lib**. So (missing DLL)

1.2 establishing soft links

ln -s  /path/to/lib**. so   /usr/lib

1.3 sudo ldconfig

Method 3: modify LD_LIBRARY_Path (for me, it can only solve the shell error, and the modified idle still reports an error)

sudo gedit ~/. bashrc

export LD_LIBRARY_PATH=/where/you/install/lib:$LD_LIBRARY_PATH

sudo source ~/.bashrc

Method 4: modify/etc/LD so.Conf (ibid.)

vim  /etc/ld.so.conf

add  /where/you/install/lib

sudo ldconfig

Method 5: add it to the environment variable (available, used to solve the error reported by idle, which may need to be used in conjunction with method 3, without separate attempt)

First, open pycharm and modify the environment variable of the running configuration in the upper right corner

If you already have an environment variable, type a semicolon after it and paste it.

Paste content is similar to method 3

For example, method 3 is as follows

export LD_LIBRARY_PATH="/opt/intel/openvino_2021.4.689/opencv/lib:$LD_LIBRARY_PATH"

Then add after the semicolon

LD_LIBRARY_PATH=/opt/intel/openvino_2021.4.689/opencv/lib

[Solved] Kibana Error: Kibana server is not ready yet

Background


Visit kinaba in the web page http://localhost:5601 , always prompt “kibana server is not ready yet”.

Execute the following command to view kibana logs,

docker logs kibana

Tips found:

Text


It is suspected that the internal IP of each container changes after the container is restarted.

1. Therefore, execute the following command to check the internal IP of elasticsearch container and find that it is kibana The ES container IP in yaml configuration file is inconsistent with the actual es container IP.

docker inspect --format '{{ .NetworkSettings.IPAddress }}'  es container ID

// Check the id of es container
docker ps

2. Enter kibana container and update kibana.Yaml configuration file. Execute the following command to enter and edit kibana.yaml,

docker exec -it kibana container id /bin/bash
cd config
vi kibana.yml

Replace the IP address of the selected part in the figure below with the actual es container IP address, save and exit kibana.

3. Stop kibana service, delete kibana container and restart kibana.

// 3.1 Stop the kibana service
docker stop kibana container id

// 3.2 Delete the kibana container. (Not delete the kibana image! Not delete the kibana image! Not delete the kibana image!)
docker rm -f kibana container id

// 3.3 Enable running kibana
docker run --name kibana -e ELASTICSEARCH_HOST=http://es_contaner_ip:9200 -p 5601:5601 -d kibana:7.7.0


// Note: The command 'kibana:' in 3.3 above is followed by the kibana version number. To be on the safe side, it is recommended that the version of elasticsearch and kibana remain the same.

4. Browser revisit http://localhost:5601, refresh a few more times to access kibana normally.

[Solved] Tomcat configurate HTTPS error: java.net.SocketException: Permission denied

Tomcat configuration HTTPS error Java net. SocketException: Permission denied

1. Error message

Today, when configuring HTTPS certificate for tomcat, an error was reported when starting Tomcat:

25-Jan-2022 22:01:59.398 SEVERE [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[HTTP/1.1-443]]
        org.apache.catalina.LifecycleException: Protocol handler initialization failed
                at org.apache.catalina.connector.Connector.initInternal(Connector.java:1060)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.startup.Catalina.load(Catalina.java:639)
                at org.apache.catalina.startup.Catalina.load(Catalina.java:662)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
        Caused by: java.net.SocketException: Permission denied
                at sun.nio.ch.Net.bind0(Native Method)
                at sun.nio.ch.Net.bind(Net.java:438)
                at sun.nio.ch.Net.bind(Net.java:430)
                at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225)
                at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
                at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:221)
                at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1118)
                at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:223)
                at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:587)
                at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
                at org.apache.catalina.connector.Connector.initInternal(Connector.java:1058)
                ... 13 more

The reason for the error is: java.net.Socketexception: permission denied , which is obviously a network permission problem. The reason for this problem is that the Linux operating system does not allow non root users to use ports less than 1024.

2. Solutions

1. Use the root account to start Tomcat
2. Change the port number to a port number greater than 1024, but add the port number to the URL request
3. Change the port number to a port number greater than 1024, and use iptables to forward port 443 to the configured port. The command is as follows:

#Execute the commands under the root
# Mapping port 443 to 8443
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443

[Solved] Android Kotlin Package release Error: Lint found fatal errors while assembling a release target.

preface

Recently, I wrote in kotlin that I was playing
and reported an exception in the packaged version of release

Lint found fatal errors while assembling a release target.
unable to read PNG signature: file does not start with PNG signature.

Solution:

 release {
            //Add
            lintOptions {
                checkReleaseBuilds false
                abortOnError false
            }
          }  


Outcome:
1.
2.

[Solved] Groovy Project Compile Error: java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream

1. Error Messages:

Clearing build system data...
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Cleaning output directories...
Running 'before' tasks
Checking sources
Finished, saving caches...
gradle-resources-test:Groovy_Demo.main: java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Synchronizing output directories...
2022/1/10 11:08 - Build completed with 1 error and 0 warnings in 1 sec, 657 ms

在这里插入图片描述

2. Solution

Right-click the project root directory, select the “Open Module Settings” option,

insert image description here

Delete the main and test options in Modules,

insert image description here

Then select the menu bar “Build / Rebuild Project” option to recompile the project;

insert image description here

The project compiles through ;

insert image description here

[Solved] RK3568-ANDROID11-BOARD_HAVE_DONGLE ERROR (3G/4G)

--- a\device\rockchip\common\BoardConfig.mk
+++ b\device\rockchip\common\BoardConfig.mk
 
 #for 3G/4G modem dongle support
-BOARD_HAVE_DONGLE := false
+BOARD_HAVE_DONGLE := true

Compile Error:

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
TARGET_PRODUCT=rk3568_r
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a55
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-2a
TARGET_2ND_CPU_VARIANT=cortex-a55
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-91-generic-x86_64-Ubuntu-18.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RQ3A.210705.001
OUT_DIR=out
============================================
[ 30% 283/935] target  C++: usb_dongle <= external/usb_modeswitch/usb_dongle/Misc.cpp
FAILED: out/target/product/rk3568_r/obj/EXECUTABLES/usb_dongle_intermediates/Misc.o
/bin/bash -c "(prebuilts/clang/host/linux-x86/clang-r383902b1/bin/clang-tidy -warnings-as-errors=clang-analyzer-security*,cert-* -quiet -extra-arg-before=-fno-caret-diagnostics -extra-arg-before=-D__clang_analyzer__ -extra-arg-before=-Xclang -extra-arg-before=-analyzer-config -extra-arg-before=-Xclang -extra-arg-before=c++-temp-dtor-inlining=false -checks=-*,clang-diagnostic-unused-command-line-argument,google*,-google-build-using-namespace,-google-default-arguments,-google-explicit-constructor,-google-readability*,-google-runtime-int,-google-runtime-references,-*,clang-analyzer-security*,cert-*,-cert-err34-c,-cert-err58-cpp,-cert-env33-c external/usb_modeswitch/usb_dongle/Misc.cpp -- -I external/usb_modeswitch/usb_dongle -I out/target/product/rk3568_r/obj/EXECUTABLES/usb_dongle_intermediates -I out/target/product/rk3568_r/gen/EXECUTABLES/usb_dongle_intermediates  -Isystem/core/libsysutils/include -Isystem/core/libsysutils/include -Iframeworks/native/libs/binder/include -Isystem/core/base/include -Isystem/core/libcutils/include_vndk -Isystem/core/libutils/include -Isystem/core/libbacktrace/include -Isystem/core/liblog/include_vndk -Isystem/core/libsystem/include -Isystem/core/libprocessgroup/include -Iout/soong/.intermediates/frameworks/native/libs/binder/libbinder/android_vendor.30_arm64_armv8-a_cortex-a55_shared/gen/aidl -Isystem/core/libcutils/include_vndk -Isystem/core/libprocessgroup/include -Isystem/core/libcutils/include -Isystem/core/liblog/include_vndk -Iexternal/selinux/libselinux/include -Isystem/core/libutils/include -Isystem/core/libbacktrace/include -Isystem/core/liblog/include_vndk -Isystem/core/libsystem/include -Isystem/core/libcutils/include_vndk -Isystem/core/libprocessgroup/include -Isystem/core/base/include -Iexternal/fmtlib/include -Isystem/libhwbinder/include -Isystem/libhwbinder/include -Iexternal/libcxx/include -Iexternal/libcxxabi/include -isystem out/soong/.intermediates/bionic/libc/libc.llndk/android_vendor.30_arm64_armv8-a_cortex-a55_shared/gen/include -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm64   -Iexternal/libcxxabi/include    -isystem out/target/product/rk3568_r/obj/include -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -Werror=date-time -Werror=pragma-pack -Werror=pragma-pack-suspicious-include -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -Werror=int-conversion -fexperimental-new-pass-manager -Wno-reserved-id-macro -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -Wno-c99-designator -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a55 -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -Wimplicit-fallthrough -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -Werror -Wall -Wno-missing-field-initializers -Wno-unused-variable -Wno-unused-parameter -Werror=format -DUSE_USB_MODE_SWITCH -D__ANDROID_VNDK__ -fPIE -Wno-enum-compare -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-null-dereference -Wno-pointer-compare -Wno-xor-used-as-pow -Wno-final-dtor-non-final-class -target aarch64-linux-android30   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=fortify-source -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-int-in-bool-context -Wno-sizeof-array-div -Wno-tautological-overlap-compare -Wno-deprecated-copy -Wno-range-loop-construct -Wno-misleading-indentation -Wno-zero-as-null-pointer-constant -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-string-compare -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-pessimizing-move ) && (PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-r383902b1/bin/clang++ -I external/usb_modeswitch/usb_dongle -I out/target/product/rk3568_r/obj/EXECUTABLES/usb_dongle_intermediates -I out/target/product/rk3568_r/gen/EXECUTABLES/usb_dongle_intermediates  -Isystem/core/libsysutils/include -Isystem/core/libsysutils/include -Iframeworks/native/libs/binder/include -Isystem/core/base/include -Isystem/core/libcutils/include_vndk -Isystem/core/libutils/include -Isystem/core/libbacktrace/include -Isystem/core/liblog/include_vndk -Isystem/core/libsystem/include -Isystem/core/libprocessgroup/include -Iout/soong/.intermediates/frameworks/native/libs/binder/libbinder/android_vendor.30_arm64_armv8-a_cortex-a55_shared/gen/aidl -Isystem/core/libcutils/include_vndk -Isystem/core/libprocessgroup/include -Isystem/core/libcutils/include -Isystem/core/liblog/include_vndk -Iexternal/selinux/libselinux/include -Isystem/core/libutils/include -Isystem/core/libbacktrace/include -Isystem/core/liblog/include_vndk -Isystem/core/libsystem/include -Isystem/core/libcutils/include_vndk -Isystem/core/libprocessgroup/include -Isystem/core/base/include -Iexternal/fmtlib/include -Isystem/libhwbinder/include -Isystem/libhwbinder/include -Iexternal/libcxx/include -Iexternal/libcxxabi/include -isystem out/soong/.intermediates/bionic/libc/libc.llndk/android_vendor.30_arm64_armv8-a_cortex-a55_shared/gen/include -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm64   -Iexternal/libcxxabi/include    -isystem out/target/product/rk3568_r/obj/include -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -Werror=date-time -Werror=pragma-pack -Werror=pragma-pack-suspicious-include -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -Werror=int-conversion -fexperimental-new-pass-manager -Wno-reserved-id-macro -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -Wno-c99-designator -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a55 -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -Wimplicit-fallthrough -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -Werror -Wall -Wno-missing-field-initializers -Wno-unused-variable -Wno-unused-parameter -Werror=format -DUSE_USB_MODE_SWITCH -D__ANDROID_VNDK__ -fPIE -Wno-enum-compare -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-null-dereference -Wno-pointer-compare -Wno-xor-used-as-pow -Wno-final-dtor-non-final-class -target aarch64-linux-android30   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=fortify-source -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-int-in-bool-context -Wno-sizeof-array-div -Wno-tautological-overlap-compare -Wno-deprecated-copy -Wno-range-loop-construct -Wno-misleading-indentation -Wno-zero-as-null-pointer-constant -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-string-compare -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-pessimizing-move  -MD -MF out/target/product/rk3568_r/obj/EXECUTABLES/usb_dongle_intermediates/Misc.d -o out/target/product/rk3568_r/obj/EXECUTABLES/usb_dongle_intermediates/Misc.o external/usb_modeswitch/usb_dongle/Misc.cpp )"
error: declaration uses identifier '_FORTIFY_SOURCE', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
error: declaration uses identifier '_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__ANDROID_VNDK__', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__clang_analyzer__', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__compiler_offsetof', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '_FORTIFY_SOURCE', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
error: declaration uses identifier '_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__ANDROID_VNDK__', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__clang_analyzer__', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__compiler_offsetof', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
 
..............
 
 
error: declaration uses identifier '_FORTIFY_SOURCE', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
error: declaration uses identifier '_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__ANDROID_VNDK__', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__clang_analyzer__', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__compiler_offsetof', which is a reserved identifier [cert-dcl37-c,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '_FORTIFY_SOURCE', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
error: declaration uses identifier '_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__ANDROID_VNDK__', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__clang_analyzer__', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
error: declaration uses identifier '__compiler_offsetof', which is a reserved identifier [cert-dcl51-cpp,-warnings-as-errors]
note: this fix will not be applied because it overlaps with another fix
15:58:06 ninja failed with: exit status 1
 
#### failed to build some targets (01:38 (mm:ss)) ####

Solution:

Modify \external\usb_modeswitch\usb_dongle\Android.mk

LOCAL_PATH:= $(call my-dir)
 
common_src_files := \
	NetlinkManager.cpp \
	NetlinkHandler.cpp \
	MiscManager.cpp \
	Misc.cpp \
	G3Dev.cpp
 
common_shared_libraries := \
	libsysutils \
	libbinder \
	libcutils \
	liblog \
	libselinux \
	libutils \
	libbase \
	libhwbinder
 
common_cflags := -Werror -Wall -Wno-missing-field-initializers -Wno-unused-variable -Wno-unused-parameter
 
- common_local_tidy_flags := -warnings-as-errors=clang-analyzer-security*,cert-*
+ #common_local_tidy_flags := -warnings-as-errors=clang-analyzer-security*,cert-*
 
common_local_tidy_checks := -*,clang-analyzer-security*,cert-*,-cert-err34-c,-cert-err58-cpp
common_local_tidy_checks += ,-cert-env33-c
 
include $(CLEAR_VARS)
 
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := usb_dongle
LOCAL_PROPRIETARY_MODULE := true
LOCAL_CLANG := true
LOCAL_TIDY := true
LOCAL_TIDY_FLAGS := $(common_local_tidy_flags)
LOCAL_TIDY_CHECKS := $(common_local_tidy_checks)
LOCAL_SRC_FILES := \
	main.cpp \
	$(common_src_files)
 
LOCAL_INIT_RC := usb_dongle.rc
 
LOCAL_CFLAGS := $(common_cflags)
LOCAL_CFLAGS += -Werror=format
LOCAL_CFLAGS += -DUSE_USB_MODE_SWITCH
 
LOCAL_SHARED_LIBRARIES := $(common_shared_libraries)
 
include $(BUILD_EXECUTABLE)

Comment out common_local_tidy_flags. It will be OK!

[Solved] Android Error: E/EGL_adreno: tid 3927: eglSurfaceAttrib(1334): error 0x3009 (EGL_BAD_MATCH)

1. Error Messages:

E/EGL_adreno: tid 3927: eglSurfaceAttrib(1334): error 0x3009 (EGL_BAD_MATCH)

java.lang.OutOfMemoryError: Failed to allocate a 146313228 byte allocation with 16777216 free bytes and 115MB until OOM

在这里插入图片描述

 

2. Reason

Description: The memory of our Android project is overflowing, my guess is that the reason may be the difference in resolution leading to memory overflow of the project content or too much content to load (images and other resources)
Especially controls that load a lot of data in a list have custom images.

 

3. Solution

Original Codes

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyFourth"
        >
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service android:name=".service.MusicService"/>
    </application>

Add the following codes after <application:

android:largeHeap="true"
android:hardwareAccelerated="false"

Full Modified Codes

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyFourth"
        
        android:largeHeap="true"
        android:hardwareAccelerated="false"

        >
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service android:name=".service.MusicService"/>
    </application>
android:hardwareAccelerated="true"

An application that uses largeHeap will request the system to allocate more memory space for the Dalvik virtual machine. It is also easy to use, just add android:largeHeap=”true” to the application node of the manifest file.

android:hardwareAccelerated="false" 

The default is true which will start hardware acceleration but will, however, take up memory

How to Fix flink OutputTag Error

report errors

Exception in thread "main" org.apache.flink.api.common.functions.InvalidTypesException: Could not determine TypeInformation for the OutputTag type. The most common reason is forgetting to make the OutputTag an anonymous inner class. It is also not possible to use generic type variables with OutputTags, such as 'Tuple2<A, B>'.
Caused by: org.apache.flink.api.common.functions.InvalidTypesException: The types of the interface org.apache.flink.util.OutputTag could not be inferred. Support for synthetic interfaces, lambdas, and generic or raw types is limited at this point

Solution:

Generally, curly braces are omitted:

OutputTag<ApacheLogEvent> lateTag = new OutputTag<ApacheLogEvent>("late-tag");

Replace with:

OutputTag<ApacheLogEvent> lateTag = new OutputTag<ApacheLogEvent>("late-tag"){};

Places that are easy to ignore.