标签: android-multidex

Android 如何检查 .apk 是否使用 Multidex?

我从同事那里得到了一个“旧的”.apk 版本,我想检查它是否支持Multidex。但是我没有旧的项目文件,是否可以仅从 .apk 中检查它?

android apk android-multidex

2
推荐指数
1
解决办法
567
查看次数

谷歌地图没有找到类“com.google.android.gms.dynamic.zza”

我一直在关注有关实现 google maps android sdk 的本教程,并遇到了标题中提到的错误。此问题末尾提供了崩溃详细信息。我一直在关注很多 SO 线程,但没有结果。到目前为止,一些谷歌也没有证明任何事情。

我尝试过哪些失败的修复:

  • 禁用多索引
  • 禁用“即时运行”
  • 更改/降级各种组合的版本

你们有线索吗?

这是我的 Gradle 应用配置:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'

repositories {
    maven { url 'https://maven.fabric.io/public' }
    google()
}

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.akukurir.android"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 33
        versionName "1.7.7~beta6"

        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled …
Run Code Online (Sandbox Code Playgroud)

java android google-maps android-multidex

2
推荐指数
1
解决办法
1535
查看次数

找不到 com.androidx.multidex:multidex:2.0.1

> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Could not find com.androidx.multidex:multidex:2.0.1.
     Required by:
         project :app
Run Code Online (Sandbox Code Playgroud)

在我的项目中添加 multidex 后出现此错误

android fragment kotlin android-multidex android-viewpager2

2
推荐指数
1
解决办法
5539
查看次数

Dexing 时出现错误。flutter 升级到 3.19.0 后

升级到 flutter 3.19.0 后,我在 android 上运行我的应用程序时收到以下错误,它在 ios 上工作正常,当我在 android studio 中仅打开 android 目录并运行该项目时,在这种情况下它也工作正常。

ERROR:D8: com.android.tools.r8.kotlin.H
ERROR:D8: com.android.tools.r8.kotlin.H
ERROR:D8: com.android.tools.r8.kotlin.H
ERROR:D8: com.android.tools.r8.kotlin.H

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform firebase-auth-22.3.1.aar (com.google.firebase:firebase-auth:22.3.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /home/munsif/.gradle/caches/transforms-3/ba579288272952d282e3eb784bb3facc/transformed/jetified-firebase-auth-22.3.1-runtime.jar.
         > Error while dexing.
   > Failed to transform play-services-location-21.1.0.aar (com.google.android.gms:play-services-location:21.1.0) …
Run Code Online (Sandbox Code Playgroud)

android gradle android-gradle-plugin android-multidex flutter

2
推荐指数
1
解决办法
660
查看次数

为什么我得到重复的条目:com / google / common / base / FinalizableReference.class?

当我将Microsoft Azure移动服务SDK添加到我的项目中时:

compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.2'
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/common/base/FinalizableReference.class
Run Code Online (Sandbox Code Playgroud)

可能是什么原因,我该如何解决?
我猜我可以为Gradle制定一些排除规则,但是看起来怎么样?

android android-studio android-gradle-plugin android-multidex

1
推荐指数
1
解决办法
1744
查看次数

Android应用程序中的OAuth

我需要OAuth在我的Android应用程序中使用协议.我决定使用android-oauth-client.在我的build.gradle档案中,我有:

dependencies {        
    compile 'com.android.support:appcompat-v7:21.0.0'
    compile 'com.wu-man:android-oauth-client:0.0.3'    
}
Run Code Online (Sandbox Code Playgroud)

使用gradle文件同步项目工作正常,但是当我尝试构建我的应用程序时,存在一个问题:

错误:任务':app:dexDebug'的执行失败.com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files\Java\jdk1.7.0_51\bin\java.exe''以非完成零退出值2

我发现,我应该尝试添加multiDexEnabled truedefaultConfig部分build.gradle.第一个问题已经解决,但还有另一个问题:

错误:任务':app:packageAllDebugClassesForMultiDex'的执行失败.java.util.zip.ZipException:重复条目:android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat $ AccessibilityServiceInfoIcsImpl.class

我不知道如何修复它以及如何构建我的项目.你能帮我吗?提前致谢.

android oauth gradle android-multidex

1
推荐指数
1
解决办法
1152
查看次数

运行签名apk时出现Dexguard错误

我使用的是Android Studio,我的项目有5个模块.

在运行已签名的混淆apk时,我收到以下错误无法实例化应用程序com ... FTApplication:java.lang.ClassNotFoundException:未在路径上找到类"com .... FTApplication":DexPathList [[zip文件] "/data/app/app.apk".

这是我的配置

DexGuard6.1.03 com.android.tools.build:gradle:1.0.0 - 依赖应用程序从MultiDexApplication扩展.

的Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.project.package">
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:name="com.project.package.FTApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />



        <activity
            android:name=".ui.activity.FTSplashActivity"
            android:label="@string/app_name"
            android:noHistory="true"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

顶级build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the …
Run Code Online (Sandbox Code Playgroud)

android dexguard android-multidex

1
推荐指数
1
解决办法
3022
查看次数

意外的最高级别异常:com.android.dex.DexIndexOverflowException:方法ID不在[0,0xffff]中:65536

我的Gradle文件中有以下依赖项:

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "packagename"
        minSdkVersion 10
        targetSdkVersion 23
    }

    sourceSets {
        main {
            jni.srcDirs = []
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:23.0.1'
    compile files('libs/FLurry_3.2.2.jar')
    compile files('libs/pixel-perfect-collision.jar')
    compile files('libs/twitter4j-core-3.0.3.jar')
    compile project(':zip_file')
    compile project(':andEngine')
    compile project(':andEnginePhysicsBox2DExtension')
    compile project(':downloader_library')
    compile project(':viewPagerLibrary')
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'org.apache.commons:commons-lang3:3.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:23.0.1'
}
Run Code Online (Sandbox Code Playgroud)

在构建gradle文件时,我得到以下错误:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: …
Run Code Online (Sandbox Code Playgroud)

android andengine android-studio android-multidex

1
推荐指数
1
解决办法
2412
查看次数

NoClassDefFoundError:com.squareup.picasso.Picasso with phone

我在运行少于API版本21的手机上得到noClassDefFoundError.首先它与其他类一起发布,在删除所有可能的代码后,它开始与Picasso库一起出现.我已经附加了我的logcat和build.gradle.

请帮助我,我被困,我尝试了很多解决方案,但没有人工作.

我找到的Simmilar问题是 - https://github.com/square/picasso/issues/1264

build.gradle -

compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'

dexOptions {
    incremental false
    javaMaxHeapSize "2048M"
    preDexLibraries = false
}

defaultConfig {
    applicationId "com.kaaryanext.raghukaka"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 25
    versionName "1.2.14"
    multiDexEnabled true
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-android.txt'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile('com.android.support:appcompat-v7:23.1.1') {
exclude module: 'support-v4'
}
compile 'com.crittercism:crittercism-android-agent:5.0.6'
compile 'com.android.support:support-v4:23.1.1'
compile "com.android.support:recyclerview-v7:23.1.0"
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile "com.google.android.gms:play-services:8.1.0"
compile 'com.squareup.picasso:picasso:2.5.2'
compile …
Run Code Online (Sandbox Code Playgroud)

java android picasso android-multidex

1
推荐指数
1
解决办法
5393
查看次数

在以下API上未找到类“ androidx.multidex.MultiDexApplication”:更低的API &lt;= 19设备上的DexPathList

我正在尝试将Multidex 支持添加到我的应用中。但是我得到一个错误:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo: java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication" on path: DexPathList[[zip       file "/data/app/com.dfn.partner-2.apk"],nativeLibraryDirectories[/data/app-lib/se.android-2, /vendor/lib, /system/lib]]
Run Code Online (Sandbox Code Playgroud)

我的gradle有:

defaultConfig {
   multiDexEnabled true
}
Run Code Online (Sandbox Code Playgroud)

depenencies {
   ...
   implementation 'androidx.multidex:multidex:2.0.1'
   ...
}
Run Code Online (Sandbox Code Playgroud)

我的AndroidManifest.xml具有:

<application
  android:name="androidx.multidex.MultiDexApplication"
  ... >
...
</application>
Run Code Online (Sandbox Code Playgroud)

有什么事吗

android gradle android-multidex androidx

1
推荐指数
3
解决办法
3059
查看次数