- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我得到了
错误。我搜索了一下,解决方案在这里:https://developer.android.com/studio/build/multidex.html
当我应用 android 告诉它自己的解决方案时,我得到另一个错误:
我该怎么办?
更多详情: 网页端:https://developer.android.com/studio/build/multidex.html 基本上是说将 multiDexEnabled true 添加到 app level build gradle 的 defaultConfig 并添加 compile 'com.android.support:multidex:1.0.1'依赖关系。
android {
defaultConfig {
...
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
根据下面的文章,我需要扩展我的应用程序类 MultiDexApplication 像这样
if you do override the Application class, change it to extend MultiDexApplication (if possible) as follows: public class MyApplication extends MultiDexApplication { ... }
import android.support.multidex.MultiDexApplication;
import com.engly.learnenglish.app.util.model.VocabularyModel;
import com.onesignal.OneSignal;
import java.util.ArrayList;
import java.util.List;
public class App extends MultiDexApplication {
private static App instance = null;
private static List<VocabularyModel> vocabularyModelList;
@Override
public void onCreate() {
super.onCreate();
instance = this;
vocabularyModelList = new ArrayList<>();
OneSignal.startInit(this)
.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
.unsubscribeWhenNotificationsAreDisabled(true)
.init();
}
public static App getInstance() {
if (instance == null) {
instance = new App();
}
return instance;
}
public static List<VocabularyModel> getVocabularyModelList() {
return vocabularyModelList;
}
public static void setVocabularyModelList(List<VocabularyModel> vocabularyModelList) {
App.vocabularyModelList = vocabularyModelList;
}
public static void addVocabularyToList(VocabularyModel vocabularyModel){
App.vocabularyModelList.add(vocabularyModel);
}
}
当我应用解决方案时出现此错误
Error:Unexpected type tag 13996 found.
这是我的项目级gradle
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.2'
//in sake of butter knife
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
/*
App version
*/
versionCode = 8
versionName = '2.0.0'
/*
SDK version
*/
buildToolsVersion = '25.0.0'
compileSdkVersion = 25
minSdkVersion = 16
targetSdkVersion = 25
/*
Dependency versions
*/
supportLibVersion = '25.0.0'
butterknifeVersion = '8.4.0'
commonsioVersion = '2.5'
appacheCommonsVersion = '3.4'
googleGsonVersion = '2.7'
relexCircleIndicatorVersion = '1.2.2@aar'
viewpagerTransformsVersion = '1.2.32@aar'
pageLoaderVersion = '0.0.2'
topSnackbarVersion = '1.1.1'
retrofit2Version = '2.0.2'
picassoVersion = '2.5.2'
recyclerTabLayoutVersion = '1.1.0'
okhttpVersion = '2.4.0'
/*
Dependencies
*/
supportLibAppCompat = "com.android.support:appcompat-v7:$supportLibVersion"
supportLibDesign = "com.android.support:design:$supportLibVersion"
supportLibRecyclerView = "com.android.support:recyclerview-v7:$supportLibVersion"
supportLibPercentLayout = "com.android.support:percent:$supportLibVersion"
supportLibCardView = "com.android.support:cardview-v7:$supportLibVersion"
butterknife = "com.jakewharton:butterknife:$butterknifeVersion"
butterknifeApt = "com.jakewharton:butterknife-compiler:$butterknifeVersion"
commonsIo = "commons-io:commons-io:$commonsioVersion"
appacheCommons = "org.apache.commons:commons-lang3:$appacheCommonsVersion"
googleGson = "com.google.code.gson:gson:$googleGsonVersion"
relexCircleIndicator = "me.relex:circleindicator:$relexCircleIndicatorVersion"
picasso = "com.squareup.picasso:picasso:$picassoVersion"
okhttp = "com.squareup.okhttp:okhttp:$okhttpVersion"
retrofit2 = "com.squareup.retrofit2:retrofit:$retrofit2Version"
retrofit2Converter = "com.squareup.retrofit2:converter-gson:$retrofit2Version"
viewpagerTransforms = "com.ToxicBakery.viewpager.transforms:view-pager-transforms:$viewpagerTransformsVersion"
pageLoader = "id.arieridwan:pageloader:$pageLoaderVersion"
topSnackbar = "com.androidadvance:topsnackbar:$topSnackbarVersion"
recyclerTabLayout = "com.nshmura:recyclertablayout:$recyclerTabLayoutVersion"
}
这是我的应用级gradle
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.0'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.android.application'
android {
dexOptions {
jumboMode true
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
manifestPlaceholders = [onesignal_app_id : "2fe20af9-bdcf-49cd-bbfe-6ffd8f11f8c2",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
applicationId 'com.engly.learnenglish.app'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
vectorDrawables {
useSupportLibrary = true
}
generatedDensities = []
multiDexEnabled true
}
lintOptions
{
checkReleaseBuilds false
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
buildToolsVersion '26.0.2'
}
dependencies {
implementation 'com.google.firebase:firebase-messaging:11.8.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
//support lib
compile rootProject.ext.supportLibAppCompat
compile rootProject.ext.supportLibPercentLayout
compile rootProject.ext.supportLibRecyclerView
compile rootProject.ext.supportLibCardView
compile rootProject.ext.supportLibDesign
//butterknife
compile rootProject.ext.butterknife
annotationProcessor rootProject.ext.butterknifeApt
//commons
compile rootProject.ext.commonsIo
compile rootProject.ext.appacheCommons
//gson
compile rootProject.ext.googleGson
//circle indicator
compile rootProject.ext.relexCircleIndicator
//piccasso
compile rootProject.ext.picasso
//retrofit
compile rootProject.ext.okhttp
compile rootProject.ext.retrofit2
compile rootProject.ext.retrofit2Converter
//recyclerview tablayout
compile rootProject.ext.recyclerTabLayout
//viewpager animation
compile rootProject.ext.viewpagerTransforms
//page loader
compile rootProject.ext.pageLoader
//top position snackbar
compile rootProject.ext.topSnackbar
implementation 'com.facebook.android:facebook-login:[4,5)'
compile 'com.android.support:multidex:1.0.1'
compile 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
compile 'com.github.michaelye.easydialog:easydialog:1.4'
compile 'com.hbb20:ccp:1.7.8'
compile 'com.googlecode.libphonenumber:libphonenumber:8.4.2'
compile 'com.google.android.exoplayer:exoplayer:r2.4.1'
compile 'com.mikhaellopez:circularprogressbar:1.1.1'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.victor:lib:1.0.4'
compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
compile 'me.grantland:autofittextview:0.2.1'
compile 'com.appsee:appsee-android:2.3.3'
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
来自 idea.log 的完整版本 gradle 错误
com.intellij.openapi.externalSystem.model.ExternalSystemException: Unexpected type tag 13996 found.
at com.android.tools.idea.gradle.project.sync.idea.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:85)
at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:414)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:906)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:886)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:218)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:139)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:79)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:45)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:66)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:139)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:125)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:388)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:445)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:137)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Unexpected type tag 13996 found.
at org.gradle.internal.serialize.DefaultSerializerRegistry$TaggedTypeSerializer.read(DefaultSerializerRegistry.java:142)
at org.gradle.internal.serialize.Serializers$StatefulSerializerAdapter$1.read(Serializers.java:36)
at org.gradle.internal.remote.internal.inet.SocketConnection.receive(SocketConnection.java:79)
at org.gradle.launcher.daemon.client.DaemonClientConnection.receive(DaemonClientConnection.java:75)
at org.gradle.launcher.daemon.client.DaemonClientConnection.receive(DaemonClientConnection.java:35)
at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:210)
at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:178)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:141)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:92)
at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:60)
at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:41)
at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:60)
at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:34)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:143)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:128)
at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:208)
at org.gradle.tooling.internal.consumer.connection.CancellableConsumerConnection$CancellableActionRunner.run(CancellableConsumerConnection.java:99)
at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:62)
at org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:53)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:71)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:84)
at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
最佳答案
Error:Unexpected type tag 13996 found.
原因是一个信号。当您将 multiDexEnabled true
与 onesignal 一起使用时,它会导致 Unexpected type tag 13996 found
错误。
应该是bug。将 版本“0.8.0”
更新为 版本“0.8.1”
后,问题将得到修复。
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
更多信息:https://github.com/OneSignal/OneSignal-Gradle-Plugin/issues/15和 https://github.com/OneSignal/OneSignal-Android-SDK/issues/391
**
为方法数超过 64K 的应用启用 Multidex
**
您可以通过此网页端信息修复它:https://developer.android.com/studio/build/multidex.html
我所做的是检查我的 Module:app
级别 gradle
中的所有库,以便找到未使用的资源和库。问题的平均原因是使用了很多方法。如果你的项目不是很大,你可能不会写那么多方法。事实上,原因应该是您经常使用的库或从不从中调用任何单一方法。您应该找到未使用的库或您添加的不必要的库。当您从这个库中清理您的项目时,问题应该得到解决。如果您无法删除任何库,请按照以下步骤操作:
关于java - 错误 :Unexpected type tag 13996 found. 或为方法数超过 64K 的应用启用 Multidex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48213865/
我正在通过 labrepl 工作,我看到了一些遵循此模式的代码: ;; Pattern (apply #(apply f %&) coll) ;; Concrete example user=> (a
我从未向应用商店提交过应用,但我会在不久的将来提交。 到目前为止,我对为 iPhone 而非 iPad 进行设计感到很自在。 我了解,通过将通用PAID 应用放到应用商店,客户只需支付一次就可以同时使
我有一个应用程序,它使用不同的 Facebook 应用程序(2 个不同的 AppID)在 Facebook 上发布并显示它是“通过 iPhone”/“通过 iPad”。 当 Facebook 应用程序
我有一个要求,我们必须通过将网站源文件保存在本地 iOS 应用程序中来在 iOS 应用程序 Webview 中运行网站。 Angular 需要服务器来运行应用程序,但由于我们将文件保存在本地,我们无法
所以我有一个单页客户端应用程序。 正常流程: 应用程序 -> OAuth2 服务器 -> 应用程序 我们有自己的 OAuth2 服务器,因此人们可以登录应用程序并获取与用户实体关联的 access_t
假设我有一个安装在用户设备上的 Android 应用程序 A,我的应用程序有一个 AppWidget,我们可以让其他 Android 开发人员在其中以每次安装成本为基础发布他们的应用程序推广广告。因此
Secrets of the JavaScript Ninja中有一个例子它提供了以下代码来绕过 JavaScript 的 Math.min() 函数,该函数需要一个可变长度列表。 Example:
当我分别将数组和对象传递给 function.apply() 时,我得到 NaN 的 o/p,但是当我传递对象和数组时,我得到一个数字。为什么会发生这种情况? 由于数组也被视为对象,为什么我无法使用它
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界. 这篇CFSDN的博客文章ASP转换格林威治时间函数DateDiff()应用由作者收集整理,如果你
我正在将列表传递给 map并且想要返回一个带有合并名称的 data.frame 对象。 例如: library(tidyverse) library(broom) mtcars %>% spl
我有一个非常基本的问题,但我不知道如何实现它:我有一个返回数据框,其中每个工具的返回值是按行排列的: tmp<-as.data.frame(t(data.frame(a=rnorm(250,0,1)
我正在使用我的 FB 应用创建群组并邀请用户加入我的应用群组,第一次一切正常。当我尝试创建另一个组时,出现以下错误: {"(OAuthException - #4009) (#4009) 在有更多用户
我们正在开发一款类似于“会说话的本”应用程序的 child 应用程序。它包含大量用于交互式动画的 JPEG 图像序列。 问题是动画在 iPad Air 上播放正常,但在 iPad 2 上播放缓慢或滞后
我关注 clojure 一段时间了,它的一些功能非常令人兴奋(持久数据结构、函数式方法、不可变状态)。然而,由于我仍在学习,我想了解如何在实际场景中应用,证明其好处,然后演化并应用于更复杂的问题。即,
我开发了一个仅使用挪威语的应用程序。该应用程序不使用本地化,因为它应该仅以一种语言(挪威语)显示。但是,我已在 Info.plist 文件中将“本地化 native 开发区域”设置为“no”。我还使用
读完 Anthony's response 后上a style-related parser question ,我试图说服自己编写单体解析器仍然可以相当紧凑。 所以而不是 reference ::
multicore 库中是否有类似 sapply 的东西?还是我必须 unlist(mclapply(..)) 才能实现这一点? 如果它不存在:推理是什么? 提前致谢,如果这是一个愚蠢的问题,我们深表
我喜欢在窗口中弹出结果,以便更容易查看和查找(例如,它们不会随着控制台继续滚动而丢失)。一种方法是使用 sink() 和 file.show()。例如: y <- rnorm(100); x <- r
我有一个如下所示的 spring mvc Controller @RequestMapping(value="/new", method=RequestMethod.POST) public Stri
我正在阅读 StructureMap关于依赖注入(inject),首先有两部分初始化映射,具体类类型的接口(interface),另一部分只是实例化(请求实例)。 第一部分需要配置和设置,这是在 Bo
我是一名优秀的程序员,十分优秀!