Build Fails in Android Studio

Asked 2 years ago, Updated 2 years ago, 82 views

We are developing a hybrid app with ionic.

When I build an ionic environment and build with Android studio, I get the following error:

Task 'assembly' not found in root project 'app'.

at the terminal
ionic cordova build android

If you do , it will succeed, but if you use Android studio, you will get the above error for some reason.

Tried
http://infotech776.blog.fc2.com/blog-entry-64.html

Tool Version
Android Emulator 29.0.11
Android SDK Platform-Tools 29.0.0
Android SDK Tools 26.1.1

Project Name.iml

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">

    <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output/>
    <content url="file://$MODULE_DIR$"/>
    <orderEntry type="inheritedJdk"/>
    <orderEntry type="sourceFolder" forTests="false"/>
  </component>
</module>

Route build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
task assembly {}
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        // NOTE: Do not place your application dependencies here; they Belong
        // in the individual module build.gradle files

        classpath'com.android.tools.build:gradle:3.3.0'
    }
}
allprojects {
    repositories {
        google()
        jcenter()
    }
    // This replacement project.properties w.r.t.build settings
    project.ext{
      defaultBuildToolsVersion="28.0.3"// String
      defaultMinSdkVersion=19// Integer-Minimum requirement is Android 4.4
      defaultTargetSdkVersion=28//Integer-We ALWAYS target the latest by default
      defaultCompileSdkVersion=28//Integer-We ALWAYS compile with the latest by default
    }
}
task clean (type: Delete) {
    delete rootProject.buildDir
}

android android-studio ionic2

2022-09-29 22:39

1 Answers

defaultCompileSdkVersion=28 defaultTargetSdkVersion=28
             ↑ and            This is ↑.
This is probably the cause of the error (I'll try to set the API to that API version and if it doesn't work, I'll think about it again and reply to you).

If this Task 'assembly' not found in root project 'app'.

You may be able to run it by turning off all ask clean(type:Delete){deleterootProject.buildDir


2022-09-29 22:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.