J'ai activé miltidex dans mon application. Api 21+ fonctionne bien. Android api 16 causes:Android butterknife multidex
java.lang.NoClassDefFoundError: ......AuthorizationController
Si je commente tout la liaison BN fonctionne très bien. Multidex activé: multiDexEnabled true, compile 'com.android.support:multidex:1.0.1'
et ainsi de suite. Y at-il un moyen de le faire fonctionner?
EDIT
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'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
signingConfigs {
prod_release {
...
}
}
compileSdkVersion 25
buildToolsVersion "25.0.3"
productFlavors {
dev {
// Enable pre-dexing to produce an APK that can be tested on
// Android 5.0+ without the time-consuming DEX build processes.
minSdkVersion 16
signingConfig signingConfigs.prod_release
}
prod {
// The actual minSdkVersion for the production version.
minSdkVersion 16
signingConfig signingConfigs.prod_release
}
}
defaultConfig {
applicationId "ru.wearemad.gravo"
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dexOptions {
javaMaxHeapSize "2g"
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.prod_release
}
debug {
signingConfig signingConfigs.prod_release
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.google.code.findbugs'
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
//retrofit
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
//rxjava 2
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.1'
//butterknife
compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
//mosby + conductor
compile 'com.bluelinelabs:conductor-support:2.1.4'
compile 'com.hannesdorfmann.mosby3:mvp-conductor:3.0.0'
compile 'com.hannesdorfmann.mosby3:viewstate:3.0.4'
compile 'com.hannesdorfmann.mosby3:viewstate-conductor:3.0.0'
compile 'com.madgag.spongycastle:core:1.54.0.0'
compile 'com.madgag.spongycastle:prov:1.54.0.0'
compile 'com.madgag.spongycastle:pkix:1.54.0.0'
compile 'com.madgag.spongycastle:pg:1.54.0.0'
// testCompile 'junit:junit:4.12'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.orhanobut:hawk:1.+'
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
compile 'com.android.support:multidex:1.0.1'
}
part de Manifest:
<application
android:name="ru.wearemad.gravo.MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
classe Application:
public class MyApplication extends MultiDexApplication {...}
J'ai essayé d'ajouter multiDexKeepProguard
, mais gradle ne voit pas cette méthode, ou la déclaration de la méthode a changé.
EDIT 2 Butterknife Unbinder
qui est retourné dans Bitterknife.bind(
) fait la peine. Des idées pour réparer?
J'ai essayé ces méthodes: j'ai essayé ma propre classe d'application qui étend MultiDexApplication et super.attachBaseContext (base); MultiDex.install (this); aussi – TooLazy
Et enregistré dans Manifest? –
ofc, j'ai un autre code là-bas. – TooLazy