Arduino_Arduino出现Error parsing library不能打开运行、闪退的解决办法

问题

打开Arduino的时候,开始界面只显示了“初始化包”和“准备开发板”,然后开始界面消失,Arduino也不能运行:
这里写图片描述
这里写图片描述

运行arduino_debug.exe测试问题,发现了如下问题:

这里写图片描述

文字是:

Error parsing library.index:Unexpected character (‘<’ (code 60)): expected a valid value (number, String, array, object, ‘true’, ‘false’ or ‘null’)
at [Source: (FileInputStream); line: 1, column: 2]
正在准备开发板…
java.lang.NullPointerException
at cc.arduino.contributions.libraries.LibrariesIndexer.rescanLibraries(LibrariesIndexer.java:140)
at cc.arduino.contributions.libraries.LibrariesIndexer.setLibrariesFolders(LibrariesIndexer.java:109)
at processing.app.BaseNoGui.onBoardOrPortChange(BaseNoGui.java:677)
at processing.app.Base.onBoardOrPortChange(Base.java:1313)
at processing.app.Base$11.actionPerformed(Base.java:1514)
at processing.app.Base.rebuildBoardsMenu(Base.java:1490)
at processing.app.Base.(Base.java:267)
at processing.app.Base.main(Base.java:145)

在问题出现之前,是可以正常运行的,但是我根据http://blog.sina.com.cn/s/blog_1303d4ec60102uwc5.html 这位博主的做法,把自己的uno变成了Keyboard设备,改变了原来uno的默认的USB串口驱动,现在变成了Keyboard驱动,并一直被识别为libusb-win32 devices:
这里写图片描述

可能是修改了驱动的原因,导致Error parsing library,也就是库索引错误。

解决办法

千辛万苦找到了官方英文论坛的解决办法。
亲测有效,链接http://forum.arduino.cc/index.php?topic=565990.msg3856028

其中有一些是废话,主要是以下步骤:
You have a corrupted library index file. The solution is to remove your local copy of the file, which will force the Arduino IDE to download a fresh (and hopefully uncorrupted) version of the file from the Internet:

1、Open C:\Users\Ace\AppData\Local\Arduino15. This is under a system folder that Windows normally hides. You can set Windows Explorer to show hidden folders via View > Hidden Items (check).
2、Rename library_index.json to library_index.json.txt

意思是本地的索引文件C:\Users\Ace\AppData\Local\Arduino15\library_index.json 已经损坏,解决办法是把这个文件改名为library_index.json.txt,这样Arduino IDE启动的时候就找不到原来的索引文件,于是强迫Arduino IDE下载新的索引文件,而新下载的文件肯定是正确没有损坏的,再重启Arduino IDE即可正常运行。

扫描二维码关注公众号,回复: 3456430 查看本文章
  1. 进入C:\Users\Ace\AppData\Local文件夹,找到Arduino15文件夹,如果没有,可能被隐藏,在文件夹设置里勾上【显示隐藏文件】
  2. 找到library_index.json文件,改名为library_index.json.txt,或者删除都可以,目的是要让这个文件不被Arduino IDE识别
  3. 重启Arduino IDE,发现在此目录下确实新下载了library_index.json,能够正常运行

猜你喜欢

转载自blog.csdn.net/Hxj_CSDN/article/details/82421152