2016-04-08 31 views
6

Tôi vừa nâng cấp Android Studio từ 1,5 lên 2.0. Ứng dụng của tôi sẽ xây dựng và chạy độc đáo trên Android 1.5. Bây giờ, khi tôi cố gắng chạy ứng dụng trên điện thoại thông minh của tôi, nó mang lại cho tôi lỗi này:Ứng dụng sẽ không chạy trong Android Studio 2.0, sau khi nâng cấp từ 1,5

Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'. 
> 24 

Khi mở dự án của tôi trên Android Studio 2.0, một hộp thông báo xuất hiện, nói với tôi để nâng cấp gradle tôi lên phiên bản 2, Tôi đã làm. Tôi không chắc tại sao tôi lại gặp lỗi này.

Đây là kết quả tôi nhận được là tôi cố gắng để chạy các ứng dụng trên điện thoại của tôi:

Executing tasks: [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources] 
Configuration on demand is an incubating feature. 
Incremental java compilation is an incubating feature. 
:clean UP-TO-DATE 
:app:clean 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library 
:app:prepareComAndroidSupportAppcompatV72321Library 
:app:prepareComAndroidSupportCardviewV72321Library 
:app:prepareComAndroidSupportDesign2321Library 
:app:prepareComAndroidSupportMediarouterV72300Library 
:app:prepareComAndroidSupportRecyclerviewV72321Library 
:app:prepareComAndroidSupportSupportV42321Library 
:app:prepareComAndroidSupportSupportVectorDrawable2321Library 
:app:prepareComGoogleAndroidGmsPlayServices840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library 
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library 
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library 
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library 
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library 
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library 
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library 
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library 
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library 
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library 
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library 
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library 
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library 
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library 
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library 
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library 
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library 
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library 
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library 
:app:prepareDebugDependencies 
:app:compileDebugAidl 
:app:compileDebugRenderscript 
:app:generateDebugBuildConfig 
:app:generateDebugAssets UP-TO-DATE 
:app:mergeDebugAssets 
:app:generateDebugResValues UP-TO-DATE 
:app:generateDebugResources 
:app:mergeDebugResources 
:app:processDebugManifest 
:app:processDebugResources 
:app:generateDebugSources 
:app:mockableAndroidJar 
:app:preDebugUnitTestBuild UP-TO-DATE 
:app:prepareDebugUnitTestDependencies 
:app:preDebugAndroidTestBuild UP-TO-DATE 
:app:prepareDebugAndroidTestDependencies 
:app:compileDebugAndroidTestAidl 
:app:processDebugAndroidTestManifest 
:app:compileDebugAndroidTestRenderscript 
:app:generateDebugAndroidTestBuildConfig 
:app:generateDebugAndroidTestAssets UP-TO-DATE 
:app:mergeDebugAndroidTestAssets 
:app:generateDebugAndroidTestResValues UP-TO-DATE 
:app:generateDebugAndroidTestResources 
:app:mergeDebugAndroidTestResources 
:app:processDebugAndroidTestResources 
:app:generateDebugAndroidTestSources 
:app:compileDebugJavaWithJavac 
Note: Some input files use or override a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 

:app:compileDebugNdk UP-TO-DATE 
:app:compileDebugSources 
:app:compileDebugUnitTestJavaWithJavac 
:app:processDebugJavaRes UP-TO-DATE 
:app:processDebugUnitTestJavaRes UP-TO-DATE 
:app:compileDebugUnitTestSources 
:app:compileDebugAndroidTestJavaWithJavac 
:app:compileDebugAndroidTestNdk UP-TO-DATE 
:app:compileDebugAndroidTestSources 

BUILD SUCCESSFUL 

Total time: 1 mins 31.987 secs 
Executing tasks: [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug] 

Configuration on demand is an incubating feature. 
Incremental java compilation is an incubating feature. 
:app:clean 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library 
:app:prepareComAndroidSupportAppcompatV72321Library 
:app:prepareComAndroidSupportCardviewV72321Library 
:app:prepareComAndroidSupportDesign2321Library 
:app:prepareComAndroidSupportMediarouterV72300Library 
:app:prepareComAndroidSupportRecyclerviewV72321Library 
:app:prepareComAndroidSupportSupportV42321Library 
:app:prepareComAndroidSupportSupportVectorDrawable2321Library 
:app:prepareComGoogleAndroidGmsPlayServices840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library 
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library 
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library 
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library 
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library 
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library 
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library 
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library 
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library 
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library 
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library 
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library 
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library 
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library 
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library 
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library 
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library 
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library 
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library 
:app:prepareDebugDependencies 
:app:compileDebugAidl 
:app:compileDebugRenderscript 
:app:generateDebugBuildConfig 
:app:generateDebugAssets UP-TO-DATE 
:app:mergeDebugAssets 
:app:generateDebugResValues UP-TO-DATE 
:app:generateDebugResources 
:app:mergeDebugResources 
:app:processDebugManifest 
:app:processDebugResources 
:app:generateDebugSources 
:app:mockableAndroidJar UP-TO-DATE 
:app:preDebugUnitTestBuild UP-TO-DATE 
:app:prepareDebugUnitTestDependencies 
:app:preDebugAndroidTestBuild UP-TO-DATE 
:app:prepareDebugAndroidTestDependencies 
:app:compileDebugAndroidTestAidl 
:app:processDebugAndroidTestManifest 
:app:compileDebugAndroidTestRenderscript 
:app:generateDebugAndroidTestBuildConfig 
:app:generateDebugAndroidTestAssets UP-TO-DATE 
:app:mergeDebugAndroidTestAssets 
:app:generateDebugAndroidTestResValues UP-TO-DATE 
:app:generateDebugAndroidTestResources 
:app:mergeDebugAndroidTestResources 
:app:processDebugAndroidTestResources 
:app:generateDebugAndroidTestSources 
:app:compileDebugJavaWithJavac 
Note: Some input files use or override a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 

:app:compileDebugNdk UP-TO-DATE 
:app:compileDebugSources 
:app:buildInfoDebugLoader 
:app:transformClassesWithExtractJarsForDebug 
:app:transformClassesWithInstantRunVerifierForDebug 
:app:transformClassesWithJavaResourcesVerifierForDebug 
:app:mergeDebugJniLibFolders 
:app:transformNative_libsWithMergeJniLibsForDebug 
:app:processDebugJavaRes UP-TO-DATE 
:app:transformResourcesWithMergeJavaResForDebug 
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE 
:app:transformClassesWithInstantRunForDebug FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':app:transformClassesWithInstantRunForDebug'. 
> 24 

* Try: 
+0

Bạn đang sử dụng phiên bản Android API và Java JDK nào? Bạn cần phải đặt thêm thông tin. –

+0

Bạn đã làm điều bạn yêu cầu bạn thử ở cuối nhật ký (bị cắt ở đây)? Bạn có thể nhận thêm thông tin nếu bạn chạy với --debug và --stacktrace, nhưng bạn sẽ phải chú ý nhiều hơn đến đầu ra. –

Trả lời

1

cố gắng để bỏ chọn ngay lập tức chạy trên các thiết lập .. tìm kiếm ngay lập tức trên các thiết lập và bạn sẽ nhìn thấy nó. hoặc có thể bạn đã thay đổi con đường của gradle của bạn sang cái mới?

1

Bạn đã từng thấy một hộp thông báo như dưới đây khi bạn tạo dự án của mình với Android Studio 2.0 chưa?

Studio 2.0 update prompt

Nếu không, coi chừng cửa sổ này mà có thể sẽ xuất hiện khi bạn xây dựng dự án của bạn với studio 2.0 sau đó cập nhật nó. điều đó sẽ thay đổi Gradle-plugin phiên bản của bạn thành 'com.android.tools.build:gradle:2.0.0'Gradle-wrapper đến distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip hoặc bạn có thể tự làm.

Truy cập this để biết thêm.

13

Hãy thử tắt tùy chọn Chạy tức thì trong Android Studio 2.0

Điều này đã giúp tôi.

+0

Tôi lãng phí rất nhiều thời gian để tìm ra vấn đề. Cảm ơn bạn rất nhiều +1 –

+0

Điều này hoàn toàn không hiệu quả đối với tôi. –

Các vấn đề liên quan