jjzjj

implementation

全部标签

android - 错误配置 'compile' 已过时,已替换为 'implementation' 和 api

最近我用构建工具和api更新了androidstudio。在同步当前项目时出现如下错误:“错误配置‘compile’已过时,已被‘implementationand‘api’取代。如何修复此错误。 最佳答案 我找到了这个问题的完整解决方案。这是对build.gradle文件中更改的简单解释。您必须在使用任何apiref的地方将compile替换为api。喜欢:Volley,GitHub依赖。强文本在使用play-services-maps、appcompat-v7等android库时,您必须将compile替换为implementa

更新后Android资源编译失败

更新androidstudio后...我的项目因以下错误而崩溃AndroidresourcecompilationfailedOutput:C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1668:error:innerelementmusteitherbearesourcereferenceorempty.C:\Users\aliya\Desktop\EventsToday\app\build\

android - 错误 : Program type already present: androidx. versionedparcelable.ParcelImpl

我正在尝试添加这个https://github.com/ArthurHub/Android-Image-Cropper但是当我添加它时我得到这个错误“错误:程序类型已经存在:androidx.versionedparcelable.ParcelImpl”我附上了项目gradle和appgradle。(我是android开发的新手,并不完全确定如何修复。)我想这可能与此有关implementation"com.android.support:appcompat-v7:${supportLibVersion}"implementation"com.android.support:desig

android - ' :app' cannot be executed in the current context - android studio 3. 2.1

我在我的项目中使用OneSignal,如下所示:deftaskRequests=getGradle().getStartParameter().getTaskRequests().toString()defisPlay=!(taskRequests.contains("Foss")||taskRequests.contains("foss"))buildscript{repositories{maven{url'https://plugins.gradle.org/m2/'}}dependencies{classpath'gradle.plugin.com.onesignal:ones

android - 程序类型已经存在 : com. google.common.util.concurrent.ListenableFuture

我刚刚将我的项目转换为androidx,现在收到com.google.common.util.concurrent.ListenableFuture的“程序类型已存在”错误。我查看了多个stackoverflow解决方案和一些Gradle文档,但仍然无法正常工作。问题是Gradle在这些模块中引入了两个版本的ListenableFuture:Gradle:com.google.quava:quava:23.5jre@jarGradle:com.google.guava:listenablefuture:1.0@jar我想我想排除第二个,但不知道该怎么做。您可以在我的gradle文件中看

android - 找不到构建工具修订版 27.1.1。当我尝试下载时,说它没有下载链接 :

这是我的build.gradle文件:buildscript{repositories{google()maven{url'https://maven.fabric.io/public'}maven{url'https://maven.google.com'}maven{url'http://dl.bintray.com/amulyakhare/maven'}maven{url'https://jcenter.bintray.com/'}maven{url"https://jitpack.io"}mavenCentral()}dependencies{classpath'io.fabr

android - MutableLiveData 在 JUnitTest 中为 null

我想写一个单元测试。因此我需要MutableLiveData。我从一个非常基本的设置测试开始,但我无法实例化MutableLiveData对象。运行测试时,我始终为null。我必须mock什么吗?有什么建议么?@RunWith(MockitoJUnitRunner.class)publicclassDefaultLiveDataTest{privatestaticfinalintEXPECTED=5;privatefinalMutableLiveDataunderTest=newMutableLiveData();@TestpublicvoidexampleTest(){underTe

java - 错误 : More than one file was found with OS independent path 'META-INF/DEPENDENCIES'

我正在使用Java中的Selenium制作应用程序。我一直收到此错误,我一直在互联网上搜索以找出问题所在,但我找不到任何东西。请帮忙。这是我的build.gradle:android{compileSdkVersion26defaultConfig{applicationId"luke.luke.seleniumtest"minSdkVersion15targetSdkVersion26versionCode1versionName"1.0"testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"

android - 错误 : Could not find com. google.gms.google-services :4. 2.0

我正在尝试将Firebasecrashlytics添加到现有项目(不是我开发的)。我不断收到错误ERROR:Couldnotfindcom.google.gms.google-services:4.2.0:.Requiredby:project:Searchinbuild.gradlefiles我已经完成了要求添加maven{url'https://maven.google.com的所有(或大部分)解决方案'}并且它们都不起作用。对于所有解决方案,我都收到上述错误。请不要让我开发的其他项目使用相同的build.gradle工作正常,但不确定为什么这个项目给我带来噩梦。projectle

android - 找不到参数的方法 testImplementation() [junit :junit:4. 12]

dependencies{implementationfileTree(dir:'libs',include:['*.jar'])implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"implementation'com.android.support:appcompat-v7:28.0.0'implementation'android.arch.navigation:navigation-fragment:1.0.0-alpha06'implementation'android.arch.navi