Closed tusharrain28 closed 1 year ago
@tusharrain28 can you share the gradle file please?
I just created a new projected and added the lib
Project gradle file :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
}
}
plugins {
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
}
allprojects {
repositories {
jcenter()
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}
google()
}
}
Module gradle file:
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.fft'
compileSdk 33
defaultConfig {
applicationId "com.example.fft"
minSdk 33
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
packagingOptions {
// Exclude these files because they conflict with those imported from the jDSP package
exclude 'META-INF/*'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment:2.4.1'
implementation 'androidx.navigation:navigation-ui:2.4.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.github.psambit9791:jdsp:2.0.1' {
exclude group: 'org.apache.maven.surefire', module: 'common-java'
exclude group: 'org.apache.maven.surefire', module: 'surefire-api'
}
}
@tusharrain28 Could you try and take a look at this: https://github.com/gradle/gradle/issues/22550#issuecomment-1295018616? Appears to be a similar issue to what you encountered.
any update on this? i am also getting same error
Based on this solution for the same issue with the DefaultDependencyHandler , this is an issue with the syntax used for including JDSP - the exclusions require the unsugared version.
Could you please replace:
implementation 'com.github.psambit9791:jdsp:2.0.1' {
exclude group: 'org.apache.maven.surefire', module: 'common-java'
exclude group: 'org.apache.maven.surefire', module: 'surefire-api'
}
with this:
implementation('com.github.psambit9791:jdsp:2.0.1', {
exclude group: 'org.apache.maven.surefire', module: 'common-java'
exclude group: 'org.apache.maven.surefire', module: 'surefire-api'
})
OR
implementation('com.github.psambit9791:jdsp:2.0.1') {
exclude group: 'org.apache.maven.surefire', module: 'common-java'
exclude group: 'org.apache.maven.surefire', module: 'surefire-api'
}
@psambit9791 See still i am getting error after using
As mentioned with the error, you will need to add packagingOptions in your build.gradle file
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
Although, I don't think this is directly linked to the issue originally reported herein.
@tusharrain28 @skaran0007 @karansingla007 Can you confirm if this fixes the issue encountered?
@psambit9791 i can confirm the fix is working correctly. Somehow i was not able to post any comment before :)
@tusharrain28 @psambit9791 i am getting the same error.
@skaran0007 Can you elaborate on what the issue is? Maybe provide details on your gradle file.
@skaran0007 I am not sure if this is the gradle file you wanted to share. This has no mention of jdsp in it.
@psambit9791 see this
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-ml-common:22.1.2'
implementation 'com.google.firebase:firebase-ml-model-interpreter:22.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
/* Contracts */
implementation 'androidx.activity:activity-ktx:1.7.0'
implementation 'androidx.fragment:fragment-ktx:1.5.6'
/* Bluetooth*/
implementation 'com.github.LeandroSQ:android-ble-made-easy:1.8.0'
/* Navigation */
implementation "androidx.navigation:navigation-fragment-ktx:2.5.3"
implementation "androidx.navigation:navigation-ui-ktx:2.5.3"
implementation "androidx.navigation:navigation-dynamic-features-fragment:2.5.3"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
// graph view
implementation 'com.jjoe64:graphview:4.2.2'
implementation 'com.pusher:pusher-java-client:1.8.0'
implementation 'com.google.code.gson:gson:2.9.0'
//tf lite
implementation 'com.google.firebase:firebase-ml-modeldownloader-ktx:24.1.2'
implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly'
implementation 'org.tensorflow:tensorflow-lite-support:0.4.3'
implementation('com.github.psambit9791:jdsp:2.0.1', {
exclude group: 'org.apache.maven.surefire', module: 'common-java'
exclude group: 'org.apache.maven.surefire', module: 'surefire-api'
})
}
the error i am getting
@karansingla007 It is difficult to identify issues regarding the build if the full gradle file is not provided. I would suggest sharing the entire content of the gradle file. From the error, it appears to be arising from DEPENDENCIES file not being ignored,
@psambit9791
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'androidx.navigation.safeargs'
id 'org.jetbrains.kotlin.android'
}
apply plugin: 'com.google.gms.google-services'
android {
namespace 'com.aavaa'
compileSdk 33
aaptOptions {
noCompress "tflite", "lite"
}
defaultConfig {
applicationId "com.aavaa"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding true
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1,NOTICE.md,LICENSE.md}'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-ml-common:22.1.2'
implementation 'com.google.firebase:firebase-ml-model-interpreter:22.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
/* Contracts */
implementation 'androidx.activity:activity-ktx:1.7.0'
implementation 'androidx.fragment:fragment-ktx:1.5.6'
/* Bluetooth*/
implementation 'com.github.LeandroSQ:android-ble-made-easy:1.8.0'
/* Navigation */
implementation "androidx.navigation:navigation-fragment-ktx:2.5.3"
implementation "androidx.navigation:navigation-ui-ktx:2.5.3"
implementation "androidx.navigation:navigation-dynamic-features-fragment:2.5.3"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
// graph view
implementation 'com.jjoe64:graphview:4.2.2'
implementation 'com.pusher:pusher-java-client:1.8.0'
implementation 'com.google.code.gson:gson:2.9.0'
//tf lite
implementation 'com.google.firebase:firebase-ml-modeldownloader-ktx:24.1.2'
implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly'
implementation 'org.tensorflow:tensorflow-lite-support:0.4.3'
implementation('com.github.psambit9791:jdsp:2.0.1', {
exclude group: 'org.apache.maven.surefire', module: 'common-java'
exclude group: 'org.apache.maven.surefire', module: 'surefire-api'
})
}
@karansingla007 Under packagingOptions, could you please try adding DEPENDENCIES
as shown below.
packagingOptions {
resources {
excludes += '/META-INF/{DEPENDENCIES,AL2.0,LGPL2.1,NOTICE.md,LICENSE.md}'
}
}
For details, please refer to this response
@psambit9791 no luck Error is same
@karansingla007 This isn't the same error. As you see, it mentions LICENSE-notice.md and not DEPENDENCIES. So, you have to exclude the LICENSE-notice.md in the packagingOptions as well. You need to keep excluding all the files which show up as conflicts under the META-INF directory.
Hi @karansingla007 Can you confirm that the build issue has been resolved? Any further problems not pertaining to the build issue requires a new issue to be raised.
yeah, it resolved And very very thanks for that.
@karansingla007 Can you please create a new ticket for the Butterworth issue you are encountering?
implementation('com.github.psambit9791:jdsp:2.0.1', { exclude group: 'org.apache.maven.surefire', module: 'common-java' exclude group: 'org.apache.maven.surefire', module: 'surefire-api' })
bro this actually worked!! really the brackets messed up my time. Thanks for the excellent library btw :)
Help! I'm having new issues regarding this fix.
First of all thanks a lot for this awesome library! But after applying the above-mentioned fixes (including exclude surefire, adding packagingOptions), the app crashes when I try to plot. Logcat says it's missing the font resources. I remember seeing some kind of font library when I was debugging this and I suspect that excluding DEPENDENCIES removed the font resource files. Is there a way to fix that as well? Sorry if this is a stupid question, I'm fairly new to Android developing.
Hello,
I have experienced the exact same issue as issue #5 but I am not able to solve the issue.
After following the steps, I am getting the following error:
`A problem occurred evaluating project ':app'.
Try:
Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':app'. at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:133) at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:79) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:136) at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) ... at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:135) at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:163) at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:84) at build_8b7glpftwjyi9ocz81v2e7e82.run(C:\Users\tushar.rain\AndroidStudioProjects\FFT\app\build.gradle:41) at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91) ... 177 more`
Kindly help in resolving the issue. Thanks