I had the same problem in my (YouTube player project)... and the following solved the problem for me:
Add this code into your build.gradle
(module: app) inside defaultConfing
:
defaultConfig {
....
....
multiDexEnabled = true
}
Add this code into your build.gradle
(module: app) inside dependencies
:
dependencies {
compile 'com.android.support:multidex:1.0.1'
.....
.....
}
Open AndroidManifest.xml
and within application
:
<application
android:name="android.support.multidex.MultiDexApplication"
.....
.....
</application>
or if you have your App class, extend it from MultiDexApplication like:
public class MyApp extends MultiDexApplication {
.....
And finally, I think you should have Android Support Repository downloaded, in the Extras in SDK Manager.