Home>
I want to achieve

I wanted to use OpenCV on Android Studio, so I imported it while referring to the article.
I was able to import the module, but after that I got an error. I would like to know how to deal with it

upperappThere is a cross in the place, and if you look at Debug Configurations,
Warming: Default Activity not found
Will come out

code

AndroidManifest.xml

<? xml version = "1.0" encoding = "utf-8"?>
<manifest xmlns: android = "http://schemas.android.com/apk/res/android"
    package = "com.websarva.wings.android.opencv_sample">
    
        
          <intent-filter>
                
              <category android: name = "android.intent.category.LAUNCHER" />
          </intent-filter>
      </activity>
  </application>
</manifest>

build.gradle

apply plugin:'com.android.application'
apply plugin:'kotlin-android'
apply plugin:'kotlin-android-extensions'
android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"
    defaultConfig {
        applicationId "com.websarva.wings.android.opencv_sample"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile ('proguard-android-optimize.txt'),'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree (dir: "libs", include: ["*. Jar"])
    implementation "org.jetbrains.kotlin: kotlin-stdlib: $kotlin_version"
    implementation'androidx.core: core-ktx: 1.3.1'
    implementation'androidx.appcompat: appcompat: 1.2.0'
    implementation'androidx.constraintlayout: constraintlayout: 2.0.1'
    implementation project (path:': opencv')
    testImplementation'junit: junit: 4.12'
    androidTestImplementation'androidx.test.ext: junit: 1.1.2'
    androidTestImplementation'androidx.test.espresso: espresso-core: 3.3.0'
}
Reference article

https://qiita.com/tifa2chan/items/a2ec4f5d90eeb9cf1802

environment

Android studio 4.0.1
Windows 10

  • Answer # 1

    It seems that the minSdkVersion of build.gradle is too low. Even in the referenced article, it is written that "By the way, 15 is too low and an error occurs." Can it be solved by setting it to 21 (Android 5.0 Lollipop) or higher?