Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 由于google play服务,无法在单个dex文件中容纳请求的类_Android_Google Play Services_Wear Os - Fatal编程技术网

Android 由于google play服务,无法在单个dex文件中容纳请求的类

Android 由于google play服务,无法在单个dex文件中容纳请求的类,android,google-play-services,wear-os,Android,Google Play Services,Wear Os,试图在我们现有的Android应用程序中添加广告,编译后我得到了以下信息: Cannot fit requested classes in a single dex file. Try supplying a main-dex list. 环顾四周,我的建议是减少游戏服务的规模,这就是我的建议: implementation 'com.google.android.gms:play-services-ads:12.0.1' // newly added implementation 'com.

试图在我们现有的Android应用程序中添加广告,编译后我得到了以下信息:

Cannot fit requested classes in a single dex file. Try supplying a main-dex list.
环顾四周,我的建议是减少游戏服务的规模,这就是我的建议:

implementation 'com.google.android.gms:play-services-ads:12.0.1' // newly added
implementation 'com.google.android.gms:play-services:12.0.1'
我在代码中使用Android Wear,因此当我减少到:

implementation 'com.google.android.gms:play-services-ads:12.0.1'
implementation 'com.google.android.gms:play-services-wearable:12.0.1'
现在我得到了:

resource style/Theme.AppCompat (...) not found. 
我尝试添加

compile "com.android.support:appcompat-v7:21.0.+"
我遇到了更多的冲突问题。我的最佳解决方案是什么?我当前的解决方案是将AppCompat更改回活动。如果您有其他答案,我们将不胜感激

你可以参考这个。尝试在应用程序gradle:
implementation'com.android.support:multidex:1.0.3'
中添加此库。然后在app gradle的defaultConfig中添加
multiDexEnabled true
。同样,当您的应用程序及其引用的库超过65536个方法时,您会遇到一个生成错误,表明您的应用程序已达到Android生成架构的限制