Android 4.4 port compile error - android

I've been working on an android 4.4 kitkat port to D2ATT and I keep getting this build error:
including ./hardware/qcom/display/Android.mk ...
build/core/copy_headers.mk:15: warning: overriding commands for target out/target/product/d2att/obj/include/qcom/display/copybit.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for targetout/target/product/d2att/obj/include/qcom/display/copybit.h'
build/core/copy_headers.mk:15: warning: overriding commands for target out/target/product/d2att/obj/include/qcom/display/copybit_priv.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for targetout/target/product/d2att/obj/include/qcom/display/copybit_priv.h'
build/core/base_rules.mk:134: *** hardware/qcom/display/msm8960/liblight: MODULE.TARGET.SHARED_LIBRARIES.lights.msm8960 already defined by device/samsung/d2-common/liblights. Stop.
Does anyone know how to fix this or what it means? Thanks!

This means MODULE.TARGET.SHARED_LIBRARIES.lights.msm8960 is defined by both hardware/qcom/display/msm8960/liblight and device/samsung/d2-common/liblights files, so you either remove one of them from the linking -if you don't have source code- or comment this definition in one of them.

Related

Warning: can't find referenced method 'int save(int)' in library class android.graphics.Canvas

I'm using a no-longer maintained Umano's AndroidSlidingUpPanel library in one of my applications:
dependencies {
// .. redacted
implementation 'com.sothree.slidinguppanel:library:3.4.0'
}
Everything worked fine till now. Today I've tried to change the compileSdkVersion from 27 to 28, and the release build started to fail with a Proguard error (minifyEnabled set to true):
$ ./gradlew clean assembleRelease
> Task :app:transformClassesAndResourcesWithProguardForRelease FAILED
ProGuard, version 6.0.3
Reading input...
// many lines with 'Reading program jar...', redacted
Initializing...
Warning: com.sothree.slidinguppanel.SlidingUpPanelLayout: can't find referenced method 'int save(int)' in library class android.graphics.Canvas
// redacted
Warning: there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.
BUILD FAILED in 2s
I'm using AGP v3.5.0, with android.enableR8=false configuration to favor Proguard over R8.
One of the comments in this issue suggests to ignore the warning using -dontwarn com.sothree.**, which indeed causes the build to pass.
Why this warning started to appear in the first place, and are there any possible ramifications for ignoring it?
Let's analyze the warning message:
Warning: com.sothree.slidinguppanel.SlidingUpPanelLayout: can't find
referenced method 'int save(int)' in library class
android.graphics.Canvas
Library's SlidingUpPanelLayout.java source file indeed includes a android.graphics.Canvas#save(int) method invocation:
final int save = canvas.save(Canvas.CLIP_SAVE_FLAG);
This method is deprecated since API 26, and was marked as #removed in API 28.
The #removed annotation (along with #hide annotation) is being used by doclava tool (AOSP tool which generates public framework API stub, a.k.a. android.jar) to mark public class methods as hidden.
To summarize: the android.graphics.Canvas#save(int) method was removed from the public API, but it is still part of the runtime/framework (see also this). During minification stage Proguard analyzes the bytecode and obviously fails to find the not-anymore-public-api android.graphics.Canvas#save(int) method and displays the above warning.
This method is still present in runtime, therefore Proguard warning can be ignored given two caveats:
Since this method is not part of public API anymore, a particular vendor might alter the framework classes (i.e., by renaming/removing this method) in a way which will cause runtime errors.
This method might be removed in future AOSP version, and you probably won't notice that till this method will be called on affected device.
The warning ignore rule can be narrowed to:
-dontwarn com.sothree.slidinguppanel.SlidingUpPanelLayout
In a long run, I'd suggest to consider patching this library by yourself (by changing the functionality to use the parameterless android.graphics.Canvas#save() method), or if that's not possible - migrate to another solution.

Building Android 7 from sources: export_includes and import_includes related error

I encountered the following error when I tried to build Android 7 (QAEP from codeaurora.org):
ninja: error:
'out/target/product/msm8916_64/obj_arm/SHARED_LIBRARIES/
libqct_resampler_intermediates/export_includes', needed by
'out/target/product/msm8916_64/obj_arm/SHARED_LIBRARIES/
libaudioresampler_intermediates/import_in',
missing and no known rule to make it
make: *** [build/core/ninja.mk:149: ninja_wrapper] Error 1
I did a quick find for *qct* and *audioresampler*. The first one returned only a few source files from the vendor wlan driver, but no library (e.g. libqct directory). And the second returned nothing at all.
What does this error mean? Are there missing modules, that are referenced but not included in the manifest?
Any help is appreciated.

warning: libcryptopp.so: is missing DT_SONAME will use basename as a replacement

I am trying to build libcryptopp.so and include it in my JNI code, follow the guide in Android Crypto++, I experienced the following problems.
Missing symbol problems in Crypto++ 5.6.3
Originally I used Crypto++ 5.6.3, I came across this problem:
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_Z9GlobalRNGv"
referenced by "/data/app/com.example.administrator.jnitest-2/lib/arm/libcryptopp.so"...
I check the libcryptopp.so:
$ readelf -Ws libcryptopp.so | grep _Z9GlobalRNGv
1406: 00000000 0 NOTYPE GLOBAL DEFAULT UND _Z9GlobalRNGv
15836: 00000000 0 NOTYPE GLOBAL DEFAULT UND _Z9GlobalRNGv
switching to Crypto++ 5.6.4 fix this problem, but I still do not know the cause and met another problem:
Missing DT_SONAME
12-21 09:50:20.837 21677-21677/com.example.administrator.jnitest
W/linker: /data/app/com.example.administrator.jnitest- 1/lib/arm/libcryptopp.so: is missing DT_SONAME will use basename as a
replacement: "libcryptopp.so"
Actually this is only a warning, app will not crash.
I am using the latest version of android Mashwallow MOB31K.
Somebody have also experienced similar problems using other libraries
https://github.com/bytedeco/javacpp-presets/issues/188
on Android N-preview.
Why am I getting the warning, and how do I fix it?
After some attempts, I find one imperfect solution.
It appears that android N turns requires library version now.
turn on SONAME flag on build.
Cryptopp turns off the version flag by defaults. In the GNUmakefile-cross,:
HAS_SOLIB_VERSION ?= 0
set the value to 1:
HAS_SOLIB_VERSION ?= 1
build, and then use the generated .so file. the warning will go.
the problem is that is library will not work on android 5.0. So we'd better leave alone this warning now.

importing project is throwing errors

I am getting source code from this directory link but it throwing this error. I already got many source codes from github or git but mostly not getting any error. but this time it is not solving by different tricks. any help will be appreciated
Error:Execution failed for task ':generateDebugProto'.
> protoc: stdout: . stderr: D:\2BVPRO'S\launcher3\launcher3\src\main\proto: warning: directory does not exist.
D:\2BVPRO'S\launcher3\launcher3\build\extracted-protos\main: warning: directory does not exist.
D:\2BVPRO'S\launcher3\launcher3\build\extracted-include-protos\main: warning: directory does not exist.
D:\2BVPRO'S\launcher3\launcher3\src\debug\proto: warning: directory does not exist.
D:\2BVPRO'S\launcher3\launcher3\build\extracted-protos\debug: warning: directory does not exist.
D:\2BVPRO'S\launcher3\launcher3\build\extracted-include-protos\debug: warning: directory does not exist.
D:\2BVPRO'S\launcher3\launcher3\src\debug\proto: warning: directory does not exist.
D:\2BVPRO'S\launcher3\launcher3\build\extracted-protos\debug: warning: directory does not exist.
D:\2BVPRO'S\launcher3\launcher3\build\extracted-include-protos\debug: warning: directory does not exist.
backup.proto:21:8: Option "javanano_use_deprecated_package" unknown.
I ran into the same problem. I tried creating the path but it was getting wiped when I tried to build.
I ended up grabbing the source from https://f-droid.org/wiki/page/com.android.launcher3 They also note an attempt to build failed due to protos which forced the removal of backup. The source can be downloaded directly from https://f-droid.org/repo/com.android.launcher3_1_src.tar.gz
In Launcher3/protos is a file called backup.proto. In the file:
package launcher_backup;
//option javanano_use_deprecated_package = true; >>> remark this line out.
option java_package = "com.android.launcher3.backup";
option java_outer_classname = "BackupProtos";
I was able to compile this. Apparently, this is no longer in later versions of protocol buffers. I have no idea the side effects but I was able to compile, install and use with no problems.
See https://github.com/google/protobuf/releases

Android application not launching (on device or emulator)

I have an Android application that used to work fine. I think the last piece of code I added was some sqlite database code. Now, when I run the application:
Says "Launching Application (100%)" in the bottom, right corner.
In the Progress tab, the progress bar is not filled in at all (for launching the application).
Uses up all the allowed ram (760M)
The application doesn't actually get installed on my device (I've also tried this without my device plugged in, and it doesn't make it to the screen to ask me which emulator I want to launch).
When I create a new Android application in the workspace the new application runs fine.
System Details:
Eclipse 4.3 for Mac OS X (installed the latest version including the ADT in an attempt to fix the problem).
Android Developer Tools. Build: v22.6.2-1085508
OS X 10.8.5
Just let me know if I've left out any information and I'll add it in asap.
[Edit:] After leaving it running (not force-quitting), I get this error message:
[2014-06-25 10:07:53 - Application] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.ibex.nestedvm.util.Sort$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is not an inner class.
[2014-06-25 10:18:10 - Dex Loader] Unable to execute dex: Java heap space
[2014-06-25 10:18:10 - Application] Conversion to Dalvik format failed: Unable to execute dex: Java heap space

Categories

Resources