2016-04-26 8 views
1

Ich bin androidannotations 4.0.0 mit Android Studio verwenden,androidannotations 4.0.0 zeigt nicht das Layout

Mein Code wie folgt aus:

@EActivity(resName = "activity_demo_web_sdk") 
public class DemoWebSdkActivity extends AppCompatActivity { 
    String TAG="DemoWebSdkActivity"; 
} 

Nachdem ich diesen Code ausführen, kann ich nicht sehen das Layout, aber wenn ich setContentView anstelle von androidannotations verwende, funktioniert es gut.

Mein gradle ist wie folgt:

apply plugin: 'com.android.library' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    defaultConfig { 
     minSdkVersion 18 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 
buildscript { 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     // replace with the current version of the Android plugin 
     classpath 'com.android.tools.build:gradle:1.5.0' 
     // replace with the current version of the android-apt plugin 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 
    } 
} 

apply plugin: 'android-apt' 
def AAVersion = '4.0.0' 
dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    apt "org.androidannotations:androidannotations:$AAVersion" 
    compile "org.androidannotations:androidannotations-api:$AAVersion" 
} 
apt { 
    arguments { 
     androidManifestFile variant.outputs[0]?.processResources?.manifestFile 
     library true 
     // if you have multiple outputs (when using splits), you may want to have other index than 0 

     // you should set your package name here if you are using different application IDs 
     // resourcePackageName "your.package.name" 

     // You can set optional annotation processing options here, like these commented options: 
     // logLevel 'INFO' 
     // logFile '/var/log/aa.log' 
    } 
} 

Jeder Idee haben, warum es passiert?

Ich bemerkte, dass jemand die gleiche problem treffen, aber keine Antwort zu lösen.

Brauchen Sie Hilfe.

Antwort

1

Es gibt definitiv ein Problem. Sie sollten Strings in den Verarbeitungsparametern verwenden:

library "true" 

auch sicher, dass Sie die generierte Klasse verwenden DemoWebSdkActivity_ im Manifest, und auch, dass man beginnen.

Verwandte Themen