草庐IT

useful_line

全部标签

android - 错误 :Could not run build action using Gradle installation (gradle 2. 4,安卓工作室)

我刚刚更新了AndroidStudio,我无法构建任何项目,即使是新创建的项目也是如此。我得到的错误是:错误:无法使用Gradle分发运行构建操作“https://services.gradle.org/distributions/”gradle-2.4.zip'.我该怎么办? 最佳答案 我们有两个著名的方法来解决这个问题:1-更新gradle:第1步:从以下位置获取AndroidStudio支持的最新版本:https://services.gradle.org/distributions第2步:解压gradle文件并安装到dist

android - AdMob 欧盟同意错误 : consent form can be used with custom provider selection only

我是适用于Android的Google同意SDK,我已按照documentation中列出的所有步骤进行操作.当我加载表单时,我在onConsentFormError中收到此错误:同意书只能用于自定义提供者选择。我在AdMob控制台上选择了一组常用的广告技术提供商所以我的问题是:1。对于此选项,我需要征得用户同意吗?根据GoogleDevelopers网站上的文档:Important:TheGoogle-renderedconsentformisnotsupportedifanyofyourpublisherIDsusethecommonlyusedsetofadtechnologyp

java - 安卓.view.InflateException : Binary XML file line #9: Error inflating class <unknown>

我已经研究这个问题几个小时了,但类似的错误并没有解决问题。我正在为不同Activity中的多个ListView重复使用此XML文件(我假设这与它有关)但我不明白为什么它会中断。XML文件表示ListView中的各个项目。这是XML:这是Java(错误发生在convertView=(FrameLayout)FrameLayout.inflate(mContext,R.layout.column_post,null);):@OverridepublicViewgetView(intposition,ViewconvertView,ViewGroupparent){JSONObjectthe

android - java.lang.IllegalStateException : TimerTask is scheduled already: Rationally using of Timer and TimerTask in Android 错误

我编写了一个连接到服务器并向他发送ping命令的应用程序,服务器使用pong命令进行应答。我想实现连接超时机制。我认为它将如下:客户端发送ping并使用timertask和delay启动计时器当客户端收到pong时,timertask被取消。另外,我想优化内存。所以,不要在我每次发送ping命令时都重新创建TimerTask。我尝试下面的代码:privatefinalTimermSystemLogoutTimer=newTimer();privatefinalTimerTaskmLogoutTask=newTimerTask(){@Overridepublicvoidrun(){mMe

android - 如何从 startActivityForResult(Intent.createChooser(fileIntent, "Open file using..."), APP_PICKED); 获取用户选择?

在之后有没有办法以编程方式获取用户选择startActivityForResult(Intent.createChooser(fileIntent,"Openfileusing..."),APP_PICKED);或startActivity(Intent.createChooser(fileIntent,"Openfileusing..."));我不想启动选定的应用程序-我只想知道它是哪一个?谢谢! 最佳答案 不,你无法知道用户选择了什么。但是,您可以使用PackageManager和queryIntentActivities()制

android - JNI 加载 : Warning : Do not hardcode use Context. getFilesDir().getPath() 而不是

我的一个应用程序遇到问题,我有以下代码来加载应用程序需要的库(JNI):static{//loadtheJNIlibraryLog.i("JNI","loadingJNIlibrary...");System.load("/data/data/com.mypackage.appname/lib/libxxxxxx.so");Log.i("JNI","JNIlibraryloaded!");}所以我得到警告:“请注意硬编码使用Context.getFilesDir().getPath()代替”这是完全正确的(它不会在所有设备上都可移植)。问题是,因为我使用的是静态的,所以我无法调用Con

java - 安卓/gradle : not able to use repository

我试图删除我的jar*库并将它们添加为maven-repository-dependencies。看起来很有前途,但我做不到。我用一个库(gson)测试了它,现在我的gradle.build看起来像这样:buildscript{repositories{mavenCentral()}dependencies{classpath'com.android.tools.build:gradle:0.5.+'}}applyplugin:'android'dependencies{compilefileTree(dir:'libs',include:'*.jar')compile'com.goo

android - GoogleJsonResponseException : 404 Not Found using google apps endpoint engine backend

我遵循了下面的教程。https://developers.google.com/eclipse/docs/running_and_debugging_2_0这基本上为我现有的应用程序添加了一个GAE后端。然后我尝试下面的例子,在本地开发服务器上运行它,我得到下面发生在之后的异常Noteresult=endpoint.insertNote(note).execute();被调用。com.google.api.client.googleapis.json.GoogleJsonResponseException:404NotFound我的代码如下。packagecom.cloudnotes;

安卓 "You need to use a Theme.AppCompat theme (or descendant) with the design library"

好的,我收到了这个错误(标题)。许多帖子建议我(甚至是Androidstudio)将主题更改为App.Appcompat,我已经做到了。list文件:样式.xml@color/colorPrimary@color/colorPrimaryDark@color/colorAccentfalsetrue但仍然没有任何改变。我不知道发生了什么,因为我以前没有遇到过这个问题(我之前没有在list文件中添加App.compat)Gradle:compile'com.android.support:appcompat-v7:24.0.0-beta1'compile'com.android.supp

安卓工作室 : install Release App by command line

我想从命令行导出apk文件“releaseapk”当我运行此命令时:gradlewinstallRelease我发现了这个AndroidStudioTask'installRelease'notfoundinrootproject''.Somecandidatesare:'uninstallRelease'.我该如何解决? 最佳答案 我的经验是,直到您在构建的buildTypes.releaseblock中定义signingConfigs后,installRelease任务才可用文件,如SigninginReleaseMode的第3