2017-10-05 88 views
-1

我已經在studio中創建了一個簡單的android項目。但它不會在kitkat和以下版本中運行。但它適用於棒棒糖+版本。我創建的每個項目都不會在kitkat中運行。當我打開我的活動時,它僅停留在真實設備上,但在模擬器上正常運行。我無法將手機連接到PC。所以我無法在logcat中顯示錯誤。我嘗試了很多東西。應用程序一直停在kitkat

搖籃文件:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 25 
buildToolsVersion "25.0.3" 
defaultConfig { 
    applicationId "com.example.demotoruninpos" 
    minSdkVersion 16 
    targetSdkVersion 25 
    versionCode 1 
    versionName "1.0" 

    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro' 
    } 
} 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{ 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support:support-v4:25.3.1' 
testCompile 'junit:junit:4.12' 
} 

清單文件:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.example.demotoruninpos"> 


<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme"> 

    <activity android:name=".MainActivity" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

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

</manifest> 
+0

沒有錯誤日誌,沒有什麼可以做。你的代碼在這方面看起來很好。 –

+0

在這裏發佈你的錯誤記錄@Shuchi – UltimateDevil

+0

@匿名此鏈接你提到。它完全不同的情況。它的multidex問題。這與這個問題無關。 –

回答

2

你有瞬間的運行的這個問題是能夠在你的Android工作室。你必須做的事情....

File > Setting > Build,Execution,Dev > Instant run > Turn it OFF. 

現在你是好go..Happy作弄

+0

thanku這麼多..它的工作。 –