gpt4 book ai didi

java - 添加 Google Play 服务导致错误 Conversion to Dalvik Format failed with error 1

转载 作者:行者123 更新时间:2023-11-30 03:12:28 25 4
gpt4 key购买 nike

我的应用没有错误,然后我将 Google Play Services 库添加到我的应用中以使用 AdMob。我继续对 list 进行以下更改:

  <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>

我还按照指示添加了一个Activity:

 <activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

然后我将以下代码添加到我的MainActivity:

 AdView adView;
adView=(AdView)findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().addTestDevice("3b9bdbbc9b1c3b30").build();
adView.loadAd(adRequest);

该值之前在 xml 中定义为:

  <com.google.android.gms.ads.AdView android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adUnitId="MY AD UNIT ID"
ads:adSize="BANNER"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
/>

我尝试取消选中 Force error when external jar contains native codeclean 应用程序然后运行它。我的应用程序使用了三个外部库:

1.tess-two
2.android-support-v7 appcompat
3.google-play-services_lib

我为我的应用程序使用包 com.blutechnologies.scancard,以便系统对这些类进行唯一处理。

我有一个 SplashActivityMainActivity,它们也很容易成为其他库的一部分。它们是冲突的原因还是 中的类之间存在冲突>tess-twogoogle-play-services

是什么导致了这个错误,我该如何解决?

控制台也报错:

Dx trouble processing "java/sql/Savepoint.class":

我的 Order and Export 文件的链接是 here

最佳答案

请检查此链接。它可能对您有所帮助。

https://stackoverflow.com/a/17308418/2586981

此外,如果您从 xml 添加 ad mob,则无需添加 google play 服务。您所需要的只是将库文件添加到您的 libs 文件夹中。所需的 jar 文件是“GoogleAdMobAdsSdk-6.4.1.jar”。

希望对您有所帮助。谢谢

关于java - 添加 Google Play 服务导致错误 Conversion to Dalvik Format failed with error 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20717326/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com