What does Program type already present mean?
This problem usually come from a naming conflict, in your case the support-v4 library, which is use by several libraries.
To find the list of dependencies for the module app
(default module's name for the app) we can do a gradlew app:dependencies
to retrieve a list of all the libraries.
We found that support-v4
is used by:
//short version of the dependencies list highlighting support-v4
+--- com.android.support:support-v13:27.1.0
| \--- com.android.support:support-v4:27.1.0
+--- com.google.android.gms:play-services-maps:12.0.1
| +--- com.google.android.gms:play-services-base:12.0.1
| | +--- com.google.android.gms:play-services-basement:12.0.1
| | | +--- com.android.support:support-v4:26.1.0 -> 27.1.0 (*)
+--- org.eclipse.paho:org.eclipse.paho.android.service:1.0.2
| +--- com.google.android:support-v4:r7 // <- problem here
We see that the support-v4 on Maps will use the version provided from support-v13.
We also see that the eclipse library is using another version (r7 ??).
To resolve your issue, you can try to exclude the module support-v4
from this eclipse library like this:
implementation ('org.eclipse.paho:org.eclipse.paho.android.service:1.0.2') {
exclude module: 'support-v4'
}
Then you should be able to compile your application.
Btw you should take care that the eclipse module won't break by testing your code.
What is Program type already present ?
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
downgrade the version of dependency to
implementation 'com.android.support:appcompat-v7:27.1.0'
and also add the design dependency
implementation 'com.android.support:design:27.1.0'
check it once this works for me
Getting Program type already present error in Android Studio
After 2 days of RND, finally I got the answer. Adding below code in my app-level build.gradle file worked for me--
android {
dexOptions {
preDexLibraries = false
}
}
For more details, please check the answer given by "iceman" on this post.
Program type already present: androidx.test.InstrumentationRegistry
I just got the answer, putting them in this order made mine work. This is got to be in the dependencies.
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
Program type already present: BuildConfig
You are getting this error because you a have library module which has the same package name as the app module.
The solution would be to change package name of your library module. You can follow the accepted answer in this SO which describes how to change the package name in android studio.
Error: Program type already present: com.appsflyer.AFExecutor
After exploring a bunch of dependencies, I found the solution. The reason was there was a conflict between com.appsflyer:af-android-sdk:5.+
and AF-Android-SDK.jar
which had installed manually. After removing the JAR file and built again, I could make it at last! Thank you so much for sharing your experiences, however, the solution was simple!
Related Topics
Noclassdeffounderror For Code in an Java Library on Android
Why Are Nested Weights Bad For Performance? Alternatives
Integrate Mupdf Reader in an App
How to Add a Fragment to an Activity with a Programmatically Created Content View
Execution Failed App:Processdebugresources Android Studio
Steps to Create APK Expansion File
How to Delete an Sms from the Inbox in Android Programmatically
Eclipse Error: R Cannot Be Resolved to a Variable
Single Textview with Multiple Colored Text
How to Grant Modify_Phone_State Permission For Apps Ran on Gingerbread
Android Background Music Service
How to Solve Java.Lang.Outofmemoryerror Trouble in Android
Force "Portrait" Orientation Mode
Error "The Connection to Adb Is Down, and a Severe Error Has Occurred."
How to Start Genymotion Device