1

私はJavaとAndroidの開発が初めてです。検証にはAndroid Saripaar v2 (thx at Ragunath Jawahar)を使用します。

私はアンドロイドスタジオを使用しています。

他のモジュールのない新しいきれいな Android プロジェクトでは、非常にうまく機能します。

しかし、私のマルチ モジュール アプリケーションでは、注釈のmessageResIdプロパティに問題があります。(属性値は定数でなければなりません)

ここに私のコード:

build.gradle (モジュール: アプリ)

...
// workaround for "duplicate files during packaging of APK" issue
// see https://groups.google.com/d/msg/adt-dev/bl5Rc4Szpzg/wC8cylTWuIEJ
packagingOptions {
    exclude 'META-INF/ASL2.0'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
}

allprojects {
     repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "http://files.couchbase.com/maven2/" }
     }
 }

 dependencies {
     compile fileTree(dir: 'libs', include: ['*.jar'])
     compile 'com.android.support:appcompat-v7:21.0.3'
     compile 'com.android.support:support-v4:21.0.3'
     compile project(':auth')
 }
...

build.gradle (モジュール: auth)

 dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:21.0.3'
      compile 'com.facebook.android:facebook-android-sdk:3.21.1'
      compile 'com.google.android.gms:play-services:6.5.87'
      compile 'com.mobsandgeeks:android-saripaar:2.0-SNAPSHOT'
      compile project (':other_api_module')
 }

auth/java/.../SignInFragment.javaこのファイルのエラー

 public class SignInFragment extends Fragment implements View.OnClickListener, View.OnFocusChangeListener, Validator.ValidationListener{

 String TAG = SignInFragment.class.getName();
 private ISignInFragment iSignInFragment;

 @Email(messageResId = R.string.editTextEmailValidationError) //ERROR: Attribute (R.string.editTextEmailValidationError) value must be constant
 private EditText editTextEmail;
 private EditText editTextPassword;
 static public String EMAIL = "email";
4

1 に答える 1