>

내 앱의 메소드 라인은 65536을 얻었으므로 Multidex를 적용했습니다. Multidex를 적용하기 위해 작성한 코드는 다음과 같습니다.

buildscript {
repositories {
    flatDir {
        dirs 'libs/lib'
    }
    maven { url 'https://maven.fabric.io/public' }
}
dependencies {
    classpath ':dexguard:'
    classpath 'io.fabric.tools:gradle:1.27.1'
}
}
repositories {
    maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.android.application'
apply plugin: 'dexguard'
apply plugin: 'io.fabric'
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.kihno.kihnoplay"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 7532
        versionName "1.984"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
        ndk {
            abiFilters "armeabi"
        }
    }
    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            useProguard false
            shrinkResources false
//            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            proguardFile getDefaultDexGuardFile('dexguard-debug.pro')
            proguardFile 'proguard-rules.pro'
        }
        release {
            debuggable false
            minifyEnabled true
            useProguard true
            shrinkResources false
//            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            proguardFile getDefaultDexGuardFile('dexguard-release.pro')
            proguardFile 'proguard-rules.pro'
        }
        china {
            debuggable false
            minifyEnabled true
            useProguard true
            shrinkResources false
//            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            proguardFile getDefaultDexGuardFile('dexguard-release.pro')
            proguardFile 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.ssomai:android.scalablelayout:2.1.3'
    testImplementation 'junit:junit:4.12'
    testImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v13:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:percent:28.0.0'
    implementation 'com.android.support:support-media-compat:28.0.0'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    // JSON Parsing
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'com.github.omadahealth:swipy:1.2.3@aar'
    // Live JS Bridge 라이브러리
    implementation 'com.github.wendux:WebViewJavascriptBridge:master-SNAPSHOT'
    // Socket IO
    implementation('io.socket:socket.io-client:1.0.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }
    implementation 'com.github.ybq:Android-SpinKit:1.2.0'
    // 커스텀 qr 리더 라이브러리
    implementation 'com.journeyapps:zxing-android-embedded:3.0.3@aar'
    implementation 'com.google.zxing:core:3.3.0'
    // 크롬 캐스트 라이브러리
    implementation 'com.android.support:mediarouter-v7:28.0.0'
    // Firebase crashlytics
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.android.gms:play-services-cast-framework:16.1.2'
    implementation 'com.google.android.gms:play-services-analytics:16.0.4'
    // FFMpeg
    implementation 'com.writingminds:FFmpegAndroid:0.3.2'
    // 새로운 슬라이드 이미지 라이브러리
    implementation 'com.yarolegovich:discrete-scrollview:1.4.7'
    // SNS GiraffePlayer2 커스텀화
    implementation 'com.github.tcking:viewquery:1.6'
    implementation 'com.github.tcking:ijkplayer-java:0.8.8'
    implementation 'com.github.tcking:ijkplayer-armv7a:0.8.8'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
        transitive = true;
    }
    // Dot Indicator
    implementation 'com.romandanylyk:pageindicatorview:1.0.0@aar'
    implementation 'me.omidh:liquidradiobutton:1.0.01'
    implementation 'com.getkeepsafe.taptargetview:taptargetview:1.12.0'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.github.gsotti:EqualizerView:v0.2'
    implementation 'com.scottyab:rootbeer-lib:0.0.7'
    implementation 'com.android.support:multidex:1.0.3'
}
apply plugin: 'com.google.gms.google-services'

이것은 내 app/build.gradle 코드입니다.

public class AppController extends MultiDexApplication { ... }

이것은 내 응용 프로그램 클래스 코드입니다.

<application
        android:name="android.support.multidex.MultiDexApplication"
        android:allowBackup="true"
        android:allowClearUserData="true"
        android:banner="@drawable/icon_tv"
        android:hardwareAccelerated="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:theme="@style/AppTheme"
        android:vmSafeMode="true"
        tools:replace="android:allowBackup">

이것은 나의 매니페스트 코드입니다.

위와 같이 적용하고 컴파일 한 후 다음과 같은 오류가 발생합니다.

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.kihno.kihnoplay, PID: 31582
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string;
        at com.google.android.gms.common.internal.StringResourceValueReader.<init>(Unknown Source:4)
        at com.google.firebase.FirebaseOptions.fromResource(com.google.firebase:firebase-common@@16.0.2:160)
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.2:301)
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@16.0.2:53)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1925)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1900)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@16.0.2:47)
        at android.app.ActivityThread.installProvider(ActivityThread.java:6572)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:6127)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6037)
        at android.app.ActivityThread.-wrap1(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.R$string" on path: DexPathList[[zip file "/data/app/com.kihno.kihnoplay-VqxiJ_TyyN3-XKwP3gSXGw==/base.apk"],nativeLibraryDirectories=[/data/app/com.kihno.kihnoplay-VqxiJ_TyyN3-XKwP3gSXGw==/lib/arm, /data/app/com.kihno.kihnoplay-VqxiJ_TyyN3-XKwP3gSXGw==/base.apk!/lib/armeabi, /system/lib, /system/vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.google.android.gms.common.internal.StringResourceValueReader.<init>(Unknown Source:4) 
        at com.google.firebase.FirebaseOptions.fromResource(com.google.firebase:firebase-common@@16.0.2:160) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.2:301) 
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@16.0.2:53) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1925) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1900) 
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@16.0.2:47) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:6572) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:6127) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6037) 
        at android.app.ActivityThread.-wrap1(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6938) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 
D/libEGL: loaded /vendor/lib/egl/libGLES_mali.so
Application terminated.

Android 지원 라이브러리와 충돌이 있다고 생각합니다. 그러나 이러한 문제를 추적하는 방법을 모르겠습니다.

이 오류의 원인과 해결 방법을 아는 사람이 있습니까? 당신이 어떤 아이디어가 있으면 알려 주시기 바랍니다. 감사합니다.

  • 답변 # 1

    모든 의존성을 최신으로 만드십시오. 예를 들어 Firebase 및 all

  • 답변 # 2

    proguard-rules.pro 파일에서 firebase를 제외하는 것을 잊지 마십시오.

    보호 대상을 제외합니다. U는 다음을 사용할 수 있습니다 :

    추가

    -keep class com.google.firebase.** { *; }
    
    

  • 이전 python 3.x - err - 둘 이상의 요소를 가진 배열의 실제 값이 모호합니다 aany () 또는 aall ()을 사용하십시오
  • 다음 access vba - 원본 프로젝트가 너무 클 때 ACCDE 파일을 만드는 방법