Couldn't parse API file "frameworks/base/api/current.txt" - android

I tried adding some files in Android framework. Everything goes well, except in the end of compilation i am getting below error.
I tried make update-api too, but no luck, every time in compilation it is giving below errors. If anybody know how to overcome this, please let me know.
Docs droiddoc: out/target/common/docs/doc-comment-check
Checking API: checkapi-last
Checking API: checkapi-current
host layoutlib_create: out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar
Couldn't parse API file "frameworks/base/api/current.txt"
...as text: com.google.doclava.apicheck.ApiParseException: missing class or interface. got: private line 6342
...as XML: com.google.doclava.apicheck.ApiParseException: Error parsing API
Couldn't parse API file "out/target/common/obj/PACKAGING/public_api.txt"
...as text: com.google.doclava.apicheck.ApiParseException: missing class or interface. got: private line 6342
...as XML: com.google.doclava.apicheck.ApiParseException: Error parsing API
Exception in thread "main" java.lang.NullPointerException
at com.google.doclava.apicheck.ApiCheck.checkApi(ApiCheck.java:118)
at com.google.doclava.apicheck.ApiCheck.main(ApiCheck.java:67)
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1) You can add "#hide" javadoc comments to the methods, etc. listed in the
errors above.
2) You can update current.txt by executing the following command:
make update-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
Couldn't parse API file "out/target/common/obj/PACKAGING/public_api.txt"
...as text: com.google.doclava.apicheck.ApiParseException: missing class or interface. got: private line 6342
...as XML: com.google.doclava.apicheck.ApiParseException: Error parsing API
Exception in thread "main" java.lang.NullPointerException
at com.google.doclava.apicheck.ApiInfo.isConsistent(ApiInfo.java:60)
at com.google.doclava.apicheck.ApiCheck.checkApi(ApiCheck.java:118)
at com.google.doclava.apicheck.ApiCheck.main(ApiCheck.java:67)
******************************
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.
******************************
make: *** [out/target/common/obj/PACKAGING/checkapi-last-timestamp] Error 38
make: *** Waiting for unfinished jobs....
make: *** [out/target/common/obj/PACKAGING/checkapi-current-timestamp] Error 38
-rw-r--r-- 1 aankit admin 9763299 Jan 31 14:21 out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar
Output: out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar
Input : out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar
Input : out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar
Found 7983 classes in input JARs.
Found 2260 classes to keep, 2143 class dependencies.
# deps classes: 2143
# keep classes: 2260
# renamed : 19
Created JAR file out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar

The reason for this issue was ,
Cause :- I was adding private classes in Android Frameworks and these classes documentation/declarations must be added to “frameworks/base/api/current.txt”
Solution :- as per error logs, There are two solutions.
1) add #hide annotation in each method's Signature in each newly added file and its members.
2) use commands $ make update-api then $ make -j4 or either use $make update-api && make -j4 , and code should be compilable now.

Have you tried to compile you code before updating api? It seems that the code you've added cannot be compiled.
The problem is that new api cannot be parsed.
If you check external/doclava/src/com/google/doclava/apicheck/ApiFile.java you'll find the the throw statement that can help you:
throw new ApiParseException("missing class or interface. got: " + token, tokenizer.getLine());
It seems that you try to add to api private class or interface that is not allowed. To check this try to look into out/target/common/obj/PACKAGING/public_api.txt file line number 6342. There you should find the name of the class or interface that causes the error.

Related

Trying to get BGFX to build for Android

We're trying to get BGFX to build for Android, following the guide here: https://github.com/Nodrev/bgfx-android-activity as recommended on the BGFX main site.
However, this repository was last updated 3+ years ago, and since then there have been major revisions to the Android NDK structure, meaning all of the library paths are all wrong. We've managed to make some progress, but keep getting stuck on the same error.
What we've tried so far:
Using various NDK versions from 17 to 25. NDK 21 seems to be the one before the big change in NDK structure but we consistently get an error at some point during the build with each NDK: 'alloca.h' file not found
Using NDK 25, we got various other errors due to incorrect paths, managed to get past those, but this just led us back to the above error.
Posting a message on the BGFX discussion board, no response.
We found a message here that appears to describe the problem we're having but the second solution does not work, with error:
error: use of undeclared identifier 'GL_PARAMETER_BUFFER_ARB' ...GL_CHECK(glBindBuffer(GL_PARAMETER_BUFFER_ARB, 0) );
and the first solution doesn't contain enough information to try to replicate it.
The main issue we're having is that it seems there is a variable sysroot which tells the build process where to look for headers and libraries, this points to --sysroot=$(ANDROID_NDK_ROOT)/platforms/android-32/arch-arm in the build script, which does not exist. Setting it to a platform that does exist, e.g. --sysroot=$(ANDROID_SDK_ROOT)/platforms/android-32/ got us as far as the alloc.h error above.
alloca.h is found in \AppData\Local\Android\Sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include so we tried setting sysroot to $(ANDROID_NDK_X86)/sysroot/usr/
which led to the error:
\AppData\Local\Android\Sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64/sysroot/usr//include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
asm/types.h is found in a few places:
ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\aarch64-linux-android\asm ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\arm-linux-androideabi\asm ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\i686-linux-android\asm
but changing sysroot to point to e.g. --sysroot=$(ANDROID_NDK_ARM)/sysroot/usr/include/arm-linux-androidabi gets us back to the alloca.h error again.
This is the error in full:
process_begin: CreateProcess(NULL, uname, ...) failed.
makefile:6: pipe: No error
C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -R -C .build/projects/gmake-android-arm config=debug
make[1]: Entering directory '.../bgfx/.build/projects/gmake-android-arm'
"==== Building bx (debug) ===="
allocator.cpp
In file included from ../../../../bx/src/allocator.cpp:6:
In file included from ../../../../bx/include/bx/allocator.h:9:
../../../../bx/include/bx/bx.h:9:10: fatal error: 'alloca.h' file not found
#include <alloca.h> // alloca
^~~~~~~~~~
1 error generated.
make[2]: *** [bx.make:441: ../../android-arm/obj/Debug/bx/bx/src/allocator.o] Error 1
make[1]: *** [Makefile:17: bx] Error 2
make[1]: Leaving directory '.../bgfx/.build/projects/gmake-android-arm'
make: *** [makefile:69: android-arm-debug] Error 2
We've run out of ideas at this point, would greatly appreciate some help!

Android WebRTC JNI system error lookup: "last system error: 11"

I got an error message similar to this when doing some WebRTC NDK development on Android:
2019-02-04 13:20:35.987 10214-10246/com.my.package E/rtc: #
# Fatal error in mypath/src/main/jni/src_code.cpp, line 124
# last system error: 11
# Check failed: !jni()->ExceptionCheck()
# error during Class.function_call
#
Given that the exception is buried under some layer of abstraction (WebRTC), the line that would be particular helpful here is last system error: 11. However, trying to find a description of this error has been a little tricky. After doing some Googling, I couldn't seem to find anything. Perhaps I'm looking in the wrong place for a more meaningful description of this error? Would appreciate any help! Thanks!
whatever you've tried to do ...the terminal says:
$ perror 11
OS error code 11: Resource temporarily unavailable
src_code.cpp, line 124 would be required to interpret it in a meaningful way.
most likely some trying to access some resource, which had not been opened.

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.

Printing by monodroid

I have a BIXOLON mobile printer, I can print by this device in windows mobile programs.
I want to print by this device in MONODOIRD applicaiton...
there is sdk, but the lib that use that sdk is java...
is any body know how can I print by this device in monodroid?!
Is your "lib" is a .jar file? If it is, bind it, which will make it accessible from C#.
after I read xamarin help about bindding jar file, I get some errors....
I listed in the end of this post...
I need this jar file compile completly...
Warning 1 missing class error was raised while reflecting com.bixolon.android.library.BxlService : android/hardware/usb/UsbManager
Warning 2 missing class error was raised while reflecting
com.bixolon.android.library.UsbLauncher : android/hardware/usb/UsbManager
Warning 3 For ConnectThread, could not find enclosing type 'BxlService'.
Warning 4 For ConnectThread, could not find enclosing type 'BxlService'.
Warning 5 For ConnectedThread, could not find enclosing type 'BxlService'.
Warning 6 For ConnectedThread, could not find enclosing type 'BxlService'.

In-line annotations give syntax errors

I'm loving the new Lint API checks of ADT rev 17, but the new API Correctness Check has got me stumped. I have the following line of code:
listView.setOverScrollMode(OVER_SCROLL_NEVER);
Lint is reporting on this line:
Call requires API level 9 (current min is 4)
According to the documentation, I should just be able to add an annotation above the line, like so:
#TargetApi(9)
listView.setOverScrollMode(OVER_SCROLL_NEVER);
This, however, gives a syntax error in Java 1.6:
Syntax error on token(s), misplaced construct(s)
That's not allowed in Java (until/if JSR 308 gets added); you can only annotate classes, methods, fields, parameters and variable declarations. It's the latter that is shown in the docs. However, for bytecode based checks like the api check you may need to place it on a method or class (or anonymous/inner class). The Add Annotation quickfix for these warnings in lint should do the right thing.

Categories

Resources