Repository navigation
[win32-x86-64] Unable to load library MaaFramework.dll #1
Description
Activity
I think this may be due to a lack of runtime dependencies with Microsoft, so I used the depands.exe tool to check its DLL and it turned out to be so.
Download link depends official website
Download link VC_redist.x64OK, the issue was done!!!
Reacted by H- 你好,Debug变量如下: [cid:c5a4bd34-c5cb-4125-aa49-078780547229] 系统信息 [cid:bcba2291-afc0-498b-9de5-78794220af5a] 正常来说,64位ARM架构CPU的osArch才是arch64, 至于为什么英特尔64位x86架构CPU的osArch为什么是amd64, 我在网上查到,它们都是英特尔的别名,即:amd64=x86_64=x64…________________________________ 发件人: H ***@***.***> 发送时间: 2024年8月24日 21:11 收件人: hanhuoer/maa-framework-java ***@***.***> 抄送: Ulquiorra ***@***.***>; State change ***@***.***> 主题: Re: [hanhuoer/maa-framework-java] [win32-x86-64] Unable to load library MaaFramework.dll (Issue #1) 可以去 io.github.hanhuoer.maa.Maa 打个断点看看吗? 看下 osName osArch 这俩变量的值是什么。 因为我这边没有 arm64 的机器,所以之前写的时候可能忽略了这块,导致测试不充分。 讲道理你的环境应该会选择 win-aarch64 呀。 image.png (view on web)<https://github.com/user-attachments/assets/8f90300d-26a3-4389-9ca2-94fee3575f9f> ― Reply to this email directly, view it on GitHub<#1 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4MDUL4C4X3FWI7DGCFP2RDZTCA7ZAVCNFSM6AAAAABNBQFLI6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGM4TCMZVGU>. You are receiving this because you modified the open/close state.Reacted by H
I think this may be due to a lack of runtime dependencies with Microsoft, so I used the depands.exe tool to check its DLL and it turned out to be so.
Download link depends official website Download link VC_redist.x64
OK, the issue was done!!!
@Circularorbit 你好,请教一下,你这边是安装 Latest Microsoft Visual C++ Redistributable Version 之后就可以正常使用了吗?
很奇怪,最近我在 MaaFramework 2.0 版本也遇到同样问题了,在你发之前没见到过,回来看了下才发现是一样的问题。
用 dependencywalker 查了下,确实好多红的 dll,大概几百个吧,但 MaaFramework v1.8.9 也是同样,这就让人想不明白了。
目前我这边测试的都是 win-x86_64,macos 倒是通过的,你最近有使用 v2.0 吗。
- v2.0.0-beta.4
- v2.0.0-beta.3
- v2.0.0-beta.2
- v2.0.0-beta.1
- v2.0.0-alpha.3
- v2.0.0-alpha.2
- v2.0.0-alpha.1
环境
Windows 10
版本 10.0.19045
系统类型 基于 x64 的电脑
处理器 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz,2601 Mhz,4 个内核,8 个逻辑处理器Java 11
import com.sun.jna.Library; import com.sun.jna.Native; import io.github.hanhuoer.maa.util.FileUtils; public class MaaFrameworkTest { public interface MaaController1_8_9 extends Library { MaaController1_8_9 INSTANCE = Native.load("C:\\Users\\H\\Downloads\\MaaFW\\1.8.9\\MaaFramework.dll", MaaController1_8_9.class); } public interface MaaController2_0_0 extends Library { MaaController2_0_0 INSTANCE = Native.load("C:\\Users\\H\\Downloads\\MaaFW\\2.0.0-beta.4\\MaaFramework.dll", MaaController2_0_0.class); } public static void main(String[] args) { // System.out.println(MaaController1_8_9.INSTANCE); System.out.println(MaaController2_0_0.INSTANCE); } }

https://github.com/lucasg/Dependencies
单独一个 MaaFramework.dll 应该只有 4 个红dll
这是我用
Dependencies打开 dll 后的情况,分别是 release 版本的 MaaFramework.dll 和你提供的 MaaFrameworkX64.dllI think this may be due to a lack of runtime dependencies with Microsoft, so I used the depands.exe tool to check its DLL and it turned out to be so.
Download link depends official website Download link VC_redist.x64
OK, the issue was done!!!@Circularorbit 你好,请教一下,你这边是安装 Latest Microsoft Visual C++ Redistributable Version 之后就可以正常使用了吗?
很奇怪,最近我在 MaaFramework 2.0 版本也遇到同样问题了,在你发之前没见到过,回来看了下才发现是一样的问题。
用 dependencywalker 查了下,确实好多红的 dll,大概几百个吧,但 MaaFramework v1.8.9 也是同样,这就让人想不明白了。
目前我这边测试的都是 win-x86_64,macos 倒是通过的,你最近有使用 v2.0 吗。
- v2.0.0-beta.4
- v2.0.0-beta.3
- v2.0.0-beta.2
- v2.0.0-beta.1
- v2.0.0-alpha.3
- v2.0.0-alpha.2
- v2.0.0-alpha.1
环境
Windows 10 版本 10.0.19045 系统类型 基于 x64 的电脑 处理器 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz,2601 Mhz,4 个内核,8 个逻辑处理器
Java 11
import com.sun.jna.Library; import com.sun.jna.Native; import io.github.hanhuoer.maa.util.FileUtils; public class MaaFrameworkTest { public interface MaaController1_8_9 extends Library { MaaController1_8_9 INSTANCE = Native.load("C:\\Users\\H\\Downloads\\MaaFW\\1.8.9\\MaaFramework.dll", MaaController1_8_9.class); } public interface MaaController2_0_0 extends Library { MaaController2_0_0 INSTANCE = Native.load("C:\\Users\\H\\Downloads\\MaaFW\\2.0.0-beta.4\\MaaFramework.dll", MaaController2_0_0.class); } public static void main(String[] args) { // System.out.println(MaaController1_8_9.INSTANCE); System.out.println(MaaController2_0_0.INSTANCE); } }
MaaFramework v2.0.0问题找到了就好, 这类问题主要还是版本兼容, 运行环境的问题。
我当时用的是MaaFramework v1.8.9, 主要原因的确是运行环境缺少了vc依赖。Reacted by H建议readme加一下解决方案,因为直接按readme流程会报此问题
Reacted by H另外发现保证system32目录下的msvcp140版本正确的情况下,把java jdk bin目录下的msvcp140重命名为_msvcp140也可以解决问题
Reacted by H建议readme加一下解决方案,因为直接按readme流程会报此问题
好主意,晚点我更新一下
Reacted by SandoGeek- pinned this issue
on Dec 8, 2024 建议readme加一下解决方案,因为直接按readme流程会报此问题
好主意,晚点我更新一下
另外可以在加载MaaFramework前检查一下msvcp140.dll的版本,如果不满足要求就抛出一个带解决方案的异常
Reacted by H




After deploying the maven project, when I executed the QuickStart class, the result was an exception of java.lang.UnsatisfiedLinkError: Unable to load library MaaFramework.dll.
but the MaaFramework.dll file does exist in project-root/resources/maa/lib inside.
the OS is win64, the cpu is arm64, the jdk is openJDK 17.
at first, I thought the DLL was damaged, but even when I reinstalled the dependencies in the Maven local repository, this error still occurred.
When I was debugging, I found that he was using maa.win-x86_64
but i don't know how to do debug next, and check it out what problem.