2.将字节码转换为DEX时出错:cause:java.lang.RuntimeException:异常解析类-Android studio 2.0 beta 6
下面是application Build.Gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId 'XX.XX.XXX'
minSdkVersion 21
targetSdkVersion 23
versionCode 9
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
sourceSets.main {
jni.srcDirs = [] //disable automatic ndk-build call
jniLibs.srcDir 'src/main/libs' //integrate your libs from libs instead of jniLibs
}
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
lintOptions {
checkReleaseBuilds false
}
packagingOptions {
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
// compile files('libs/maflogonimo-1.210.3.jar')
compile project(':android-logging-log4j-1.0.3')
compile project(':log4j-1.2.17')
compile files('libs/gson-2.6.2.jar')
//compile files('libs/javarosa-libraries-2015-09-02.jar')
compile 'com.android.support:design:23.4.0'
//compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
// compile 'com.google.android.gms:play-services:10.0.1'
// compile 'com.google.android.gms:play-services-fcm:9.6.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
// compile 'com.viewpagerindicator:library:2.4.1@aar'
//compile files('libs/hellocharts-library-1.5.8.jar')
compile 'com.esri.arcgis.android:arcgis-android:10.2.8-1'
//GIS
compile(name:'ClientHubSLL-3.16.1', ext:'aar')
compile(name:'ClientLog-3.16.1', ext:'aar')
compile(name:'Common-3.16.1', ext:'aar')
compile(name:'Connectivity-3.16.1', ext:'aar')
compile(name:'CoreServices-3.16.1', ext:'aar')
compile(name:'DataVaultLib-3.16.1', ext:'aar')
compile(name:'E2ETrace-3.16.1', ext:'aar')
compile(name:'HttpConvAuthFlows-3.16.1', ext:'aar')
compile(name:'HttpConversation-3.16.1', ext:'aar')
compile(name:'MAFLogger-3.16.1', ext:'aar')
compile(name:'MAFLogonCore-3.16.1', ext:'aar')
compile(name:'ODataAPI-3.16.1', ext:'aar')
compile(name:'ODataOnline-3.16.1', ext:'aar')
compile(name:'Request-3.16.1', ext:'aar')
compile(name:'SupportabilityFacade-3.16.1', ext:'aar')
compile(name:'MAFCalendar-3.16.1', ext:'aar')
compile(name:'MAFLocaleAwareControls-3.16.1', ext:'aar')
compile(name:'MAFLogViewer-3.16.1', ext:'aar')
compile(name:'MAFSettingScreen-3.16.1', ext:'aar')
compile(name:'MAFTreeView-3.16.1', ext:'aar')
compile(name:'MAFUIComponents-3.16.1', ext:'aar')
compile(name:'XscriptParser-3.16.1', ext:'aar')
compile(name:'MAFLogonUI-3.16.1', ext:'aar')
compile(name:'MobilePlace-3.16.1', ext:'aar')
}
apply plugin: 'com.google.gms.google-services'
-renamesourcefileattribute SourceFile
-keepattributes SourceFile, LineNumberTable
-keepattributes Exceptions, Signature
-keepattributes EnclosingMethod
-keepattributes InnerClasses
-keep class org.javarosa.** { *; }
-keep class com.sap.** { *; }
-keep class jcifs.** { *; }
-dontwarn com.google.**
-dontwarn org.apache.**
-dontwarn com.sap.**
-dontwarn au.com.bytecode.**
-dontwarn org.joda.**
-dontwarn android.content.**
-dontwarn android.graphics.**
-dontwarn android.util.**
-dontwarn android.view.**
-dontwarn javax.servlet.**
-dontwarn jcifs.http.**
-dontwarn org.codehaus.**
cause: java.lang.RuntimeException: Exception parsing classes
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
at com.android.dx.command.dexer.Main.processClass(Main.java:752)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:672)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
at com.android.dx.command.dexer.Main.run(Main.java:275)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Caused by: com.android.dx.cf.iface.ParseException: bad descriptor: charOffset
at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:156)
at com.android.dx.cf.direct.AttributeListParser.parseIfNecessary(AttributeListParser.java:115)
at com.android.dx.cf.direct.AttributeListParser.getEndOffset(AttributeListParser.java:96)
at com.android.dx.cf.direct.MemberListParser.parse(MemberListParser.java:213)
at com.android.dx.cf.direct.MemberListParser.parseIfNecessary(MemberListParser.java:108)
at com.android.dx.cf.direct.MethodListParser.getList(MethodListParser.java:54)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:542)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
at com.android.dx.command.dexer.Main.processClass(Main.java:749)
... 12 more
Caused by: java.lang.IllegalArgumentException: bad descriptor: charOffset
at com.android.dx.rop.type.Type.intern(Type.java:330)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotation(AnnotationParser.java:248)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotations(AnnotationParser.java:223)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotationsList(AnnotationParser.java:188)
at com.android.dx.cf.direct.AnnotationParser.parseParameterAttribute(AnnotationParser.java:127)
at com.android.dx.cf.direct.StdAttributeFactory.runtimeVisibleParameterAnnotations(StdAttributeFactory.java:666)
at com.android.dx.cf.direct.StdAttributeFactory.parse0(StdAttributeFactory.java:162)
at com.android.dx.cf.direct.AttributeFactory.parse(AttributeFactory.java:96)
at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:141)
... 25 more
16:35:57.798 [ERROR] [org.gradle.api.Project] 1 error; aborting
16:35:57.800 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:transformClassesWithDexForRelease'
16:35:57.801 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app:transformClassesWithDexForRelease FAILED
16:35:57.804 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app:transformClassesWithDexForRelease (Thread[Daemon worker,5,main]) completed. Took 1 mins 1.425 secs.
16:35:57.807 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker,5,main]] finished, busy: 14 mins 11.51 secs, idle: 0.078 secs
16:35:57.870 [ERROR] [org.gradle.BuildExceptionReporter]
16:35:57.871 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:35:57.872 [ERROR] [org.gradle.BuildExceptionReporter]
16:35:57.872 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
16:35:57.872 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':app:transformClassesWithDexForRelease'.
16:35:57.873 [ERROR] [org.gradle.BuildExceptionReporter] > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_161\bin\java.exe'' finished with non-zero exit value 1
16:35:57.874 [ERROR] [org.gradle.BuildExceptionReporter]
16:35:57.875 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
16:35:57.877 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
16:35:57.878 [LIFECYCLE] [org.gradle.BuildResultLogger]
16:35:57.878 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
16:35:57.880 [LIFECYCLE] [org.gradle.BuildResultLogger]
16:35:57.880 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 14 mins 46.244 secs
16:35:57.930 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileHashes.bin (D:\myJobCard_SourceCode\.gradle\2.10\taskArtifacts\fileHashes.bin)
16:35:57.931 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileSnapshots.bin (D:\myJobCard_SourceCode\.gradle\2.10\taskArtifacts\fileSnapshots.bin)
16:35:57.932 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache taskArtifacts.bin (D:\myJobCard_SourceCode\.gradle\2.10\taskArtifacts\taskArtifacts.bin)
16:35:57.933 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache outputFileStates.bin (D:\myJobCard_SourceCode\.gradle\2.10\taskArtifacts\outputFileStates.bin)
16:35:57.933 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on task history cache (D:\myJobCard_SourceCode\.gradle\2.10\taskArtifacts).
16:35:57.935 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache jarSnapshots.bin (C:\Users\MY HOME\.gradle\caches\2.10\jarSnapshots\jarSnapshots.bin)
16:35:57.935 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on jar snapshots cache (C:\Users\MY HOME\.gradle\caches\2.10\jarSnapshots).
16:35:57.937 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache classAnalysis.bin (C:\Users\MY HOME\.gradle\caches\2.10\classAnalysis\classAnalysis.bin)
16:35:57.937 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on class analysis cache (C:\Users\MY HOME\.gradle\caches\2.10\classAnalysis).
16:35:57.939 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_settings class cache for settings file 'D:\myJobCard_SourceCode\settings.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\settings_erwoxweslgmu8miqym6kcb1dt\cp_settings).
16:35:57.939 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on settings class cache for settings file 'D:\myJobCard_SourceCode\settings.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\settings_erwoxweslgmu8miqym6kcb1dt\settings).
16:35:57.940 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj class cache for build file 'D:\myJobCard_SourceCode\build.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\build_7pkieelf3zpr7uf7k01l63rmx\cp_proj).
16:35:57.940 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on proj class cache for build file 'D:\myJobCard_SourceCode\build.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\build_7pkieelf3zpr7uf7k01l63rmx\proj).
16:35:57.940 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj class cache for build file 'D:\myJobCard_SourceCode\android-logging-log4j-1.0.3\build.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\build_7utva779gtlkclvebpnh750jk\cp_proj).
16:35:57.941 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on proj class cache for build file 'D:\myJobCard_SourceCode\android-logging-log4j-1.0.3\build.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\build_7utva779gtlkclvebpnh750jk\proj).
16:35:57.941 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj class cache for build file 'D:\myJobCard_SourceCode\app\build.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\build_56xn5xy2yld7cwkurxonzuovl\cp_proj).
16:35:57.942 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on proj class cache for build file 'D:\myJobCard_SourceCode\app\build.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\build_56xn5xy2yld7cwkurxonzuovl\proj).
16:35:57.942 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj class cache for build file 'D:\myJobCard_SourceCode\log4j-1.2.17\build.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\build_8bsoptu904i00rpm86ii2r5ih\cp_proj).
16:35:57.942 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on proj class cache for build file 'D:\myJobCard_SourceCode\log4j-1.2.17\build.gradle' (C:\Users\MY HOME\.gradle\caches\2.10\scripts\build_8bsoptu904i00rpm86ii2r5ih\proj).
16:35:57.944 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
16:35:57.945 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 8 (avg: 0.006 secs, total: 0.049 secs)
16:35:57.946 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 2 resolution results binary files in 0.003 secs
16:35:57.946 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory] In-memory dependency metadata cache closed. Repos cached: 41, cache instances: 5, modules served from cache: 702, artifacts: 49
16:35:57.946 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-artifacts.bin (C:\Users\MY HOME\.gradle\caches\modules-2\metadata-2.16\module-artifacts.bin)
16:35:57.947 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-metadata.bin (C:\Users\MY HOME\.gradle\caches\modules-2\metadata-2.16\module-metadata.bin)
16:35:57.947 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-repository.bin (C:\Users\MY HOME\.gradle\caches\modules-2\metadata-2.16\artifact-at-repository.bin)
16:35:57.947 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on artifact cache (C:\Users\MY HOME\.gradle\caches\modules-2).
16:35:57.949 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Plugin Resolution Cache (C:\Users\MY HOME\.gradle\caches\2.10\plugin-resolution) was closed 0 times.
16:35:57.950 [DEBUG] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopping 0 compiler daemon(s).
16:35:57.950 [INFO] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopped 0 compiler daemon(s).
16:35:57.952 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has finished executing the build.
16:36:45.960 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientInputForwarder] Dispatching close input message: org.gradle.launcher.daemon.protocol.CloseInput@66269a8
16:36:45.966 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 17: dispatching class org.gradle.launcher.daemon.protocol.CloseInput
16:36:45.971 [INFO] [org.gradle.launcher.daemon.client.DaemonClient] Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformClassesWithDexForRelease'.] from daemon DaemonInfo{pid=22532, address=[dcdd43f4-9cff-4985-9851-6f1b9dfca80e port:65391, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], idle=false, context=DefaultDaemonContext[uid=b61dca0a-e70c-4dec-98ed-b69fe929e57e,javaHome=C:\Program Files\Java\jdk1.8.0_161,daemonRegistryDir=C:\Users\MY HOME\.gradle\daemon,pid=22532,idleTimeout=120000,daemonOpts=-Xmx4096m,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
16:36:45.977 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Finished
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.xxxxxxxxxxcccccccvvvvvv.apps.firebase"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
shrinkResources true
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
它总是推荐使用Android Studio而不是任何其他IDE,因为它是谷歌官方的,因为Android是…并且它必须是最新更新的IDE,并且至少启用了API26。正如谷歌上周强制规定的那样,要在google play上上传应用程序,应用程序必须以api级别26为目标。
我试图理解一个API参考描述,但我很难理解它的含义: http://mongodb.github.io/node-mongodb-native/2.2/api/Cursor.html#toArray 上面写着 'toArray(回调)- 我知道回调相当于一个“块”,但有一个指向“promise”的箭头符号意味着什么?
我无法在调试和发布模式下使用minifyEnabled true运行apk。 请帮我拿一下这个,先谢谢你。
问题内容: 我知道我们不能像其他几种语言中那样在Java的if语句中使用赋值运算符。 那是 将给出编译错误。 但是以下代码可以正常工作,如何? 编辑:这是不能在if语句中使用赋值的例外规则。 问题答案: 因为赋值的“结果”是赋值的值,所以在第二种情况下它仍然是表达式。表达式要求条件是表达式,第二个但不是第一个满足。实际上,您的两个片段是: 和 通过该扩展是否可以编译第二个版本而不是第一个版本? 这
我当时在做一个计算机科学测试,并尝试了这个问题。 据我所知,我认为打印输出是假的,因为据我所知,字符串只能与。等于()。但我弄错了。它说答案是假的,是真的。有人能解释一下原因吗?
问题内容: 我正在尝试使用AngularUI路由器进行一些身份验证。看起来正是我所需要的。但是,仅当我拦截时可用。但是当我这样做时,它是空的,而我希望它是当前状态。 到目前为止,这是我的代码: 关于我在做什么错的任何指示? 问题答案: 我建议走更多的路。我们应该使用适当提供的事件。这是一个有效的例子 让我们观察一下简单的 (但不是幼稚的) 解决方案,它可以在以后扩展到任何程度。 首先,让我们定义用
我在理解密钥库和信任库的概念方面有问题。 哪个应用程序保留keystore,哪个应用程序保留truststore? 我在网上找不到任何好的资源。如果有人能清楚地描述truststore和KeyStore之间的区别,我会非常感激吗?