Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependency were found, but they required a higher minimum deployment target #15

Open
blacknight9 opened this issue Nov 25, 2022 · 16 comments

Comments

@blacknight9
Copy link

minimum deployment target is set to = 12.0.
and still getting this message !

@ysak-y
Copy link
Owner

ysak-y commented Dec 3, 2022

Hi, @blacknight9 !! Thank you for your feedback!! Could you please detail of the message? When did you get it?
If it mentions about iOS, I wonder why target is 12.0 because this pod set it to 12.4.

@blacknight9
Copy link
Author

in pub.dev it says :
Capture the audio stream buffer through microphone for iOS/Android. Required OS version is iOS 12+ or Android 23+

@ysak-y
Copy link
Owner

ysak-y commented Dec 4, 2022

Hi, I updated ios deployment version to 13+, could you please version 1.1.2 of this library?
17093fb

@iatndiag
Copy link

Gradle says:
The plugin flutter_audio_capture requires a │
│ higher Android SDK version. │
│ Fix this issue by adding the following to the │
│ file │
│ C:\My_GitHub_Repository_3_for_tests\project
\android\app\build.gradle: │
│ android { │
│ defaultConfig { │
│ minSdkVersion 21 │
│ } │
│ }

I have added these lines. Nothing changed. What's next? I can't install.

@ysak-y
Copy link
Owner

ysak-y commented Dec 29, 2023

Thanks fod reporting. I'll update package later.

@iatndiag
Copy link

iatndiag commented Dec 29, 2023

I think that the problem is not that with each version the minimum deployment target is reduced (which is good), but the reason is that I cannot install it. On the contrary, I have an API of 31,33,34. I just don’t know how to install a package when such errors occur. More precisely, the error appears when assembling the program. I don't have a commercial project. I'm writing a program for myself. Every time I encounter similar errors.

@ysak-y
Copy link
Owner

ysak-y commented Dec 29, 2023

Ah, sorry. I realized what you are struggling with. But sorry, I'm not good at gradle. Actually I don't know how to solve it.
My opinion is trying to set some kind of versions to minSdk will solve problem though...

@iatndiag
Copy link

iatndiag commented Dec 29, 2023

I can't handle it. Then I'll have to go to the "Record" or "Flutter_sound" packages. But the sample I have works with a “buffer”. In those packages, I don’t know what to change to get the same format or Type. Nevertheless thank you.

@iatndiag
Copy link

iatndiag commented Dec 31, 2023

I updated android studio from 2021 to 2023, use Graddle builder instead of IntelliJ, and everything worked with lines in android\app\build.graddle:
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
...
except one (the app crashes):

java.lang.UnsupportedOperationException: Cannot create AudioRecord
at
android.media.AudioRecord$Builder.build(AudioRecord.java:982)
e.t.c.

Is it a Permission Handler? I do not use it yet.

@iatndiag
Copy link

Great!!! It was a Permission Handler !!!
Now the question is how to get the frequency in the status. And change the musical instrument from 6 string to 21/22 string?

@iatndiag
Copy link

iatndiag commented Jan 1, 2024

Can you implement it under Windows? Or is it difficult? I'm just making a music application, it would be interesting to make this function for all systems (Linux, MacOS, Windows). It turned out that the tuner doesn’t care how many strings the instrument has. He sets everything up anyway. My application can already work under Windows, Android and MacOS. I checked. Everything is done in Flutter

@iatndiag
Copy link

Now again version incompatibility:

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
    The following dependencies do not satisfy the required version:
    project ':flutter_audio_capture' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

@iatndiag
Copy link

  • What went wrong:
    Execution failed for task ':flutter_audio_capture:compileReleaseKotlin'.

'compileReleaseJavaWithJavac' task (current target is 1.8) and 'compileReleaseKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.

@iatndiag
Copy link

iatndiag commented Oct 18, 2024

Solution:

@iatndiag
Copy link

iatndiag commented Oct 18, 2024

Solution:

(android):

subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}

subprojects {
afterEvaluate{
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
if (project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) {
kotlinOptions.jvmTarget = android.compileOptions.sourceCompatibility
} else {
kotlinOptions.jvmTarget = sourceCompatibility
}
}
}
}

(app):

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}

(app):

defaultConfig {
applicationId = "com.mydomain.myappname"
minSdkVersion 21
targetSdkVersion 31
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

(root):

tasks.withType {
kotlinOptions.jvmTarget = "17"
}

(pubspec):

flutter_audio_capture: ^1.1.8

(File->Project Structure) Gradle version 7.6.1

(File->Settings-Build-Graddle) Graddle JDK: JAVA_HOME Oracle OpenJDK 1.8.0 ...Program Files\Java\jdk 1.8.0

The solution was found in files:
adroid\build.gradle
app\build.gradle
build.gradle.kts

Also needs to be initialized: in "extends State" must be New class exemplar and
in initState() must be method .init() (everything is as in the example from the instructions)

@ysak-y
Copy link
Owner

ysak-y commented Oct 20, 2024

Hi @iatndiag , could you please send me a Pull Request? I can review and merge it to flutter_audio_capture if you make it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants