- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试启用 MultiDex。我添加了 multiDexEnabled true
和 compile 'com.android.support:multidex:1.0.3'
构建.gradle。我做了一个java文件
public class ApplicationClass extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this); // <----------
}
}
并添加了android:name=".ApplicationClass"
list 文件。
但是在java文件中,在MultiDex.install(this);
MultiDex 部分是红色的,上面写着 Cannot resolve symbol 'MultiDex'
.并且 gradle 同步失败。我也尝试添加 android:name="android.support.multidex.MultiDexApplication"
显示,而不是创建 java 文件和扩展应用程序类。它也没有用。零件MultiDexApplication
是红色的,上面写着unresolved class 'MultiDexApplication'
我认为我系统中的 android 支持库有问题。 Multidex 来自这个库。此外,当我更改任何 'com.android.support:appcompat-v7:26.+'
时(到 Android Studio 建议的特定版本 26.0.1)或 'com.android.support.constraint:constraint-layout:1.0.2'
(到较新的版本 1.1.2),gradle sync 失败。
我调查了 <SDK>/extras
目录。我看到有三个不同的支持目录。不确定这是否与问题有关。
构建.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.vvaezian.multilingovocabularypractice"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true <--- added ---
}
buildTypes {
debug {
buildConfigField 'String', "ApiKey", MultiLingo_ApiKey
}
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField 'String', "ApiKey", MultiLingo_ApiKey
}
}
packagingOptions {
exclude 'project.properties'
exclude 'META-INF/INDEX.LIST'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.mcxiaoke.volley:library:1.0.19'
testImplementation 'junit:junit:4.12'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation('com.google.cloud:google-cloud-translate:1.3.1') {
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.json', module: 'json'
}
annotationProcessor 'com.google.cloud:google-cloud-translate:1.3.1'
compile 'com.android.support:multidex:1.0.3' // <----- added ----
// using 'implementation' instead of 'compile' didn't resolve the issue
}
日志文件也没有说明 gradle sync 失败的原因。只有一行写着 Too many events posted ...
2018-08-01 13:56:54,922 [e-1024-b01] INFO - e.project.sync.GradleSyncState - Started sync with Gradle for project 'MultiLingoVocabularyPractice'.
2018-08-01 13:56:54,924 [e-1024-b01] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SYNC_STARTED
2018-08-01 13:56:54,924 [e-1024-b01] INFO - idea.project.IndexingSuspender - Starting batch update for project: Project '/local-scratch/vvaezian/AndroidStudioProjects/MultiLingoVocabularyPractice' MultiLingoVocabularyPractice
2018-08-01 13:56:54,934 [hread 1914] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /local-scratch/vvaezian/android-studio/jre
2018-08-01 13:56:54,935 [hread 1914] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /local-scratch/vvaezian/android-studio/jre
2018-08-01 13:56:54,943 [hread 1914] INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Didea.version=3.1 -Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.model.only.versioned=3 -Pandroid.injected.studio.version=3.1.3.0 -Pandroid.builder.sdkDownload=false --init-script /tmp/ijinit.gradle
2018-08-01 13:56:57,640 [hread 1916] INFO - agnostic.FrequentEventDetector - Too many events posted, #7. Event: java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=LaterInvocator.FlushQueue,notifier=null,catchExceptions=false,when=1533157017640] on sun.awt.X11.XToolkit@5b185819
2018-08-01 13:56:57,676 [hread 1914] INFO - e.project.sync.GradleSyncState - Started setup of project 'MultiLingoVocabularyPractice'.
2018-08-01 13:56:57,677 [e-1024-b01] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SETUP_STARTED
2018-08-01 13:56:57,789 [hread 1916] INFO - idea.project.IndexingSuspender - Indexing suspended (context: Project Setup)
2018-08-01 13:56:57,995 [e-1024-b01] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 26 Platform (1)' (/local-scratch/vvaezian/SDK) to module 'app'
2018-08-01 13:56:58,005 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/build-tools/26.0.1/package.xml
2018-08-01 13:56:58,009 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/build-tools/27.0.3/package.xml
2018-08-01 13:56:58,012 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/emulator/package.xml
2018-08-01 13:56:58,016 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/extras/android/m2repository/package.xml
2018-08-01 13:56:58,020 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/extras/google/m2repository/package.xml
2018-08-01 13:56:58,024 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.2/package.xml
2018-08-01 13:56:58,028 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/extras/m2repository/com/android/support/constraint/constraint-layout/1.0.2/package.xml
2018-08-01 13:56:58,032 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/patcher/v4/package.xml
2018-08-01 13:56:58,035 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platform-tools/package.xml
2018-08-01 13:56:58,039 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platforms/android-23/package.xml
2018-08-01 13:56:58,042 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platforms/android-24/package.xml
2018-08-01 13:56:58,045 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platforms/android-25/package.xml
2018-08-01 13:56:58,049 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platforms/android-26/package.xml
2018-08-01 13:56:58,053 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/sources/android-26/package.xml
2018-08-01 13:56:58,056 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/system-images/android-24/google_apis_playstore/x86/package.xml
2018-08-01 13:56:58,060 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/system-images/android-26/google_apis/x86/package.xml
2018-08-01 13:56:58,063 [hread 1917] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/tools/package.xml
2018-08-01 13:56:58,118 [hread 1914] INFO - e.project.sync.GradleSyncState - Gradle sync failed (3s 196ms)
2018-08-01 13:56:58,120 [e-1024-b01] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED
2018-08-01 13:56:58,120 [e-1024-b01] INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project '/local-scratch/vvaezian/AndroidStudioProjects/MultiLingoVocabularyPractice' MultiLingoVocabularyPractice
2018-08-01 13:56:58,150 [e-1024-b01] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-08-01 13:56:58,169 [hread 1916] INFO - idea.project.IndexingSuspender - Indexing released (context: Project Setup)
2018-08-01 13:56:58,199 [hread 1916] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 2ms; general responsiveness: ok; EDT responsiveness: ok
2018-08-01 13:56:58,254 [hread 1916] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 55ms; general responsiveness: ok; EDT responsiveness: ok
2018-08-01 13:56:58,303 [hread 1916] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2018-08-01 13:56:58,304 [hread 1916] INFO - #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files
2018-08-01 13:56:58,305 [hread 1916] INFO - #com.jetbrains.cidr.lang - Loading Module Maps finished in 0 s.
2018-08-01 13:56:58,305 [hread 1916] INFO - #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-08-01 13:56:58,305 [hread 1916] INFO - #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-08-01 13:56:58,305 [hread 1916] INFO - #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files)
2018-08-01 13:56:58,305 [hread 1916] INFO - #com.jetbrains.cidr.lang - Building symbols for 0 source files
2018-08-01 13:56:58,306 [hread 1916] INFO - #com.jetbrains.cidr.lang - Building symbols for 0 unused headers
2018-08-01 13:56:58,307 [hread 1916] INFO - #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2018-08-01 13:56:58,307 [hread 1916] INFO - #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0)
2018-08-01 13:56:58,307 [hread 1916] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
最佳答案
MultiDex.install(this);
在应用程序中删除了这一行enter code here
关于android - 无法解析符号 'MultiDex',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51622042/
我通过 spring ioc 编写了一些 Rest 应用程序。但我无法解决这个问题。这是我的异常(exception): org.springframework.beans.factory.BeanC
我对 TestNG、Spring 框架等完全陌生,我正在尝试使用注释 @Value通过 @Configuration 访问配置文件注释。 我在这里想要实现的目标是让控制台从配置文件中写出“hi”,通过
为此工作了几个小时。我完全被难住了。 这是 CS113 的实验室。 如果用户在程序(二进制计算器)结束时选择继续,我们需要使用 goto 语句来到达程序的顶部。 但是,我们还需要释放所有分配的内存。
我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出: Error code:
使用 Spring Initializer 创建一个简单的 Spring boot。我只在可用选项下选择 DevTools。 创建项目后,无需对其进行任何更改,即可正常运行程序。 现在,当我尝试在项目
所以我只是在 Mac OS X 中通过 brew 安装了 qt。但是它无法链接它。当我尝试运行 brew link qt 或 brew link --overwrite qt 我得到以下信息: ton
我在提交和 pull 时遇到了问题:在提交的 IDE 中,我看到: warning not all local changes may be shown due to an error: unable
我跑 man gcc | grep "-L" 我明白了 Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more inf
我有一段代码,旨在接收任何 URL 并将其从网络上撕下来。到目前为止,它运行良好,直到有人给了它这个 URL: http://www.aspensurgical.com/static/images/a
在过去的 5 个小时里,我一直在尝试在我的服务器上设置 WireGuard,但在完成所有设置后,我无法 ping IP 或解析域。 下面是服务器配置 [Interface] Address = 10.
我正在尝试在 GitLab 中 fork 我的一个私有(private)项目,但是当我按下 fork 按钮时,我会收到以下信息: No available namespaces to fork the
我这里遇到了一些问题。我是 node.js 和 Rest API 的新手,但我正在尝试自学。我制作了 REST API,使用 MongoDB 与我的数据库进行通信,我使用 Postman 来测试我的路
下面的代码在控制台中给出以下消息: Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child el
我正在尝试调用一个新端点来显示数据,我意识到在上一组有效的数据中,它在数据周围用一对额外的“[]”括号进行控制台,我认为这就是问题是,而新端点不会以我使用数据的方式产生它! 这是 NgFor 失败的原
我正在尝试将我的 Symfony2 应用程序部署到我的 Azure Web 应用程序,但遇到了一些麻烦。 推送到远程时,我在终端中收到以下消息 remote: Updating branch 'mas
Minikube已启动并正在运行,没有任何错误,但是我无法 curl IP。我在这里遵循:https://docs.traefik.io/user-guide/kubernetes/,似乎没有提到关闭
每当我尝试docker组成任何项目时,都会出现以下错误。 我尝试过有和没有sudo 我在这台机器上只有这个问题。我可以在Mac和Amazon WorkSpace上运行相同的容器。 (myslabs)
我正在尝试 pip install stanza 并收到此消息: ERROR: No matching distribution found for torch>=1.3.0 (from stanza
DNS 解析看起来不错,但我无法 ping 我的服务。可能是什么原因? 来自集群中的另一个 Pod: $ ping backend PING backend.default.svc.cluster.l
我正在使用Hibernate 4 + Spring MVC 4当我开始 Apache Tomcat Server 8我收到此错误: Error creating bean with name 'wel
我是一名优秀的程序员,十分优秀!