-4

javascript

Error:E:\Android\myGit\GJBaseFrame\GJBaseFrame\app\src\main\java\com\yubaokang\baseframe\views\activitys\MainActivity.java:9: error: could not find the symbol
Com.yubaokang.baseframe.dagger.component.DaggerMainActivityComponent import;
^
Symbol: class DaggerMainActivityComponent
Location: package com.yubaokang.baseframe.dagger.component
E:\Android\myGit\GJBaseFrame\GJBaseFrame\app\src\main\java\com\yubaokang\baseframe\views\activitys\SecondActivity.java:9: error: could not find the symbol
Com.yubaokang.baseframe.dagger.component.DaggerSecondActivityComponent import;
^
Symbol: class DaggerSecondActivityComponent
Location: package com.yubaokang.baseframe.dagger.component
E:\Android\myGit\GJBaseFrame\GJBaseFrame\app\src\main\java\com\yubaokang\baseframe\views\App.java:6: error: could not find the symbol
Com.yubaokang.baseframe.dagger.component.DaggerAppComponent import;
^
Symbol: class DaggerAppComponent
Location: package com.yubaokang.baseframe.dagger.component
Error: service configuration file is not correct, or structural processing program object javax.annotation.processing.Processor: provider butterknife.compiler.ButterKnifeProcessor could not be instantiated: java.lang.NoSuchMethodError: com.squareup.javapoet.CodeBlock.of (Ljava/lang/String; [Ljava/lang/Object;) Lcom/squareup/javapoet/CodeBlock; thrown exception error
Build failed with an exception. FAILURE:
* went wrong: What
Failed for task Execution ': app:compileDebugJavaWithJavac'.

failed see; the compiler error output for details. Compilation * Try: With --stacktrace Run option to get the stack trace. Run with --info or --debug option to get more log output.enter image description here

``` click open error image

duggu
  • 37,851
  • 12
  • 116
  • 113

2 Answers2

0

1.

compile 'com.google.dagger:dagger:2.5'
provided 'com.google.dagger:dagger-compiler:2.5'// modify apt to provided

2.in app/build.gradle add

packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}

on android {}

refer to http://www.cnblogs.com/yizuochengchi2012/p/5659362.html

0

Please check both dagger and butterknif versions.

Ex:

butterknife should be like.

implementation 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'

dagger should be like.

annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
implementation 'com.google.dagger:dagger:2.9'
Surendar D
  • 5,554
  • 4
  • 36
  • 38