My Android Studio does not run the app for testing

Asked

Viewed 1,546 times

0

My Android Studio does not run the app for testing, already reinstalled several times and nothing, it recognizes my mobile only that does not install the app for testing, and also does not run in emulator, the API I am using in the project is API 8

and in Gadle Console the following error:

Executing tasks: [:app:clean, :app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :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:prepareComAndroidSupportAnimatedVectorDrawable2330Library
:app:prepareComAndroidSupportAppcompatV72330Library
:app:prepareComAndroidSupportSupportV42330Library
:app:prepareComAndroidSupportSupportVectorDrawable2330Library
: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
Warning : Project is building density based multiple APKs but using tools version 19, you should upgrade to build-tools 21 or above to ensure proper packaging of resources.
:app:generateDebugSources
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:mockableAndroidJar UP-TO-DATE
: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
Warning : Project is building density based multiple APKs but using tools version 19, you should upgrade to build-tools 21 or above to ensure proper packaging of resources.
:app:generateDebugAndroidTestSources
:app:compileDebugJavaWithJavac
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug UP-TO-DATE
:app:incrementalDebugTasks
:app:prePackageMarkerForDebug
:app:fastDeployDebugExtractor
:app:generateDebugInstantRunAppInfo
:app:coldswapKickerDebug
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Multi dex requires Build Tools 21.0.0 / Current: 19.1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 23.364 secs
  • It seems to me that the problem is that the Build Tools version 19.1 is being used and the version is required: Multi dex requires Build Tools 21.0.0 / Current: 19.1

  • and how I solve this problem?

1 answer

0


Adilson, I believe this error is happening because of the version of your Build Tools used in your app. In the build.Radle file there is the android{} element and inside there is the buildToolsVersion attribute. Change the value of this attribute to a version 21 or higher.

android {
    compileSdkVersion 21
    buildToolsVersion "21.0.0"
}

Check it out. Anything comment here.

  • Okay solved, thank you very much.

  • Another question, using this Build would affect in the execution of my project in older devices?

  • No, this attribute is not related to the MINIMUM version to run the app. I will try to briefly explain some attributes. I don’t know if you know the difference between sdk level and operating system version, but if you don’t know the difference, take a read here.

  • Take a look at the build.Gradle file to identify these attributes. minSdkVersion is the minimum SDK version the device’s operating system has to have for its application to run. targetSdkVersion is the version of the SDK you are focusing on when creating the app. We usually put the latest version of the SDK. compileSdkVersion is the version of the SDK on which Gradle will build your project. We usually put the latest version of the SDK.

  • now I understand.. thank you so much for the help, helped me a lot. i am beginner in android development and have difficulties in some things haha.. Do you recommend any course or good materials for me I’m getting? Thank you

  • Adilson, I would recommend the tutorial to make the first app made by Google itself and android developers page that has very friendly guides to understand, in addition to the platform’s own documentation.

  • Regarding books, I would recommend the Dominating the Android, Google Android and the Android in Action.

  • A very good site is also the Vogella!

  • Thank you very much, helped me very vlww.. stay with God flww

  • Amen! Anything we are there! Just be sure to mark some answer as chosen after =P!

Show 5 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.