- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试构建项目时出现此拖动器异常。我需要帮助来解决这个问题。我在网站上搜索,发现了一些类似的问题。我尝试了解决方案
但对我来说没有任何效果。这里是build.gradle文件代码
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.firstup.android"
minSdkVersion 16
targetSdkVersion 27
versionCode 10
versionName "1.0.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support:support-v4:27.0.0'
implementation 'com.android.support:recyclerview-v7:27.0.0'
implementation('com.android.support:design:27.0.2'){
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'recyclerview-v7'
}
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation('com.google.android.gms:play-services-auth:11.4.2'){
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.google.android.gms', module: 'play-services-base'
}
implementation('com.google.android.gms:play-services-base:11.4.2'){
exclude group: 'com.android.support', module: 'support-v4'
}
// implementation 'com.google.android.gms:play-services-gcm:11.4.2'
// ExoPlayer
implementation 'com.google.android.exoplayer:exoplayer:r2.4.4'
// Mixpanel
implementation 'com.mixpanel.android:mixpanel-android:4.9.8'
// SwipeLayout
implementation 'com.github.rambler-digital-solutions:swipe-layout-android:1.0.14'
// ViewPagerIndicator
implementation 'me.relex:circleindicator:1.2.2@aar'
// ButterKnife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
// Dagger 2
implementation 'com.google.dagger:dagger:2.12'
annotationProcessor('com.google.dagger:dagger-compiler:2.12'){
exclude group: 'com.google.dagger', module: 'dagger'
}
//MaterialPicker
implementation 'com.wdullaer:materialdatetimepicker:3.1.2'
implementation('com.wdullaer:materialdatetimepicker:3.1.2'){
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'recyclerview-v7'
}
// RxAndroid
implementation 'io.reactivex:rxjava:1.2.0'
implementation('io.reactivex:rxandroid:1.2.1'){
exclude group: 'io.reactivex', module: 'rxjava'
}
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation('com.squareup.retrofit2:adapter-rxjava:2.0.2'){
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
}
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation('com.squareup.retrofit2:converter-gson:2.3.0'){
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
exclude group: 'com.google.code.gson', module: 'gson'
}
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation('com.squareup.retrofit2:converter-simplexml:2.3.0'){
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
}
// Gson
implementation 'com.google.code.gson:gson:2.8.0'
// Facebook
implementation 'com.facebook.android:facebook-android-sdk:4.19.0'
implementation('com.facebook.android:facebook-android-sdk:4.19.0'){
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'customtabs'
}
// Glide
implementation 'com.github.bumptech.glide:glide:4.3.0'
implementation 'com.android.support:customtabs:27.0.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation('uk.co.chrisjenx:calligraphy:2.3.0'){
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'appcompat-v7'
}
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'junit', module: 'junit'
})
testCompile 'junit:junit:4.12'
}
堆栈跟踪
Information:Gradle tasks [clean, :app:assembleDebug]
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\alarm\alarm_clock\AlarmActivity.java
Error:(11, 61) error: cannot find symbol class DaggerAlarmActivityComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\base\BaseActivity.java
Error:(13, 55) error: cannot find symbol class DaggerBaseActivityComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\alarm\alarm_clock\AlarmChallengeFragment.java
Error:(12, 61) error: cannot find symbol class DaggerAlarmFragmentComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\alarm\alarm_clock\AlarmClockFragment.java
Error:(11, 61) error: cannot find symbol class DaggerAlarmFragmentComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\alarm\alarm_list\AlarmListFragment.java
Error:(15, 60) error: cannot find symbol class DaggerAlarmListComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\alarm\set_up_alarm\AddAlarmFragment.java
Error:(14, 62) error: cannot find symbol class DaggerIAddAlarmComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\application\FirstUpApplication.java
Error:(12, 55) error: cannot find symbol class DaggerAppComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\auth\AuthActivity.java
Error:(13, 57) error: cannot find symbol class DaggerAuthActivityComponent
Error:(16, 57) error: cannot find symbol class DaggerAuthComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\auth\change_password\ChangePasswordFragment.java
Error:(10, 64) error: cannot find symbol class DaggerIChangePasswordComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\brands\BrandFragment.java
Error:(17, 50) error: cannot find symbol class DaggerBrandComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\brands\CommonScreenActivity.java
Error:(13, 50) error: cannot find symbol class DaggerIBrandActivityComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\campaigns\campaign_item\CampaignFragment.java
Error:(20, 67) error: cannot find symbol class DaggerICampaignComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\campaigns\finished\FinishedCampaignsFragment.java
Error:(14, 62) error: cannot find symbol class DaggerFinishedCampaignsComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\campaigns\pager\CampaignPagerFragment.java
Error:(16, 59) error: cannot find symbol class DaggerICampaignPagerComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\main\MainActivity.java
Error:(24, 48) error: cannot find symbol class DaggerMainActivityComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\main\home\HomeFragment.java
Error:(31, 53) error: cannot find symbol class DaggerHomeComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\main\settings\user_settings\change_email\ChangeEmailFragment.java
Error:(11, 84) error: cannot find symbol class DaggerIChangeEmailComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\main\settings\user_settings\UserSettingsFragment.java
Error:(15, 71) error: cannot find symbol class DaggerIUserSettingComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\main\vibes\VibesFragment.java
Error:(18, 54) error: cannot find symbol class DaggerVibesComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\news\NewsFragment.java
Error:(19, 48) error: cannot find symbol class DaggerNewsComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\onboarding\OnboardingInfoFragment.java
Error:(17, 54) error: cannot find symbol class DaggerOnboardingComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\settings\alarm_settings\AlarmSettingsFragment.java
Error:(24, 67) error: cannot find symbol class DaggerAlarmSettingsComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\settings\settings_activity\SettingsActivity.java
Error:(23, 70) error: cannot find symbol class DaggerSettingsActivityComponent
F:\FirstUP_android-develop\app\src\main\java\com\firstup\android\presentation\well_done\WellDoneFragment.java
Error:(27, 53) error: cannot find symbol class DaggerWellDoneComponent
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NoClassDefFoundError: dagger/Provides
Information:BUILD FAILED in 1m 3s
Information:26 errors
Information:0 warnings
Information:See complete output in console
为 Error:(11, 61) 错误添加 AppComponent 代码:找不到符号类 DaggerAlarmActivityComponent
package com.firstup.android.presentation.alarm.alarm_clock.di;
import com.firstup.android.presentation.alarm.alarm_clock.AlarmActivity;
import com.firstup.android.presentation.application.di.AppComponent;
import com.firstup.android.presentation.application.di.BaseActivityModule;
import com.firstup.android.presentation.application.di.PerActivity;
import dagger.Component;
/**
* Created by
* rMozes on 2/27/17.
*/
@PerActivity
@Component(dependencies = AppComponent.class, modules = BaseActivityModule.class)
public interface AlarmActivityComponent {
void inject(AlarmActivity _activity);
}
package com.firstup.android.presentation.alarm.alarm_clock;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Window;
import android.view.WindowManager;
import com.firstup.android.R;
import com.firstup.android.global.Constants;
import com.firstup.android.presentation.alarm.alarm_clock.di.DaggerAlarmActivityComponent;
import com.firstup.android.presentation.application.FirstUpApplication;
import com.firstup.android.presentation.application.di.BaseActivityModule;
import com.firstup.android.presentation.base.BaseActivity;
import com.firstup.android.presentation.base.BaseFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ru.rambler.libs.swipe_layout.SwipeLayout;
/**
* Created by
* rMozes on 2/26/17.
*/
public class AlarmActivity extends BaseActivity {
@BindView(R.id.swipeLayout_AAC) SwipeLayout mSwipeLayout;
private BaseFragment mFragment;
public static Intent getCallingIntent(String _type) {
Intent intent = new Intent(FirstUpApplication.getInstance(), AlarmActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(Constants.Preferences.SP_ALARM_TYPE, _type);
return intent;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alarm_clock);
ButterKnife.bind(this);
initialize();
disableLock();
DaggerAlarmActivityComponent.builder()
.appComponent(FirstUpApplication.getInstance().getAppComponent())
.baseActivityModule(new BaseActivityModule(this))
.build()
.inject(this);
if (savedInstanceState == null)
initialize();
}
private void initialize() {
// switch (getIntent().getStringExtra(Constants.Preferences.SP_ALARM_TYPE)) {
switch (mSPUtils.getAlarmType()) {
case Constants.Preferences.SP_ALARM_TYPE_CHALLENGE:
initializeChallenge();
break;
case Constants.Preferences.SP_ALARM_TYPE_SWIPE:
initializeSwipe();
break;
}
}
private void initializeChallenge() {
mSwipeLayout.setSwipeEnabled(false);
getFragmentNavigator()
.replaceFragmentWithoutBackStack(AlarmChallengeFragment.newInstance());
}
private void initializeSwipe() {
mSwipeLayout.setSwipeEnabled(true);
mSwipeLayout.setOnSwipeListener(mListener);
mFragment = AlarmClockFragment.newInstance();
getFragmentNavigator().replaceFragmentWithoutBackStack(mFragment);
}
private void onSwipe() {
((AlarmContract.View) mFragment).onSwipe();
}
private void disableLock() {
Window window = this.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
}
@Override
public int getContainerId() {
return R.id.flContainer_AAC;
}
@Override
public int getToolbarId() {
return -1;
}
private SwipeLayout.OnSwipeListener mListener = new SwipeLayout.OnSwipeListener() {
@Override
public void onBeginSwipe(SwipeLayout swipeLayout, boolean moveToRight) {}
@Override
public void onSwipeClampReached(SwipeLayout swipeLayout, boolean moveToRight) {
onSwipe();
}
@Override
public void onLeftStickyEdge(SwipeLayout swipeLayout, boolean moveToRight) {}
@Override
public void onRightStickyEdge(SwipeLayout swipeLayout, boolean moveToRight) {}
};
}
最佳答案
不要在您的build.gradle
中排除dagger-compiler 的任何内容,按照Dagger doc 中的说明添加它
dependencies {
compile 'com.google.dagger:dagger:2.x'
annotationProcessor 'com.google.dagger:dagger-compiler:2.x'
}
关于android - java.lang.NoClassDefFoundError : dagger/Provides 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48419971/
我一直在尝试在我的代码中使用 Jar 文件作为库,并且它编译得很好。但是,在运行时,我不断收到 NoClassDefFoundError信息。为什么会这样?我也在编译路径和运行时路径中包含了 Jar
关于Apache-Kafka messaging queue . 我已经从 Kafka 下载页面下载了 Apache Kafka。我已将其提取到 /opt/apache/installed/kafka
我正在尝试使用 Apache DefaultHttpClient 来执行 JSON POST 请求,当我尝试实例化它时它给我一个 NoClassDefFound 错误。 HttpClient clie
当我在模拟器(Nexus One API 22)上测试我的应用程序时,它运行顺利,没有失败。然而,当我在自己的个人手机(三星 Galaxy S5,Android 版本 5.0)上测试该应用程序时,它崩
我需要在python中使用java代码来减少,所以我选择了Jython。一段时间后,我设法弄清楚了如何运行我的代码,但我遇到了最奇怪的事情。当我写作时 from vohmm.corpus import
这是我的mybatis配置。这是我的pom.xml。。当我运行项目时,它显示了错误的原因:org/mybatis/spring/mapper/MapperScannerConfigurer.有没有人能
所以我正在尝试构建一个简单的gradle应用,当我运行它时, geb.ConfigurationLoader$UnableToLoadException: Unable to load configu
假设我有一个主类应用程序,它使用 URLClassLoader 加载子目录 plugins 中的所有 jar: public class App(){ public static void m
我在尝试运行 Netbeans (7.2) 时遇到一个反复出现的错误,上次遇到它时,我发现某个地方可以将所有文件移动到一个新项目。这可能会奏效,但我的项目的规模让这很麻烦。这是踪迹... Except
这个问题已经有答案了: Including all the jars in a directory within the Java classpath (25 个回答) 已关闭 6 年前。 我得到一个
在这里,我正在下载网页源代码,然后将其存储在文本文件中。然后我读取该文件并将其与正则表达式匹配以搜索特定字符串。 没有编译器错误。 Exception in thread "main" java.la
我正在一个“大”的 Maven/Java 项目中工作,无法理解运行应用程序时遇到的错误(它编译正常)。我得到的错误代码是: java.lang.NoClassDefFoundError: Could
对于学校的作业,我需要创建一个类 Blender 来实现一些预定义的东西。我收到了一个 JAR 文件 imagecompositor.jar,它可以完成所有操作并使用 Blender 类。 JAR 文
我遇到了一个问题,即抛出 NoClasDefFoundError。这让我感到困惑,因为我正在使用接口(interface),并且没有类定义应该可用。我已经阅读了一些指向类路径的帖子,但我不认为这是这里
我正在使用 hibernate,在使用 hibernate Connection 时出现如下错误 java.lang.NoClassDefFoundError: Could not initializ
我有一个使用 SubVersion 的 Android 项目。我使用 Subclipse 将项目导入我的 Eclipse Wordspace。 现在我有一个问题: java.lang.NoClass
我需要编译一个外部 java 文件(比如 a.java)。这是我为此编写的代码。 (字符串路径包含java和class文件的路径) command[0] = "javac"; comm
我正在尝试运行一个基本的 Hibernate 程序。当我运行它时,出现以下错误 java.lang.NoClassDefFoundError: org/jboss/logging/BasicLogge
标题:Eclipse插件开发由于java.lang.NoClassDefFoundError无法实例化类: 试图构建一个 eclipse 插件,但遇到一些运行时错误.. 我知道这是由于代码所依赖的类文
我是新手,我无法让它工作......:/ 我的 build.sbt: val apacheDeps = Seq( "commons-validator" % "commons-validator"
我是一名优秀的程序员,十分优秀!