UnifiedNlp
UnifiedNlp copied to clipboard
Integration in AOSP<5.0 build broken
Hi,
I had UnifiedNlp integrated into my cm11 build. I synced today and tried to make a new build. I get the following error:
make: *** No rule to make target /run/media/xxx/cmod11/android/cm11/out/target/common/obj/JAVA_LIBRARIES/UnifiedNlpApi_intermediates/javalib.jar', needed by/run/media/xxx/cmod11/android/cm11/out/target/common/obj/APPS/NetworkLocation_intermediates/classes-full-debug.jar'. Stop.
make: *** Waiting for unfinished jobs....
I also tried to build it directly: make NetworkLocation
target R.java/Manifest.java: NetworkLocation (/run/media/xxx/cmod11/android/cm11/out/target/common/obj/APPS/NetworkLocation_intermediates/src/R.stamp) ERROR: resource directory 'packages/apps/UnifiedNlp/../../../prebuilts/sdk/current/support/v7/appcompat/res' does not exist make: *** [/run/media/xxx/cmod11/android/cm11/out/target/common/obj/APPS/NetworkLocation_intermediates/src/R.stamp] Error 1
Any idea on how I can fix this?
To build the current master, you need to add UnifiedNlpApi to your build tree (it was part of the UnifiedNlp repo before, but moved out for convenience reasons)
Ok, now I get one error further :)
:/run/media/xxx/cmod11/android/cm11> ll packages/apps/UnifiedNlp/../../../prebuilts/sdk/current/ total 21340 -rw-r--r-- 1 dicer users 21832145 Mar 23 2014 android.jar -rw-r--r-- 1 dicer users 2643 Mar 23 2014 framework.aidl -rw-r--r-- 1 dicer users 10070 Mar 23 2014 uiautomator.jar
There is no support/v7/appcompat/res in that folder as expected:
target R.java/Manifest.java: NetworkLocation (/run/media/xxx/cmod11/android/cm11/out/target/common/obj/APPS/NetworkLocation_intermediates/src/R.stamp) Aidl: UnifiedNlpApi <= external/UnifiedNlpApi/src/org/microg/nlp/api/LocationBackend.aidl ERROR: resource directory 'packages/apps/UnifiedNlp/../../../prebuilts/sdk/current/support/v7/appcompat/res' does not exist make: *** [/run/media/xxx/cmod11/android/cm11/out/target/common/obj/APPS/NetworkLocation_intermediates/src/R.stamp] Error 1 make: *** Waiting for unfinished jobs.... Aidl: UnifiedNlpApi <= external/UnifiedNlpApi/src/org/microg/nlp/api/GeocoderBackend.aidl Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest. Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest. Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest. Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Is this my build environment or do I miss a project in CM?
Apparently the prebuilt sdk does not contain the support libraries before android 5.0. cb06193be745a34d45cb2b98c1b160837b85512d should fix the issue.
Ok, we are getting there :)
I guess the following is also a problem resulting from android5 changes?
packages/apps/UnifiedNlp/res/values/themes.xml:8: error: Error: No resource found that matches the given name: attr 'colorPrimary'. packages/apps/UnifiedNlp/res/values/themes.xml:9: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
This is not directly related to android 5, but to the newer version of the android support library. UnifiedNlp requires it to be in version 21, which must be compiled against SDK 21 (Android 5). I'm not sure what's the best way to handle this, maybe i'll just put a pre-compiled support library for non AOSP 5 build systems.
The 1.0.1 release does not require and android 5 features and should build fine with cm11, but lacks address lookup feature. You can use it as a temporary solution (remember to remove the UnifiedNlpApi as it will cause problems with 1.0.1). Alternatively, build using gradle and put the build apk as a prebuilt in the CM11 build system.