Category Archives: Error

[Solved] Spring Cloud Gateway Startup Error: Parameter 0 of method modifyRequestBodyGatewayFilterFactory in…

Error message:

Spring Cloud Gateway startup has been reporting an error with detailed error information

Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type ‘org.springframework.http.codec.ServerCodecConfigurer’ that could not be found.

Action:

Consider defining a bean of type ‘org.springframework.http.codec.ServerCodecConfigurer’ in your configuration.

View the source code:

1、GatewayClassPathWarningAutoConfiguration.java

The spring cloud Gateway gateway itself is a Spring Boot project. When the gateway microservice starts, it will automatically load its configuration. Among them, there is a configuration class called GatewayClassPathWarningAutoConfiguration , as follows:

You will see @ConditionalOnMissingClass({“org.springframework.web.reactive.DispatcherHandler”})

Add spring-boot-starter-webflux dependency if there is no DispatcherHandler.

Remove the spring-boot-starter-web dependency if there is a DispatcherHandler.

@Configuration(
    proxyBeanMethods = false
)
@AutoConfigureBefore({GatewayAutoConfiguration.class})
public class GatewayClassPathWarningAutoConfiguration {
    private static final Log log = LogFactory.getLog(GatewayClassPathWarningAutoConfiguration.class);
    private static final String BORDER = "\n\n**********************************************************\n\n";

    public GatewayClassPathWarningAutoConfiguration() {
    }

    @Configuration(
        proxyBeanMethods = false
    )
    @ConditionalOnMissingClass({"org.springframework.web.reactive.DispatcherHandler"}) //重点注解
    protected static class WebfluxMissingFromClasspathConfiguration {
        public WebfluxMissingFromClasspathConfiguration() {
            GatewayClassPathWarningAutoConfiguration.log.warn("\n\n**********************************************************\n\nSpring Webflux is missing from the classpath, which is required for Spring Cloud Gateway at this time. Please add spring-boot-starter-webflux dependency.\n\n**********************************************************\n\n");
        }
    }

    @Configuration(
        proxyBeanMethods = false
    )
    @ConditionalOnClass(
        name = {"org.springframework.web.servlet.DispatcherServlet"}
    )
    protected static class SpringMvcFoundOnClasspathConfiguration {
        public SpringMvcFoundOnClasspathConfiguration() {
            GatewayClassPathWarningAutoConfiguration.log.warn("\n\n**********************************************************\n\nSpring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. Please remove spring-boot-starter-web dependency.\n\n**********************************************************\n\n");
        }
    }
}

If the spring-boot-starter-web dependency is added to the pom file, the org.springframework.web.servlet.DispatcherServlet filter will exist in the project, which is incompatible with Spring Cloud Gateway conflicts.

2、GatewayAutoConfiguration.java

Open the GatewayAutoConfiguration class in the gateway automatic configuration class, and see that the bean org.springframework.http.codec.ServerCodecConfigurer is required in the following methods

@Bean
public ModifyRequestBodyGatewayFilterFactory modifyRequestBodyGatewayFilterFactory(ServerCodecConfigurer codecConfigurer) {
    return new ModifyRequestBodyGatewayFilterFactory(codecConfigurer.getReaders());
}

@Bean
public DedupeResponseHeaderGatewayFilterFactory dedupeResponseHeaderGatewayFilterFactory() {
    return new DedupeResponseHeaderGatewayFilterFactory();
}

@Bean
public ModifyResponseBodyGatewayFilterFactory modifyResponseBodyGatewayFilterFactory(ServerCodecConfigurer codecConfigurer, Set<MessageBodyDecoder> bodyDecoders, Set<MessageBodyEncoder> bodyEncoders) {
    return new ModifyResponseBodyGatewayFilterFactory(codecConfigurer.getReaders(), bodyDecoders, bodyEncoders);
}

Solution:

Spring cloud gateway is based on webflux, so remove the spring-boot-start-web dependency directly. If you need web services, add the spring-boot-starter-webflux dependency.

HuaWei ensp enterprise network simulator Error: raw-mod is unavailable courtesy of Hyper-V

Problem scenario: Huawei ensp enterprise network simulator reports an error “Starting device AR failed error code 40”

Alternative scenario: The following version of virtual box 6.1.4 reports an error raw-mod is unavailable courtesy of Hyper-V

Reason: Hyper-V is occupied by wsl2, and VB cannot be used, so close Hyper-V: before closing, you need to completely delete wsl2, which can be replaced by converting to wsl1.

  1. Convert wsl2 to wsl1 wsl --set-version Ubuntu 2
  2. Security Center – Device Security – Turn off Kernel Isolation.
  3. reboot

[Solved] increment Error: ERR value is not an integer or out of range

Error Messages:

org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR value is not an integer or out of range
	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:54)
	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:52)
	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)
	at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)
	at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42)
	at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:268)
	at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.convertLettuceAccessException(LettuceStringCommands.java:799)
	at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.incr(LettuceStringCommands.java:332)
	at org.springframework.data.redis.connection.DefaultedRedisConnection.incr(DefaultedRedisConnection.java:323)
	at org.springframework.data.redis.connection.DefaultStringRedisConnection.incr(DefaultStringRedisConnection.java:557)
	at org.springframework.data.redis.core.DefaultValueOperations.lambda$increment$0(DefaultValueOperations.java:87)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184)
	at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95)
	at org.springframework.data.redis.core.DefaultValueOperations.increment(DefaultValueOperations.java:87)
	at cn.percent.common.utils.MyLockUtil.getNumberByRedis(MyLockUtil.java:141)
	at cn.percent.common.utils.NumberUtil.getNumberByRedis(NumberUtil.java:155)
	at cn.percent.common.utils.NumberUtil.getDateNumberByRedis(NumberUtil.java:76)
	at cn.percent.common.utils.NumberUtil.getDateNumber(NumberUtil.java:26)
	at cn.percent.Application.main(Application.java:32)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: io.lettuce.core.RedisCommandExecutionException: ERR value is not an integer or out of range
	at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:135)
	at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:108)
	at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120)
	at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111)
	at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:59)
	at io.lettuce.core.cluster.ClusterCommand.complete(ClusterCommand.java:63)
	at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:59)
	at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:646)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:604)
	at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:556)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1421)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)

Error Codes:

ValueOperations<String, String> forValue = stringRedisTemplate.opsForValue();
Long num = forValue.increment(NUM_ID.toString());

How to Solve:

When setting the expiration time, there is a problem with the milliseconds of the expiration time, you can remove it if you want to allow it.

ValueOperations<String, String> forValue = stringRedisTemplate.opsForValue();
forValue.set(NUM_ID.toString(), num.toString(), 1000000L);

[Solved] Forbidden (403) CSRF verification failed. Request aborted.

Forbidden (403)
CSRF verification failed. Request aborted.

You are seeing this message because this site requires a CSRF cookie when submitting forms. This cookie is required for security reasons, to ensure that your browser is not being hijacked by third parties.

If you have configured your browser to disable cookies, please re-enable them, at least for this site, or for “same-origin” requests.

Help
Reason given for failure:

    CSRF cookie not set.
    
In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django’s CSRF mechanism has not been used correctly. For POST forms, you need to ensure:

Your browser is accepting cookies.
The view function passes a request to the template’s render method.
In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.
If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data.
The form has a valid CSRF token. After logging in in another browser tab or hitting the back button after a login, you may need to reload the page with the form, because the token is rotated after a login.
You’re seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.

You can customize this page using the CSRF_FAILURE_VIEW setting.

Solution:

add {% csrf_token %} in the corresponding <form>

error LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MDd_DynamicDebug’ does not match value ‘MTd_StaticDebug’

There are a bunch of errors in VS2012 C++ compilation today:

1  1 >   Generating code...
 2  1 >Code.obj : error LNK2005: " public: __thiscall std::_Container_base12::_Container_base12(void) " (?? 0_Container_base12@std@@QAE@XZ) already in msvcprtd. Defined in lib(MSVCP110D.dll)
 3  1 >Code.obj : error LNK2005: " public: __thiscall std::_Container_base12::~_Container_base12(void) " (?? 1_Container_base12@std@@QAE@XZ) already in msvcprtd. Defined in lib(MSVCP110D.dll)
 4  1 >Code.obj : error LNK2005: " public: void __thiscall std::_Container_base12::_Orphan_all(void) " (?_Orphan_all@_Container_base12@std@@QAEXXZ) is already defined in msvcprtd.lib(MSVCP110D.dll)
 5  1 > IOCP_Socket.lib(CLog.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' Mismatch for value 'MTd_StaticDebug' (in Code.obj)
 6  1 > IOCP_Socket.lib(TcpServer.obj) : error LNK2038: Detected mismatch for 'RuntimeLibrary': value 'MDd_DynamicDebug' does not match value 'MTd_StaticDebug'(Code. obj)
 7  1 > IOCP_Socket.lib(stdafx.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' does not match value 'MTd_StaticDebug' (in Code.obj)
 8  1 > IOCP_Socket.lib (TcpSrvException.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' does not match value 'MTd_StaticDebug' (in Code.obj)
 9  1> IOCP_Socket.lib(TcpReceiveContext.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' does not match value 'MTd_StaticDebug' (in Code.obj)
 10  1 > IOCP_Socket.lib(TcpSendContext.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' does not match value 'MTd_StaticDebug' (in Code.obj)
 11  1 > IOCP_Socket.lib(AcceptContext.obj) : error LNK2038: 'RuntimeLibrary' detected Mismatch for: value 'MDd_DynamicDebug' does not match value 'MTd_StaticDebug' (in Code.obj)
 12  1 > IOCP_Socket.lib(OperateContext.obj) : error LNK2038: Detected mismatch for 'RuntimeLibrary': value 'MDd_DynamicDebug' Mismatch value "MTd_StaticDebug" (in Code.obj)
 13  1 >IOCP_Socket.lib(MemoryBlock.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' does not match value 'MTd_StaticDebug' (in Code.obj)
 14  1 > IOCP_Socket.lib(ContextStack.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' does not match value 'MTd_StaticDebug' (in Code.obj)
 15  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " void __cdecl std:: _Debug_message(wchar_t const *,wchar_t const *,unsigned int) " (? _Debug_message@std@@YAXPB_W0I@Z) is already defined in libcpmtd.lib(stdthrow.obj)
 16  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " public: __thiscall std::_Container_base12::_Container_base12(void) " (??0_Container_base12@std@@QAE@XZ) is already defined in Code.obj
 17  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " public: __thiscall std::_Container_base12::~_Container_base12(void) " (?? 1_Container_base12@std@@QAE@XZ) is already defined in Code.obj
 18  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " public: void __thiscall std::_Container_base12::_Orphan_all(void) " (? _Orphan_all @_Container_base12@std@@QAEXXZ) is already defined in Code.obj
 19  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " void __cdecl std::_Xbad_alloc(void) " (?_Xbad_alloc@std@@YAXXZ) is already defined in libcpmtd.lib(xthrow.obj)
 20  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " void __cdecl std::_Xlength_error(char const *) " (? _Xlength_error @std@@YAXPBD@Z) has been defined in libcpmtd.lib(xthrow.obj)
 21  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " void __cdecl std::_Xout_of_range(char const *) " (? _Xout_of_range@std@@YAXPBD@Z) is already defined in libcpmtd.lib(xthrow.obj)
 22  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " char const * __cdecl std::_Syserror_map(int) " ( ?_Syserror_map@std@@YAPBDH@Z) is already defined in
 libcpmtd.lib(syserror.obj) 23  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " char const * __cdecl std::_Winerror_map(int) " ( ? _Winerror_map@std@@YAPBDH@Z) is already defined in
 libcpmtd.lib(syserror.obj) 24  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " public: __thiscall std::_Lockit::_Lockit(int ) " (?? 0_Lockit@std@@QAE@H@Z) already defined in libcpmtd.lib(xlock.obj)
 25  1 >msvcprtd.lib(MSVCP110D.dll) : error LNK2005: " public: __thiscall std:: _Lockit::~_Lockit(void) " (??1_Lockit@std@@QAE@XZ) is already defined in libcpmtd.lib(xlock.obj)
 26  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _memmove is already defined in LIBCMTD.lib(memmove.obj)
 27  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fclose is already defined in LIBCMTD.lib(fclose.obj)
 28  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fflush is already defined in LIBCMTD.lib(fflush .obj)
 29  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _printf is already defined in LIBCMTD.lib(printf.obj)
 30  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _vprintf is already defined Define 31  1 > in LIBCMTD.lib(vprintf.obj)
MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __vsnprintf_s is already defined in LIBCMTD.lib(vsnprnc.obj)
 32  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _vsprintf_s is already defined in LIBCMTD.lib(vsnprnc.obj ) in
 33  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __invalid_parameter is already defined in LIBCMTD.lib(invarg.obj)
 34  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _memcpy_s is already in LIBCMTD 35  defined in .lib(memcpy_s.obj)
 1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _strncpy_s is already defined in LIBCMTD.lib(strncpy_s.obj)
 36  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void) " (?? 1exception@std@@UAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
 37  1 >MSVCRTD.lib(MSVCR110D.dll ) : error LNK2005: " public: virtual char const * __thiscall std::exception::what(void)const " (? what@exception@std@@UBEPBDXZ) already defined in LIBCMTD.lib(stdexcpt.obj)
 38  1 > MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __CrtDbgReportW is already defined in LIBCMTD.lib(dbgrptw.obj)
 39  1 >MSVCRTD.lib(ti_inst.obj) : error LNK2005: " private: __thiscall type_info::type_info( class type_info const &) " (??0type_info@@AAE@ABV0@@Z) has been defined in LIBCMTD.lib(typinfo.obj)
 40  1 >MSVCRTD.lib(ti_inst.obj) : error LNK2005: " private: class type_info & __thiscall type_info::operator=( class type_info const &) " (?? 4type_info@@AAAAAV0@ABV0@@Z) is already defined in LIBCMTD.lib(typinfo.obj)
 41  1 >LINK : warning LNK4098: default library "MSVCRTD" conflicts with other libraries ; please use / NODEFAULTLIB:library
 42  1 >E:\Projects\C++ \IOCP_Socket\Debug\Test.exe : fatal error LNK1169: one or more multiply defined symbols were found
 43 ========== Generated : 0 successful, 1 failed , 0 latest , 0 skipped ==========

Later, I checked and found that it was a problem with the runtime library settings; the runtime library settings of several projects were different:

Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Libraries

All settings are the same. Multi-threaded debugging (/MTd)

error: src refspec master does not match any [How to Solve]

Since the last time I learned git, I have rarely used it.

 

The local repository is initialized with the following command:

$ git init

Then use the following command to add the remote library:

$ git remote add origin [email protected]:hahah/ftpmanage.git

then use

$ git push -u origin master

The following error occurs:

error: src refspec master does not match any.
error: failed to push some refs to '[email protected]:hahaha/ftpmanage.git'

reason:

The local repository is empty

Solution: Use the following command to add the file;

$ git add add.php addok.php conn.php del.php edit.php editok.php ftpsql.sql index.php

$ git commit -m "init files"

After that, the following error occurred during the push process:

$ git push -u origin master
Warning: Permanently added the RSA host key for IP address 'xx.xx.xxx.xxx' to the list of known hosts.
To [email protected]:hahaha/ftpmanage.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '[email protected]:hahahah/ftpmanage.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Prompt to use git pull after push

Use the following command to solve:

$ git pull --rebase origin master
warning: no common commits
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From github.com:hahah/ftpmanage
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
First, rewinding head to replay your work on top of it...
Applying: init files

Continue to push, succeed.

$ git push -u origin master
Counting objects: 10, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 5.15 KiB | 0 bytes/s, done.
Total 10 (delta 3), reused 0 (delta 0)
To [email protected]:hahaha/ftpmanage.git
   a2b5c30..1044f15  master -> master
Branch master set up to track remote branch master from origin.

You’re done!!!

[Solved] Flutter – AAPT: error: resource android:attr/dialogCornerRadiu…

Launching lib\main.dart on Nokia X6 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:959: error: resource android:attr/fontVariationSettings not found.
  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:960: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

  Command: C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\c1441429ce2aae0e0bed3ad48db2b49e\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\hupo3\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          E:\Flutter Projects\intro_to_flutter\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.xiaobing.introtoflutter\
          -0\
          apk\
          --output-text-symbols\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
  Output:  C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\12aaee80bab0fcaef8511d3958ba785b\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

  C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\b1fc0e0ff1348f4d278539eb80ede9d3\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

  C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\b1fc0e0ff1348f4d278539eb80ede9d3\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.
  Command: C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\c1441429ce2aae0e0bed3ad48db2b49e\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\hupo3\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          E:\Flutter Projects\intro_to_flutter\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.xiaobing.introtoflutter\
          -0\
          apk\
          --output-text-symbols\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

* 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 18s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

 

 

Solution:

Open android\app\build.gradle file

Modify compileSdkVersion 和 targetSdkVersion

 

 

[Solved] NPM Error: gyp: No Xcode or CLT version detected!

question

Recently, when using npm to install modules in macOS Catalina, the following errors often occur:


> node-gyp rebuild

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/yangjian/Documents/temp/test001/node_modules/fsevents
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
  • Screenshot below

1

solution

1. Try to fix it with the following command

$ xcode-select --install

The system prompts the following information:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

In fact, there is no so-called “Software Update” to update

2. Correct posture

At a loss, I found the following solutions:

$ sudo rm -rf $(xcode-select -print-path)
$ xcode-select --install

[Solved] Backend Internal error: Exception during IR lowering

// Define two datas in viewmodel
class LoginViewModel @Inject constructor() : BaseViewModel<LoginIntent>() {
    val height = MutableStateFlow(-1f)
    val weight = MutableStateFlow(-1f)
}

// The data is used in the UI to make the determination.
BaseLoginScreen(
	canNextClick = vm.weight.collectAsState().value!=-1f && vm.weight.collectAsState().value!=-1f,
) { 。。。 }
// it will report error: Backend Internal error: Exception during IR lowering, and Runtime JAR files in the classpath should have the same version.

// Solution:
val height = vm.weight.collectAsState().value
val weight = vm.weight.collectAsState().value
BaseLoginScreen(
	canNextClick = height!=-1f && weight!=-1f,
) { ... }

IE11 Windows7 F12 DOC Resource Manager Error: Exception in window.onload: Error: An error has ocurredJSPlugin.3005

——————

Diagnostic:

Exception in window.onload: Error: An error has ocurredJSPlugin.3005

Stack Trace:

Error: An error has ocurredJSPlugin.3005 at getString (res://C:\Program Files\Internet Explorer\F12Resources.dll/23/pluginhost/plugin.f12.js:5021:27) at ToolWindowHelpers.loadString (res://C:\Program Files\Internet Explorer\F12Resources.dll/23/Common/CommonMerged.js:5803:13) at TabPanes…

——————-

 

Solution: Install Windows7 patch KB3008923;

download link:

http://www.microsoft.com/en-us/download/details.aspx?id=45134   (32-bit)

http://www.microsoft.com/en-US/download/details.aspx?id=45154  (64-bit)