2013-07-21 37 views
3
[2013-07-21 11:14:01 - AndroidTrial] Installation failed due to invalid URI! 
[2013-07-21 11:14:01 - AndroidTrial] Please check logcat output for more details. 
[2013-07-21 11:14:02 - AndroidTrial] Launch canceled! 

這是我在嘗試運行試用項目時得到的結果。 logcat中沒有輸出。
我看到了其他類似問題的答案,他們說這可能是因爲重音字符。我沒有這些。由於URI無效導致安裝失敗

這裏是我的簡單的代碼看起來像:

public class HaikuDisplay extends Activity { 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 
    } 

    public void onTrialButtonClicked(View view){ 
     TextView v = (TextView) findViewById(R.id.text); 
     v.setVisibility(View.VISIBLE); 
    } 

} 

這裏是XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context=".HaikuDisplay" > 
    <Button 
     android:id="@+id/topBtn" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/love_button_text" 
     android:onClick="onTrialButtonClicked" 
     /> 
    <TextView 
     android:layout_below="@id/topBtn" 
     android:id="@+id/text" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/hello_world" 
     android:visibility="invisible"/> 

</RelativeLayout> 

我該如何解決呢?

+0

查看http://stackoverflow.com/a/10182645/2398886 –

+0

@Tarsem我在Eclipse –

+0

您是否嘗試過清理項目? –

回答

17

這個錯誤可以指向很多不同的東西,並且有許多不同的修復。綜上所述那些我已經收集:

  1. 問題與Eclipse:清潔工程,改造項目,重新啓動 蝕。
  2. 無效字符:刪除Eclipse項目名稱中的任何特殊字符。 僅使用[a-z]和[0-9]不是[](空格)
  3. 包含jar中的錯誤:嘗試不使用jar並查看它是否運行,如果確實以某種方式修復。
  4. 清單包安裝中的錯誤:在項目中右擊eclipse - >Android tools - >Rename application package(重命名爲類似的東西,您可以隨時重命名)。
  5. 設備問題:從設備中刪除應用程序並嘗試重新安裝。
  6. Rom問題:如果您使用自定義ROM嘗試重新刷新到一個新的ROM。
  7. 調試未啓用:在手機上進入Settings - >Applications - >Allow unknown sources/enable debugging(這條道路可以爲不同的設備會發生變化)
+1

解決方案1爲我工作。謝謝! – pbielicki

+0

解決方案1也適用於我。謝謝 – NarendraJi

+0

3爲我做了詭計,謝謝 – Ercksen

1

在我的情況下,問題是Android項目名稱,因爲它包含德國的變音:äüö..。我重構了這個名字,它起作用了。

0

對我來說,那是因爲我改變了我的應用程序的名稱strings.xml檔案:

<string name="app_name">My App</string> 

刪除應用程序,並重新安裝它解決了這個問題。

相關問題