3
私はDagger 2.11をAndroid Injectionで使用しています。 多量の依存関係を追加した後、私はMultiDexを有効にする必要がありました。Dagger 2とMultidexアプリケーション
Multidexのサポートは、Android 4.4で期待通りに動作し、Android> = 6で動作するようになりました。私は運で、私はmultiDexKeepProguard
で使用するファイルに"dagger.internal.Preconditions"
を追加するためにしようと試み
Caused by: java.lang.ClassNotFoundException: Didn't find class "dagger.internal.Preconditions" on path: DexPathList[[zip file...
:
問題が唯一のAndroid 5に表示され、5.1私は次のエラーを取得します。
build.gradle
ファイル
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.tmiyamon.config'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.tmiyamon.config'
apply plugin: 'realm-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "appId"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
dexOptions {
preDexLibraries false
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
signingConfigs {
debug {
storeFile file("path")
keyAlias "alias"
storePassword "password"
keyPassword "password"
}
release {
storeFile file("path")
keyAlias "alias"
storePassword "password"
keyPassword "password"
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
minifyEnabled false
zipAlignEnabled false
testCoverageEnabled false
multiDexKeepProguard file('multidex-config.pro')
proguardFiles fileTree(dir: 'proguard').asList().toArray()
}
release {
minifyEnabled true
multiDexKeepProguard file('multidex-config.pro')
proguardFiles fileTree(dir: 'proguard').asList().toArray()
signingConfig signingConfigs.release
}
}
productFlavors {
local {
applicationIdSuffix ".local"
versionNameSuffix " Local " + calculateVersionNameSuffix()
}
staging {
applicationIdSuffix ".staging"
versionNameSuffix " Staging " + calculateVersionNameSuffix()
}
production {
}
}
}
dependencies {
long list of dependencies
}
とマニフェストファイル:
<manifest package="package"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<< permissions >>
<!--${applicationId}-->
<application
android:name=".application.MyApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="${launcherAppName}"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:label">
<activity
android:name=".ui.startup.StartupActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
rest of the Manifest....
あなたのGradleのビルドファイルとAndroid.xmlファイルを投稿してくださいすることができます? –
確かに、私にほんの少しの時間を与える – Eddy
あなたは次のスレッドを確認してくださいできますか?https://stackoverflow.com/questions/45672340/android-classnotfoundexception-while-class-is-present/45672463#45672463多分あなたはAndroid Multidexアプリケーションクラスを定義する必要があります –