Unity 接入Admob SDK 打Apk 过程中遇到的问题

2024-04-26 07:12

本文主要是介绍Unity 接入Admob SDK 打Apk 过程中遇到的问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

最近项目接入google Admod ,接入的过程比较顺利按照官网给的教程一步一步来就行,但是打包过程遇到了一些问题,记录如下:

Unity 版本:2023.3.4  Admob 版本:Version 9.1.0

第一个问题:

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class _COROUTINE.ArtificialStackFrames found in modules jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar) and jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1)
  Duplicate class _COROUTINE.CoroutineDebuggingKt found in modules jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar) and jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1)
  Duplicate class _COROUTINE._BOUNDARY found in modules jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar) and jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1)
  Duplicate class _COROUTINE._CREATION found in modules jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar) and jetified-kotlinx-coroutines-core-jvm-1.7.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1)
  Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsCallback$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsCallback$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsService found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsService$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsService$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.ICustomTabsService$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.IPostMessageService found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.IPostMessageService$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.IPostMessageService$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.IPostMessageService$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityCallback found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityCallback$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityCallback$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityCallback$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityService found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityService$Default found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityService$Stub found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.customtabs.trusted.ITrustedWebActivityService$Stub$Proxy found in modules browser-1.4.0-runtime.jar (androidx.browser:browser:1.4.0) and jetified-androidx.browser.browser-1.4.0-runtime.jar (:androidx.browser.browser-1.4.0:)
  Duplicate class android.support.v4.app.RemoteActionCompatParcelizer found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.8.0-runtime.jar (androidx.core:core:1.8.0) and jetified-androidx.core.core-1.8.0-runtime.jar (:androidx.core.core-1.8.0:)
  Duplicate class androidx.activity.Cancellable found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity$1 found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity$2 found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity$3 found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ComponentActivity$NonConfigurationInstances found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.ImmLeaksCleaner found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedCallback found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedDispatcher found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedDispatcher$LifecycleOnBackPressedCancellable found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedDispatcher$OnBackPressedCancellable found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.activity.OnBackPressedDispatcherOwner found in modules jetified-activity-1.0.0-runtime.jar (androidx.activity:activity:1.0.0) and jetified-androidx.activity.activity-1.0.0-runtime.jar (:androidx.activity.activity-1.0.0:)
  Duplicate class androidx.annotation.OptIn found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.RequiresOptIn found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.RequiresOptIn$Level found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.experimental.Experimental found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.experimental.Experimental$Level found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.annotation.experimental.UseExperimental found in modules jetified-androidx.annotation.annotation-experimental-1.1.0-runtime.jar (:androidx.annotation.annotation-experimental-1.1.0:) and jetified-annotation-experimental-1.1.0-runtime.jar (androidx.annotation:annotation-experimental:1.1.0)
  Duplicate class androidx.appcompat.app.ActionBar found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$DisplayOptions found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$LayoutParams found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$NavigationMode found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$OnMenuVisibilityListener found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:androidx.appcompat.appcompat-1.2.0:)
  Duplicate class androidx.appcompat.app.ActionBar$OnNavigationListener found in modules appcompat-1.2.0-runtime.jar (androidx.appcompat:appcompat:1.2.0) and jetified-androidx.appcompat.appcompat-1.2.0-runtime.jar (:<message truncated>
看着很多,其实主要是多个jar包问题,问题出在导入admob的过程中把jar包依赖自动下载到了Plugins/Android 目录下了,正常情况下这个目录如果只有admob的话应该是这样

处理方法:把其他的jar包删除就可以了。

Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.*.*:layout_constraintBottom_toBottomOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.*.*:layout_constraintEnd_toEndOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.*.*:layout_constraintStart_toStartOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.*.*:layout_constraintTop_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintBottom_toTopOf (aka com.*.*:layout_constraintBottom_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.*.*:layout_constraintEnd_toEndOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.*.*:layout_constraintStart_toStartOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.*.*:layout_constraintTop_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintBottom_toTopOf (aka com.*.*:layout_constraintBottom_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.*.*:layout_constraintEnd_toEndOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.*.*:layout_constraintStart_toStartOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintTop_toBottomOf (aka com.*.*:layout_constraintTop_toBottomOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.*.*:layout_constraintBottom_toBottomOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.*.*:layout_constraintEnd_toEndOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.*.*:layout_constraintStart_toStartOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.*.*:layout_constraintTop_toTopOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.*.*:layout_constraintBottom_toBottomOf) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintDimensionRatio (aka com.*.*:layout_constraintDimensionRatio) not found.
         
     C:\Users\DELL\.gradle\caches\transforms-3\246f528239708f672a9905dd9b6fadde\transformed\jetified-googlemobileads-unity\res\layout\gnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintEnd_toStartOf (aka com.*.*:layout_constraintEnd_toStartOf) not found.
         这个问题的原因是gradleTemplate.properties 没有设置android.useAndroidX=true,正常情况下gradleTemplate.properties内容为

点击Assets > External Dependency Manager > Android Resolver > Resolve 应该就能解决自动生成,如果没有,点击Force Resolve

还有就是打Apk过程中长时间的等待Building Gradle project... 如果超过20分钟可能就build失败了,大概问题是gradle 版本不对,我之前用的版本是6.1.1,报错,改为gradle-6.8 之后正常

最好引入Admob 打包的过程中开vpn,因为有些依赖需要翻墙,或者挂其他代理也行,网上教程比较多,可以查询下

遇到问题国外网站会有更多的解决方法,我百度了很久很多都不对症

这篇关于Unity 接入Admob SDK 打Apk 过程中遇到的问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/936918

相关文章

Linux线程同步/互斥过程详解

《Linux线程同步/互斥过程详解》文章讲解多线程并发访问导致竞态条件,需通过互斥锁、原子操作和条件变量实现线程安全与同步,分析死锁条件及避免方法,并介绍RAII封装技术提升资源管理效率... 目录01. 资源共享问题1.1 多线程并发访问1.2 临界区与临界资源1.3 锁的引入02. 多线程案例2.1 为

批量导入txt数据到的redis过程

《批量导入txt数据到的redis过程》用户通过将Redis命令逐行写入txt文件,利用管道模式运行客户端,成功执行批量删除以Product*匹配的Key操作,提高了数据清理效率... 目录批量导入txt数据到Redisjs把redis命令按一条 一行写到txt中管道命令运行redis客户端成功了批量删除k

分布式锁在Spring Boot应用中的实现过程

《分布式锁在SpringBoot应用中的实现过程》文章介绍在SpringBoot中通过自定义Lock注解、LockAspect切面和RedisLockUtils工具类实现分布式锁,确保多实例并发操作... 目录Lock注解LockASPect切面RedisLockUtils工具类总结在现代微服务架构中,分布

Win10安装Maven与环境变量配置过程

《Win10安装Maven与环境变量配置过程》本文介绍Maven的安装与配置方法,涵盖下载、环境变量设置、本地仓库及镜像配置,指导如何在IDEA中正确配置Maven,适用于Java及其他语言项目的构建... 目录Maven 是什么?一、下载二、安装三、配置环境四、验证测试五、配置本地仓库六、配置国内镜像地址

Python实现网格交易策略的过程

《Python实现网格交易策略的过程》本文讲解Python网格交易策略,利用ccxt获取加密货币数据及backtrader回测,通过设定网格节点,低买高卖获利,适合震荡行情,下面跟我一起看看我们的第一... 网格交易是一种经典的量化交易策略,其核心思想是在价格上下预设多个“网格”,当价格触发特定网格时执行买

解决pandas无法读取csv文件数据的问题

《解决pandas无法读取csv文件数据的问题》本文讲述作者用Pandas读取CSV文件时因参数设置不当导致数据错位,通过调整delimiter和on_bad_lines参数最终解决问题,并强调正确参... 目录一、前言二、问题复现1. 问题2. 通过 on_bad_lines=‘warn’ 跳过异常数据3

解决RocketMQ的幂等性问题

《解决RocketMQ的幂等性问题》重复消费因调用链路长、消息发送超时或消费者故障导致,通过生产者消息查询、Redis缓存及消费者唯一主键可以确保幂等性,避免重复处理,本文主要介绍了解决RocketM... 目录造成重复消费的原因解决方法生产者端消费者端代码实现造成重复消费的原因当系统的调用链路比较长的时

python设置环境变量路径实现过程

《python设置环境变量路径实现过程》本文介绍设置Python路径的多种方法:临时设置(Windows用`set`,Linux/macOS用`export`)、永久设置(系统属性或shell配置文件... 目录设置python路径的方法临时设置环境变量(适用于当前会话)永久设置环境变量(Windows系统

python运用requests模拟浏览器发送请求过程

《python运用requests模拟浏览器发送请求过程》模拟浏览器请求可选用requests处理静态内容,selenium应对动态页面,playwright支持高级自动化,设置代理和超时参数,根据需... 目录使用requests库模拟浏览器请求使用selenium自动化浏览器操作使用playwright

Mysql中设计数据表的过程解析

《Mysql中设计数据表的过程解析》数据库约束通过NOTNULL、UNIQUE、DEFAULT、主键和外键等规则保障数据完整性,自动校验数据,减少人工错误,提升数据一致性和业务逻辑严谨性,本文介绍My... 目录1.引言2.NOT NULL——制定某列不可以存储NULL值2.UNIQUE——保证某一列的每一