使用 gradle-lint-plugin在 Android Studio 中,它提示
:lintGradle
This project contains lint violations. A complete listing of the
violations follows. Because none were serious, the build's overall
status was unaffected.
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:43 compile 'com.android.support:appcompat-v7:24.1.0'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:44 compile 'com.android.support:design:24.1.0'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:45 compile 'com.android.support:cardview-v7:24.1.0'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:52 compile
'com.github.gigamole.arcprogressstackview:library:+'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:53 compile 'com.github.dexafree:materiallist:3.2.1'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:54 compile 'com.android.volley:volley:1.0.0'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:55 compile 'com.cocosw:bottomsheet:1.+@aar'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:57 compile 'com.android.support:support-v4:+'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:58 compile 'com.github.shem8:material-login:1.4.0'
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:64
compile('com.github.ozodrukh:CircularReveal:1.3.1@aar') {
transitive = true; }
this dependency should be moved to the runtime configuration since it
has no classes warning unused-dependency
app/build.gradle:74 compile 'com.github.rey5137:material:1.2.4'
? app/build.gradle: 11 problems (0 errors, 11 warnings)
To apply fixes automatically, run fixGradleLint, review, and commit
the changes.
BUILD SUCCESSFUL
我应该听取建议吗?如果这些依赖项应该在runtime 中,为什么每个依赖项 wiki/doc 都不这么说,而是坚持告诉我们将依赖项放在 compile 中?
编辑:我尝试采纳建议,换句话说,将关键字 compile 更改为 runtime,例如 runtime 'com.android.support:appcompat -v7:24.1.0'。但是,Android Studio 提示
Error:Could not find method runtime() for arguments
[com.android.support:appcompat-v7:24.1.0] on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Please install the Android Support Repository from the Android SDK
Manager. <a href="openAndroidSdkManager">Open Android SDK Manager</a>
那么问题是什么?
最佳答案
我相信 apk 是 runtime 的 android,例如:
apk 'com.android.support:appcompat-v7:24.1.0'
有人说package
https://stackoverflow.com/a/28473873/360211
也许两者都有效,也许没有区别,也许有区别。我不知道非常无法搜索的术语。
关于android - 我应该在 Android Studio 的 Gradle 中将一些依赖项移动到 `runtime` 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39614745/
我的目标是转换表单输入,例如“100兆字节”或“1GB”,并将其转换为我可以存储在数据库中的文件大小(以千字节为单位)。目前,我有这个:defquota_convert@regex=/([0-9]+)(.*)s/@sizes=%w{kilobytemegabytegigabyte}m=self.quota.match(@regex)if@sizes.include?m[2]eval("self.quota=#{m[1]}.#{m[2]}")endend这有效,但前提是输入是倍数(“gigabytes”,而不是“gigabyte”)并且由于使用了eval看起来疯狂不安全。所以,功能正常,
我的代码目前看起来像这样numbers=[1,2,3,4,5]defpop_threepop=[]3.times{pop有没有办法在一行中完成pop_three方法中的内容?我基本上想做类似numbers.slice(0,3)的事情,但要删除切片中的数组项。嗯...嗯,我想我刚刚意识到我可以试试slice! 最佳答案 是numbers.pop(3)或者numbers.shift(3)如果你想要另一边。 关于ruby-多次弹出/移动ruby数组,我们在StackOverflow上找到一
为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar
我正在尝试修改当前依赖于定义为activeresource的gem:s.add_dependency"activeresource","~>3.0"为了让gem与Rails4一起工作,我需要扩展依赖关系以与activeresource的版本3或4一起工作。我不想简单地添加以下内容,因为它可能会在以后引起问题:s.add_dependency"activeresource",">=3.0"有没有办法指定可接受版本的列表?~>3.0还是~>4.0? 最佳答案 根据thedocumentation,如果你想要3到4之间的所有版本,你可以这
我收到这个错误:RuntimeError(自动加载常量Apps时检测到循环依赖当我使用多线程时。下面是我的代码。为什么会这样?我尝试多线程的原因是因为我正在编写一个HTML抓取应用程序。对Nokogiri::HTML(open())的调用是一个同步阻塞调用,需要1秒才能返回,我有100,000多个页面要访问,所以我试图运行多个线程来解决这个问题。有更好的方法吗?classToolsController0)app.website=array.join(',')putsapp.websiteelseapp.website="NONE"endapp.saveapps=Apps.order("
当我在我的Rails应用程序根目录中运行rakedoc:app时,API文档是使用/doc/README_FOR_APP作为主页生成的。我想向该文件添加.rdoc扩展名,以便它在GitHub上正确呈现。更好的是,我想将它移动到应用程序根目录(/README.rdoc)。有没有办法通过修改包含的rake/rdoctask任务在我的Rakefile中执行此操作?是否有某个地方可以查找可以修改的主页文件的名称?还是我必须编写一个新的Rake任务?额外的问题:Rails应用程序的两个单独文件/README和/doc/README_FOR_APP背后的逻辑是什么?为什么不只有一个?
我正在使用RubyonRails3.0.9,我想生成一个传递一些自定义参数的link_toURL。也就是说,有一个articles_path(www.my_web_site_name.com/articles)我想生成如下内容:link_to'Samplelinktitle',...#HereIshouldimplementthecode#=>'http://www.my_web_site_name.com/articles?param1=value1¶m2=value2&...我如何编写link_to语句“alàRubyonRailsWay”以实现该目的?如果我想通过传递一些
我只想对我一直在思考的这个问题有其他意见,例如我有classuser_controller和classuserclassUserattr_accessor:name,:usernameendclassUserController//dosomethingaboutanythingaboutusersend问题是我的User类中是否应该有逻辑user=User.newuser.do_something(user1)oritshouldbeuser_controller=UserController.newuser_controller.do_something(user1,user2)我
我从Ubuntu服务器上的RVM转移到rbenv。当我使用RVM时,使用bundle没有问题。转移到rbenv后,我在Jenkins的执行shell中收到“找不到命令”错误。我内爆并删除了RVM,并从~/.bashrc'中删除了所有与RVM相关的行。使用后我仍然收到此错误:rvmimploderm~/.rvm-rfrm~/.rvmrcgeminstallbundlerecho'exportPATH="$HOME/.rbenv/bin:$PATH"'>>~/.bashrcecho'eval"$(rbenvinit-)"'>>~/.bashrc.~/.bashrcrbenvversions
最近因为项目需要,需要将Android手机系统自带的某个系统软件反编译并更改里面某个资源,并重新打包,签名生成新的自定义的apk,下面我来介绍一下我的实现过程。APK修改,分为以下几步:反编译解包,修改,重打包,修改签名等步骤。安卓apk修改准备工作1.系统配置好JavaJDK环境变量2.需要root权限的手机(针对系统自带apk,其他软件免root)3.Auto-Sign签名工具4.apktool工具安卓apk修改开始反编译本文拿Android系统里面的Settings.apk做demo,具体如何将apk获取出来在此就不过多介绍了,直接进入主题:按键win+R输入cmd,打开命令窗口,并将路