I have a 1 activity project, with Android Annotations (using @EActivity to refer to the activity layout) and I am using DeeplinkDispatch on top of it
Seems like both annotations library don't go so well. If I remove either package, the app runs, but not with both
Only activity class
package com.example.android.deeplinktest;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import com.airbnb.deeplinkdispatch.DeepLink;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
@EActivity(R.layout.activity_main)
@DeepLink("foo://deepLink/{id}")
public class MainActivity extends AppCompatActivity {
@AfterViews
public void init(){
if (getIntent().getBooleanExtra(DeepLink.IS_DEEP_LINK, false)) {
Bundle parameters = getIntent().getExtras();
String idString = parameters.getString("id");
((TextView)findViewById(R.id.tv)).setText(idString);
}
}
}
Android Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.deeplinktest" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity_"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.airbnb.deeplinkdispatch.DeepLinkActivity"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="foo" />
</intent-filter>
</activity>
</application>
</manifest>
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.android.deeplinktest"
minSdkVersion 17
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName "com.example.android.deeplinktest"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.airbnb:deeplinkdispatch:1.3.0'
apt 'com.airbnb:deeplinkdispatch-processor:1.3.0'
apt "org.androidannotations:androidannotations:3.2"
compile 'org.androidannotations:androidannotations-api:3.2'
}
Error message
Information:Gradle tasks [clean, :app:compileDebugSources, :app:compileDebugAndroidTestSources]
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72221Library
:app:prepareComAndroidSupportSupportV42221Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJava
Note: Resolve log file to /Users/somghosh/Programming/DeepLinkTest/app/build/generated/source/apt/androidannotations.log
Note: Initialize AndroidAnnotations 3.2 with options {androidManifestFile=/Users/somghosh/Programming/DeepLinkTest/app/build/intermediates/manifests/full/debug/AndroidManifest.xml, resourcePackageName=com.example.android.deeplinktest}
Note: Start processing for 2 annotations on 4 elements
Note: AndroidManifest.xml file found with specified path: /Users/somghosh/Programming/DeepLinkTest/app/build/intermediates/manifests/full/debug/AndroidManifest.xml
Warning:A class activity declared in the AndroidManifest.xml cannot be found in the compile path: [com.airbnb.deeplinkdispatch.DeepLinkActivity]
Note: AndroidManifest.xml found: AndroidManifest [applicationPackage=com.example.android.deeplinktest, componentQualifiedNames=[com.example.android.deeplinktest.MainActivity_], permissionQualifiedNames=[], applicationClassName=null, libraryProject=false, debugabble=false, minSdkVersion=17, maxSdkVersion=-1, targetSdkVersion=22]
Note: Found project R class: com.example.android.deeplinktest.R
Note: Found Android class: android.R
Note: Validating elements
Note: Validating with EActivityHandler: [com.example.android.deeplinktest.MainActivity]
Note: Validating with AfterViewsHandler: [init()]
Note: Processing root elements
Note: Processing root elements EActivityHandler: [com.example.android.deeplinktest.MainActivity]
Note: Processing enclosed elements
Note: Number of files generated by AndroidAnnotations: 1
Note: Writting following API classes in project: []
Note: Generating class: com.example.android.deeplinktest.MainActivity_
Note: Time measurements: [Whole Processing = 259 ms], [Extract Manifest = 178 ms], [Process Annotations = 32 ms], [Generate Sources = 18 ms], [Find R Classes = 14 ms], [Extract Annotations = 4 ms], [Validate Annotations = 4 ms],
Note: Finish processing
Error:Error creating file
Note: Start processing for 0 annotations on 3 elements
Note: Time measurements: [Whole Processing = 0 ms],
Note: Finish processing
Note: Start processing for 0 annotations on 0 elements
Note: Time measurements: [Whole Processing = 1 ms],
Note: Finish processing
1 warning