Reputation: 334
I followed the instructions on the https://developer.android.com/studio/build/multidex
Here is my error code.
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration
':app:debugAndroidTestRuntimeClasspath'.
Could not find com.android.support:multidex-instrumentation:27.1.1.
But i am geeting the same issue when trying the get signed apk here is the my dependicies:
defaultConfig {
applicationId "com.myproject"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
multiDexEnabled true
}
dependencies {
implementation project(':react-native-date-picker')
implementation project(':react-native-wheel-picker-android')
implementation project(':lottie-react-native')
implementation project(':react-native-firebase')
implementation "com.google.firebase:firebase-auth:16.0.5"
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.firebase:firebase-core:16.0.4"
implementation 'com.android.support:multidex:1.0.3'
implementation project(':react-native-svg')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:design:25.4.0'
implementation "com.android.support:appcompat-
v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-navigation')
implementation project(':react-native-linear-gradient')
}
and My MainApplication.java:
public class MainApplication extends NavigationApplication {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
@Override
public boolean isDebug() {
return BuildConfig.DEBUG;
}
protected List<ReactPackage> getPackages() {
// Add additional packages you require here
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
new LinearGradientPackage(),
new LottiePackage(),
new RNFirebasePackage(),
new RNFirebaseAuthPackage(),
new WheelPickerPackage(),
new DatePickerPackage()
);
}
@Override
public List<ReactPackage> createAdditionalReactPackages() {
return getPackages();
}
@Override
public String getJSMainModuleName() {
return "index";
}
}
Upvotes: 2
Views: 5376
Reputation: 535
React-native + rnn v2 got stuck with same problem sollution: If your minSdkVersion is set to 21 or higher, all you need to do is set multiDexEnabled to true in your module-level build.gradle file, as shown here:
android { defaultConfig { ... minSdkVersion 21 targetSdkVersion 28 multiDexEnabled true } ... }
However, if your minSdkVersion is set to 20 or lower, then you must use the multidex support library as follows: then follow the official instructions here https://developer.android.com/studio/build/multidex
Upvotes: 2
Reputation: 334
Deleting this lines
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
at MainApplication.java
implementation 'com.android.support:multidex:1.0.3'
at build.gradle
and upgradeting minSdkVersion to 21 solved my problem
Upvotes: 2