Affectiva Affdex SDKを使用し、gradleファイルに含めるアプリケーションを開発しています。私のMacBookで自宅でプロジェクトを開こうとするまで、仕事中のコンピュータでうまく動作しました。(WindowsとAppleとの関係はあまりないと思うので、私はプロ/ cons Apple vs Windows;)) 依存関係compile 'com.affectiva.android:affdexsdk:3.2.0'
が解決できないため、ビルドに失敗することがあります。 私はそれが関連しているが、職場では私はプロキシを使用していない。私は家を使わない。AffectivaのGradleビルドに失敗する別のコンピュータでプロジェクトを開くときに、Affidex SDKの依存関係を解決できない
はここでエラーです:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not resolve com.affectiva.android:affdexsdk:3.2.0.
Required by:
Emojat:app:unspecified
> Could not resolve com.affectiva.android:affdexsdk:3.2.0.
> Could not get resource 'http://maven.affectiva.com/com/affectiva/android/affdexsdk/3.2.0/affdexsdk-3.2.0.pom'.
> Could not GET 'http://maven.affectiva.com/com/affectiva/android/affdexsdk/3.2.0/affdexsdk-3.2.0.pom'.
> Connect to 192.168.205.11:8080 [/192.168.205.11] failed: Operation timed out
これは私のアプリのGradleのである:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.example.plucinst.emojat"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.affectiva.android:affdexsdk:3.2.0'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:support-v13:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
}
これは、プロジェクトのGradleです:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
maven {
url "http://maven.affectiva.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
必要であれば、私は知らないが、ここでマニフェストだ:事前に
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.plucinst.emojat">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
tools:replace="android:allowBackup,android:label"
android:allowBackup="true"
android:icon="@drawable/launcher_icon_alternativ3"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:largeHeap="true"
android:hardwareAccelerated="true"
>
<activity android:name="com.example.plucinst.emojat.MainActivity"><!--com.example.plucinst.emojat.MainActivity-->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.plucinst.emojat.ScreenSlidePagerActivity"></activity>
<activity android:name="com.example.plucinst.emojat.ChatActivity"></activity>
<activity android:name="com.example.plucinst.emojat.InboxActivity"></activity>
<activity android:name="com.example.plucinst.emojat.EmojiDetectionActivity"></activity>
<activity android:name="com.example.plucinst.emojat.EmojiSelectionActivity"></activity>
<activity android:name="com.example.plucinst.emojat.AndroidDatabaseManager"></activity>
<activity android:name="com.example.plucinst.emojat.SettingsActivity"></activity>
</application>
多くの感謝! :)
私は 'compile 'com.affectiva.android:affdexsdk:3.2.0'''を' compile' com.affectiva.android:affdexsdk:3 + ''に置き換えることでこの問題を解決しました。私は予測不可能なビルドのために '+'を使用することは推奨されていませんが、これが今まで私が見つけた唯一の方法でした。 –