2013-12-21 25 views
1

我的應用程序是沒有錯誤的,然後我加入了Google Play Services庫,我的應用程序使用AdMob。我着手進行這些更改清單:添加谷歌Play服務將導致錯誤轉換爲Dalvik的格式失敗,錯誤1

<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該應用,然後運行it.My應用具有它使用三個外部庫:

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

我使用包com.blutechnologies.scancard爲我的應用程序,以便類由系統唯一處理。

我有一個SplashActivityMainActivity這也可能很容易被其他libraries.Are的一部分,他們的衝突的原因還是有在tess-two和類之間的衝突google-play-services

是什麼原因造成這個錯誤,我怎麼能修理它?

控制檯還具有一個錯誤:

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

的鏈接到我的Order and Export文件here

回答

1

請檢查該鏈接。它可以幫助你。

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

此外,如果你從XML添加廣告暴民,你不用加谷歌播放服務。 您只需要將一個庫文件添加到libs文件夾。 需要的jar文件是「GoogleAdMobAdsSdk-6.4.1.jar」。

希望這對你有所幫助。謝謝

+0

謝謝,刪除'android.jar'庫幫助我 – vamsiampolu

+0

請注意,Admob現已打包爲Google Play服務的一部分。 Amdob-6.4.1是*之前的最後一個圖書館*。 – William

相關問題