- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建一个android应用程序,我的成绩构建遇到了一些麻烦。
当我整体构建“app”时,构建完成(有错误),但是项目可以编译,但这不是我的问题。
我刚刚为我编写的匹配引擎类编写了一个小型测试器类,并期望查看控制台输出以查看匹配发生的位置。但是,当我尝试运行MatchEngineTester类时,它无法编译,并且出现以下错误:
Error:Gradle: Execution failed for task':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/amazonaws/services/cognitoidentityprovider/AmazonCognitoIdentityProviderClient.class
import java.util.ArrayList;
import java.util.List;
import joe_perkins.coursematch.Objects.Course;
import joe_perkins.coursematch.Objects.User;
/** MatchEngineTester is a test class primarily designed to test the accuracy
* and efficiency of the simple match algorithm that determines suitable courses
* based on keywords
* Created by Joe on 09/07/2016.
*/
public class MatchEngineTester {
public static void main(String[] args) {
/**
* ****************************************************************
* Manually Create a new user, assign it some values to each member
* variable.
* ****************************************************************
*/
// Instantiate new user
User user = new User();
// Instantiate new list to hold the user interests
List<String> interestList = new ArrayList<String>();
interestList.add("Pokemon");
interestList.add("Technology");
interestList.add("Hockey");
interestList.add("Programming");
interestList.add("Music");
interestList.add("Gaming");
interestList.add("Badminton");
interestList.add("Tennis");
interestList.add("Computing");
interestList.add("Coding");
interestList.add("Calligraphy");
interestList.add("Reading");
interestList.add("Writing");
interestList.add("Travel");
interestList.add("Foreign Language");
interestList.add("Politics");
// Instantiate new list to hold the user favourite subjects
List<String> faveSubjectsList = new ArrayList<String>();
faveSubjectsList.add("Maths");
faveSubjectsList.add("Law");
faveSubjectsList.add("IT");
faveSubjectsList.add("Psychology");
// Instantiate new list to hold the users GCSEs
List<String> gcseList = new ArrayList<String>();
gcseList.add("Maths");
gcseList.add("English Literature");
gcseList.add("English Language");
gcseList.add("Psychology");
gcseList.add("Biology");
gcseList.add("Physics");
gcseList.add("French");
gcseList.add("Spanish");
gcseList.add("RE");
gcseList.add("PE");
gcseList.add("Woodwork");
// Instantiate a new list to hold the users A-Levels
List<String> aLevelsList = new ArrayList<String>();
aLevelsList.add("Psychology");
aLevelsList.add("Maths");
aLevelsList.add("Law");
aLevelsList.add("Politics");
aLevelsList.add("Product Design");
// Instantiate a new list to hold the users interested future job titles
List<String> futureJobTitleList = new ArrayList<String>();
futureJobTitleList.add("Software Engineer");
futureJobTitleList.add("Psychologist");
futureJobTitleList.add("Game Designer");
futureJobTitleList.add("Product Designer");
// Set user characteristics
user.setFirst_name("Joe");
user.setLast_name("Perkins");
user.setUsername("freshwaterjoe");
user.setInterests(interestList);
user.setFavourite_subjects(faveSubjectsList);
user.setGcses(gcseList);
user.setA_levels(aLevelsList);
user.setInterested_job_titles(futureJobTitleList);
/**
* *********************************************************************
* Manually compile a small list of courses, feeding them the appropriate
* member variables in order for the course object to be whole. Courses
* may be created using an empty constructor, however in order for matches
* to take place, courses MUST possess keywords.
* *********************************************************************
*/
Course compSci = new Course();
Course productDesign = new Course();
Course frenchLanguage = new Course();
Course physics = new Course();
// List to hold course keywords for compSci
List<String> compSciKeywords = new ArrayList<String>();
compSciKeywords.add("IT");
compSciKeywords.add("Computing");
compSciKeywords.add("Coding");
compSciKeywords.add("Programming");
compSciKeywords.add("Game Design");
compSciKeywords.add("Maths");
compSciKeywords.add("Technology");
compSciKeywords.add("Software");
compSciKeywords.add("Developer");
compSciKeywords.add("Software Engineer");
compSciKeywords.add("Computer Science");
// List to hold course keywords for productDesign
List<String> productDesignKeywords = new ArrayList<String>();
productDesignKeywords.add("Woodwork");
productDesignKeywords.add("Product Design");
productDesignKeywords.add("Graphic Design");
productDesignKeywords.add("Textiles");
productDesignKeywords.add("Design");
productDesignKeywords.add("Enterprise");
productDesignKeywords.add("Concept Product");
// List to hold course keywords for frenchLanguage
List<String> frenchLanguageKeywords = new ArrayList<String>();
frenchLanguageKeywords.add("Modern Foreign Languages");
frenchLanguageKeywords.add("MFL");
frenchLanguageKeywords.add("French");
frenchLanguageKeywords.add("France");
frenchLanguageKeywords.add("French Language");
frenchLanguageKeywords.add("Study Abroad");
frenchLanguageKeywords.add("French Culture");
// List to hold course keywords for physics
List<String> physicsKeywords = new ArrayList<String>();
physicsKeywords.add("Physics");
physicsKeywords.add("Maths");
physicsKeywords.add("Science");
physicsKeywords.add("Space");
physicsKeywords.add("Matter");
physicsKeywords.add("Energy");
physicsKeywords.add("Force");
// Add keywords to each course
compSci.setCourseKeyWords(compSciKeywords);
productDesign.setCourseKeyWords(productDesignKeywords);
frenchLanguage.setCourseKeyWords(frenchLanguageKeywords);
physics.setCourseKeyWords(physicsKeywords);
/**
* *********************************************************************
* Manually Create a new MatchEngine object, build the engines map,
* assess the course suitability for given courses, and return courses
* that are considered 'Matchable'.
* *********************************************************************
*/
// Instantiate new match engine
MatchEngine me = new MatchEngine(user);
me.buildMap(interestList, 2);
me.buildMap(faveSubjectsList, 4);
me.buildMap(gcseList, 2);
me.buildMap(aLevelsList, 5);
me.buildMap(futureJobTitleList, 5);
me.assessCourseSuitability(compSci);
me.assessCourseSuitability(productDesign);
me.assessCourseSuitability(frenchLanguage);
me.assessCourseSuitability(physics);
me.generateSuggestedCourses(3);
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "joe_perkins.coursematch"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.github.kikoso:SwipeableCards:1.1-RELEASE@aar'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.amazonaws:aws-android-sdk-core:2.2.+'
compile 'com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.2.+'
compile 'com.amazonaws:aws-android-sdk-ddb:2.2.+'
compile 'com.amazonaws:aws-android-sdk-ddb-mapper:2.2.+'
}
最佳答案
该错误消息表明存在AmazonCognitoIdentityProviderClient的重复副本。项目中可能包含多个Cognito IdentityProvider库,一个库在libs文件夹下,另一个库在Maven中。您可以去检查libs文件夹下的库吗?另外,清洁gra斗可能会有所帮助。
关于java - AWS错误:Gradle:任务 ':app:transformClassesWithJarMergingForDebug'的执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38292455/
如果我调用一个应用程序两次或多次,但只有一个实例应该运行(这是所需的),我就会遇到一个问题。 首先一些(可能必要的)背景信息: 使用 MAC OS X El Capitan (10.11.6) 我有一
覆盖文件。覆盖 Apps 脚本文件。 这是不是 创建一个新的 Apps 脚本文件的问题。那对我没有帮助。我需要更新 现有的 Apps 脚本文件。这个问题类似于创建一个新文件,但不是同一个问题。更新的语
我是 Apps 脚本的新手,正在尝试了解使用另一个帐户在一个帐户中运行/触发脚本的基础知识。需要注意的是:我想在访问脚本的用户而不是拥有脚本的用户的情况下运行脚本——以便将运行时间分配给访问的用户。
我是 Apps 脚本的新手,正在尝试了解使用另一个帐户在一个帐户中运行/触发脚本的基础知识。需要注意的是:我想在访问脚本的用户而不是拥有脚本的用户的情况下运行脚本——以便将运行时间分配给访问的用户。
我有一个安卓应用程序。我想为我的应用程序实现 App Indexing。 我已经点击了 Google 开发者链接 https://developers.google.com/app-indexing/
有什么区别: import App from '../components/App'; 和 var App = require('../components/App'); 两者都用于获取组件,但它没有
问题: 我有一个使用 requireJS 的简单演示应用程序。当require.min.js脚本加载时,它尝试加载入口点脚本。但是,问题是,而不是 localhost:8090/js/app.js它尝
我正在构建一个 React Native 应用程序,目前正在尝试通过 Firebase Auth 实现一个身份验证注册系统。我已经按照指南/网站上的文档来设置 Firebase 配置文件。我运行该应用
因此 app.yaml 文件的一部分如下所示(至少在 GAE 教程中): handlers: - url: /.* script: main.app 但是,我也看到它看起来像这样: handler
我是Android App开发的新手。当我尝试创建一个新项目Android Project时,弹出以下消息: Information:Gradle tasks [:app:generateDebugS
我正在编写一个应用程序脚本(用于处理电子邮件、任务和日历事件)并希望将其部署为网络应用程序。 该应用程序将在运行它的用户的上下文中运行。该应用程序将被超过 10k+ 的用户使用,甚至可能更多。 在将其
我需要实现一个用于登录网站的 Google Apps 脚本应用,然后如果该网站上的身份验证过程成功,用户应该会在 google 脚本边栏中收到一条消息。 例如:用户输入他的邮箱和密码,然后他点击登录按
我正在开发一个跨平台应用程序,它将在 Google Play 商店和 App Store 上发布。 Google Play 政策以及 App Store 政策规定,您不能使用其他支付系统购买将在应用程
我的 AppEngine 应用程序在我的台式机上的开发服务器上运行良好,但我无法在 Google 服务器上获取版本以关注我的源代码更新。 这是最有说服力的例证。我的 app.yaml 文件开始于: a
我像这样将所有内容重定向到我的 app.yaml 中的单个文件 - url: /.* script: frontcontroller.application 但我仍然必须使用 robots.txt
我想构建一个基于 App Engine 的网络应用程序,并使用 Google 帐户对用户进行身份验证。我需要来自多个域的用户可以登录。从我读到的内容看来,仅使用 Google Accounts API
我无法将我的域指向我使用 Google App Engine 托管的网站。这是背景……注意区分“google apps”(域托管、电子邮件等)和“google app engine”(网站框架)的概念
是否可以通过 App Engine 上内置的 OpenId 实现单点登录?我一直在尝试集成一个 Marketplace 应用程序,并让用户在来自 Google Apps(管理面板或通用导航)时登录。我
有没有办法从 azure-cli 为 Web 应用或函数应用创建和/或激活 App Insights? 现在浏览文档。 最佳答案 我之前也考虑过你的问题。要创建应用程序洞察力,az resource
我在以 Angular 创建新项目时遇到问题。当我运行 ng new myapp 命令时,我得到以下命令 ng 新问候语 Error: Path "/app/app.module.ts" does n
我是一名优秀的程序员,十分优秀!