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

NoClassDefFoundError: com/dbflow5/contentprovider/annotation/ContentProvider #1716

Open
gentlemanxzh opened this issue Mar 15, 2021 · 6 comments

Comments

@gentlemanxzh
Copy link

ISSUE_TEMPLATE

DBFlow Version: 5.0.0-alpha2

Bug or Feature Request:

Description: Update 5.0.0-alpha2 Error

Caused by: java.lang.NoClassDefFoundError: com/dbflow5/contentprovider/annotation/ContentProvider at com.dbflow5.processor.ContentProviderHandler.<init>(Handlers.kt:242) at com.dbflow5.processor.DBFlowProcessor.init(DBFlowProcessor.kt:68) at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.init(incrementalProcessors.kt:38) at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.init(annotationProcessing.kt:170) at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:508) at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:605) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:698) at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1043) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1184) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068) at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:78) ... 27 more Caused by: java.lang.ClassNotFoundException: com.dbflow5.contentprovider.annotation.ContentProvider ... 40 more

@agrosner
Copy link
Owner

I need more information, did you add the content provider annotations package from dbflow to your projects dependencies?

@gentlemanxzh
Copy link
Author

I did not add content provider annotations package But then I tried to add content provider annotations package It has other errors
Caused by: org.jetbrains.kotlin.kapt3.base.util.KaptBaseError: Exception while annotation processing at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:83) at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:34) at org.jetbrains.kotlin.kapt3.base.Kapt.kapt(Kapt.kt:45) ... 25 more Caused by: java.lang.NoClassDefFoundError: com/grosner/kpoet/TypeNameExtensionsKt at com.dbflow5.processor.definition.BaseDefinition.<init>(BaseDefinition.kt:106) at com.dbflow5.processor.definition.MigrationDefinition.<init>(MigrationDefinition.kt:20) at com.dbflow5.processor.MigrationHandler.onProcessElement(Handlers.kt:92) at com.dbflow5.processor.MigrationHandler.onProcessElement(Handlers.kt:87) at com.dbflow5.processor.AnnotatedHandler.handle(Handlers.kt:65) at com.dbflow5.processor.ProcessorManager.handle(ProcessorManager.kt:235) at com.dbflow5.processor.DBFlowProcessor.process(DBFlowProcessor.kt:73) at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt) at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:161) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:802) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:713) at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1043) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1184) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068) at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:78) ... 27 more Caused by: java.lang.ClassNotFoundException: com.grosner.kpoet.TypeNameExtensionsKt ... 44 more

@gentlemanxzh
Copy link
Author

@agrosner

@agrosner
Copy link
Owner

Do you mind sharing your build.gradle file for your project (with any secrets/sensitive parts removed) to see how its configured. java.lang.NoClassDefFoundError: com/grosner/kpoet/TypeNameExtensionsKt Looks like its not finding kpoet dependency

@gentlemanxzh
Copy link
Author

I didn't add it kpoet dependency but then I tried to add implementation 'com.github.agrosner:KPoet:1.0.0' It's still build fail
`Method name '@$default' in class 'com.grosner.kpoet.FieldExtensionsKt' cannot be represented in dex format.
Stack trace:
com.android.tools.r8.errors.a: Method name '@$default' in class 'com.grosner.kpoet.FieldExtensionsKt' cannot be represented in dex format.
at com.android.tools.r8.graph.Z.(:7)
at com.android.tools.r8.graph.W.a(:91)
at com.android.tools.r8.graph.t0.b(:2)
at com.android.tools.r8.graph.u0$b.a(:29)
at com.android.tools.r8.B.a.a.f.a(:256)
at com.android.tools.r8.graph.u0.a(:38)
at com.android.tools.r8.dex.a$a.a(:12)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:322)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:66)
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:36)
at com.android.tools.r8.dex.a$a.a(:9)
at com.android.tools.r8.dex.a$a.a(:29)
at com.android.tools.r8.dex.a.a(:67)
at com.android.tools.r8.dex.a.a(:10)
at com.android.tools.r8.D8.d(:6)
at com.android.tools.r8.D8.b(:1)
at com.android.tools.r8.utils.W.a(:30)
at com.android.tools.r8.D8.run(:11)
at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:116)
at com.android.build.gradle.internal.dexing.DexWorkActionKt.process(DexWorkAction.kt:194)
at com.android.build.gradle.internal.dexing.DexWorkActionKt.processNonIncrementally(DexWorkAction.kt:164)
at com.android.build.gradle.internal.dexing.DexWorkActionKt.launchProcessing(DexWorkAction.kt:91)
at com.android.build.gradle.internal.dexing.DexWorkAction.run(DexWorkAction.kt:49)
at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:50)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:63)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:59)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:59)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:53)
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:200)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.lang.Thread.run(Thread.java:748)
Suppressed: java.util.concurrent.ExecutionException: com.android.tools.r8.errors.a: Method name '@$default' in class 'com.grosner.kpoet.FieldExtensionsKt' cannot be represented in dex format.
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:552)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:513)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:86)
at com.android.tools.r8.utils.U0.a(:14)
at com.android.tools.r8.dex.a.a(:68)
... 40 more
[CIRCULAR REFERENCE:com.android.tools.r8.errors.a: Method name '@$default' in class 'com.grosner.kpoet.FieldExtensionsKt' cannot be represented in dex format.]

`

@gentlemanxzh
Copy link
Author

build.gradle(:app)
`
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion rootProject.android.compileSdkVersion
buildToolsVersion rootProject.android.buildToolsVersion

defaultConfig {
    applicationId rootProject.android.applicationId
    minSdkVersion 21
    targetSdkVersion rootProject.android.targetSdkVersion
    versionCode rootProject.android.versionCode
    versionName rootProject.android.versionName

    multiDexEnabled true

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    javaCompileOptions {
        annotationProcessorOptions {
            arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
        }
    }

    ndk {
        abiFilters 'armeabi' , 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
    }
}

signingConfigs {
    debug {
      
    }

    release {

    }
}

buildTypes {
    debug {
        minifyEnabled false
        zipAlignEnabled false
        shrinkResources false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.debug
    }
    release {
        minifyEnabled false
        zipAlignEnabled false
        shrinkResources false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
    }
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

kotlin{
    experimental {
        coroutines 'enable'
    }
}

buildFeatures {
    dataBinding true
}

}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation project(path: ':FlycoTabLayout_Lib')
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation rootProject.depsLibs.core_ktx
implementation rootProject.depsLibs.appcompact
implementation rootProject.depsLibs.design
implementation rootProject.depsLibs.constraint
implementation rootProject.depsLibs.camera_core
implementation rootProject.depsLibs.camerax


kapt rootProject.depsLibs.dbflow_processor
implementation rootProject.depsLibs.dbflow_core
implementation rootProject.depsLibs.dbflow_lib
implementation rootProject.depsLibs.dbflow_sqlcipher
implementation rootProject.depsLibs.dbflow_contentprovider
implementation 'com.github.agrosner:KPoet:1.0.0' // version of KPoet

}
`

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

2 participants