无法编辑外部库文件 - 在Android Studio中显示为锁定 [英] Unable to edit External Library Files - showing as Locked in Android Studio

查看:2801
本文介绍了无法编辑外部库文件 - 在Android Studio中显示为锁定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个奇怪的问题。我为我的应用程序使用了一个外部PDF查看器库,该库提供了完整的读取&写入权限(修改文件)。在测试过程中,我意识到一个小故障(可以通过编辑库.java文件中的一个来修复),但是当我编辑文件时,它不会让我在Android Studio中显示该库已锁定。我已经尝试从右下角删除锁,但这也不起作用。



以下是添加到依赖关系的库:

  compile'c​​om.joanzapata.pdfview:android-pdfview:1.0.4@aar'

我也附上Android Studio项目窗格的屏幕截图,因为我相信这可以帮助解决问题:



Android Studio项目窗格屏幕截图



这些文件似乎都在'class.jar'下,我想编辑的文件是'Constants.java'文件,我使用的是Android Studio v1.5(稳定版)。



奇怪的是,我有一位朋友在他的Android Studio中编译这个库,他能够编辑它,我发现它很奇怪。不知怎的,我已经锁定了自己,只有读取权限;我认为这可能是将我的项目提交给GitHub,但我不确定。



我已经四处搜寻并尝试了所有可能的解决方案,但至今未能成功。



。提前致谢!

解决方案

您可以将库导入为模块,
以下是库的链接: -
https://github.com/JoanZapata/android-pdfview



如果你认为你的修改可以使图书馆变得更好,那么我会建议为github项目贡献一份。



无论如何,图书馆将会导入到您的项目,它将是可编辑的。
此链接将帮助您在工作室项目中导入库: - http://www.truiton.com/2015/02/android-studio-add-library-project/



更改来源图书馆的代码需要您自担风险.. !!

I have ran into an odd issue. I am using an external pdf viewer library for my app and the library gives full read & write access (to modify files). During testing i realised a small glitch (which can be fixed by editing one of the library .java files) however when I go to edit the file it won't let me, in Android Studio it is showing the library as locked. I have tried removing the lock from the bottom right hand corner but this won't work either.

Here is the library being added to the dependencies:

compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'

I am also attaching a screen shot of my Android Studio project pane as I believe this will help troubleshoot:

Android Studio Project Pane Screen Shot

The files all seem to be under 'class.jar' and the file I wish to edit is the 'Constants.java' file and I am using Android Studio v1.5 (Stable).

Strangely enough, I got a friend to compile this library in his Android Studio and he was able to edit it, which I found weird. Somehow I have locked myself out and have only Read permissions; I am thinking this could be to do with committing my project to GitHub but I am not sure.

I have searched around and tried all possible solutions but no success till now.

Any help would be appreciated. Thanks in Advance!

解决方案

You can import the library as a module, Here is a link for library:- https://github.com/JoanZapata/android-pdfview

If you think your changes can help make library better, then i would recommend to contribute to the github project.

Anyways, the library will be imported to your project and it will be editable. This link will help you with importing library in a studio project:- http://www.truiton.com/2015/02/android-studio-add-library-project/

Change the source code of library at your own risk..!!

这篇关于无法编辑外部库文件 - 在Android Studio中显示为锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆