2016-01-02 71 views
1

這是我從我的導師那裏得到的項目,在我的測試手機上運行後出現錯誤。我嘗試了stackovetflow上的答案,但沒有任何幫助。在logcat中和的manifest.xml如下路徑中沒有找到類「com.imagerecognition.MainActivity」:DexPathList

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.imagerecognition" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="22" /> 

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.CAMERA" /> 

    <uses-feature android:name="android.hardware.camera" /> 
    <uses-feature android:name="android.hardware.camera.autofocus" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".TakeBusinessCardActivity" 
      android:label="@string/app_name"> 

      <!--<intent-filter>--> 
       <!--<action android:name="android.intent.action.MAIN" />--> 

       <!--<category android:name="android.intent.category.LAUNCHER" />--> 
      <!--</intent-filter>--> 
     </activity> 
     <activity android:name=".HistoryActivity" android:label="拍攝歷史"/> 
     <activity android:name=".DecodeActivity" android:label="解碼"/> 

     <activity android:name=".MainActivity"> 

      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 
</manifest> 

logcat

+0

嘗試清洗項目和重建。 –

+0

好像你有兩個活動聲明瞭'ACTION_MAIN'意圖過濾器。 – starkshang

+0

@FireSun,我找不到它。細節? –

回答

0

這下面的方法爲我工作。右鍵點擊您的project並選擇properties。 「屬性」面板將打開。從左邊的菜單去Java Build Path - >Order and Export。從下面的列表中取消選中Android Dependencies旁邊的框。最後clean您的項目和run

希望它有效。

參考Link

+0

仍然是相同的錯誤,謝謝 –

+0

好吧,現在試試這個,文件 - >無效緩存/重新啓動 –

+0

仍然是一樣的... –

0

試圖改變自己的

android:name=".MainActivity"

完全指定名稱

android:name="com.imagerecognition.MainActivity"

有時偏食行爲怪異。

,如果它不工作,你可以試試這個 unable to find activity

+0

實際上它沒有工作 –

相關問題