I am using the project CSipSimple as a reference in my current project.
Project works fine until i have not tested it in the Android N.
I am getting strange errors when m running my project in Android N.
I have done some googling for that and came to know that by changing the complile SDK version for project will help me to get rid of this error but that thing wont help me in my case.
So any other workaround for this ?
It would be grateful to suggest any changes/guidelines to avoid this issue.
Thanks in advance
Before API 23, this error Text Relocations was given as warning, so it does not cause problems. From API 23 it was thrown as error. The .so file with text relocation may have memory leaks. So it must be fixed and recompiled with latest Android NDK.
Quick fix will be to set tagetApiVersion to 22 in build.gradle file.
Related
I have a project that has started throwing this error when building in Android Studio or Gradle:
com.android.tools.r8.ApiLevelException: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
Now I assume that it's related to use of Java 8 features, perhaps a lambda, but the error message gives no clue as to where the problem lies - it could be my code or it could be a library.
What's the best way to find out where the offending code is? It's a reasonably large app with several modules and quite a few libraries.
In my case i tried to mock something via mockk in an instrumentation test running Api Version 26 or higher, removing the dependency was my only solution as long as following issue is not resolved: https://github.com/mockk/mockk/issues/281
Update: It seems that the issue got resolved and using mockk version 1.10.0 will resolve this issue
One approach would be to set your min api to 26, to avoid the error and build the apk, and then inspect the bytecode of the app (dexdump, baksmali, etc.) to find any usages of the MethodHandle class.
Looking through the error log, it did give a bit more information, specifically nominating one jar file that it failed on:
/Users/.../androidApp/build/intermediates/transforms/desugar/debug/41.jar
On examining that jar file, the classes were all from a library recently added to the project, and the very first class listed was:
META-INF/versions/9/org/h2/util/Bits.class
This turns out to be a Java 9 customised class. Deleting it from the jar file (using zip -d) solved the problem.
Just change the mockk version to 1.10.0, this will resolve the
I have same case when used too high version of Mockito library.
The solution was downgrading from 3.8.0 to 3.4.6. and everything started to work properly.
Error occurred for:
org.mockito:mockito-android:3.8.0
but work for:
org.mockito:mockito-android:3.4.6
We need to update the java version to java 8.
For that please click on File -> Project structure -> app (under Module folder) -> Then select the source compatibility and target compatibility to java 8.
After that you might encounter another error with MethodHandle.invoke and MethodHandle.invokeExact, if you get this error then set the minSdkVersion to 26 or higher
I've used NDK cross compiled many different version of library and used them in my Android application. They just work fine, until final release of my app, my fellow worker have tested the application on his XiaoMi 4 and this error appeared.
First I thought it maybe because of some particular platform's library's lost, but soon after I extract the .apk file and find everything was actually there.
I have searched for google found nothing that can solve the problem.
PS: In my new version of application, I just changed few lines in my C library and all of them is just about if-else-return stuff. I'd never used any of those memcpy-memmove functions, let alone memmove4.
If anyone can explain this to me? what is __aeaib_memmove4 ?
So I finally solved the problem by upgrading the APP-PLATFORM in my Android.mk file from 8 to 17, which is my targetSDKversion, so the error is gone.
I'm new to developing for Android and using Spatialite and can't figure out why my app is crashing on a few devices because of this error:
java.lang.UnsatisfiedLinkError: No implementation found for void jsqlite.Database.internal_init() (tried Java_jsqlite_Database_internal_1init and Java_jsqlite_Database_internal_1init__)
at jsqlite.Database.internal_init(Native Method)
at jsqlite.Database.(Database.java:25)
This crash report is from a Nexus 5 (hammerhead) with Android 6.0 but it's been reported on Xoom with Android 4.1 and a few other unknown devices. I think it maybe be related to NDK versions as mentioned in these issues:
Adding ".so" library to my android studio project
Android NDK java.lang.UnsatisfiedLinkError: findLibrary returned null
https://bitbucket.org/almworks/sqlite4java/issues/71/arm64-bit. (although this is for sqlite4java)
Other than that I'm also getting this error/warning (depending on the device): libjsqlite.so has text relocations. This is wasting memory and prevents security hardening. Please fix. Although it doesnt crash the app like the other error.
I solved it by setting in the app built.gradle (or in the AndroidManifest.xml) this:
targetSdkVersion 21
And it works!
I know that it isn't a good solution, it's a patch, but i works!
***UPDATE
If you can't change the target version to 21, you can do the following:
Download the source code from:https://github.com/geopaparazzi/geopaparazzi
Clean all references in your project to spatialite, .war file, and jndi libraries
Copy module geopaparazzispatialitelibrary and integrate in your project
Clean the code that you don't need from the module
Compile, and enjoy your project targeting version 23
It's a bit complex process, but it works.
Expecially thanks to andrea antonello, he help me to solve the problem, and do a great job with spatialite.
In case this can help anyone with the same problem, I solved this by updating the jni libraries. To do this i downloaded this file:
https://github.com/geopaparazzi/libjsqlite-spatialite-android/blob/master/archive/20150616.libjsqlite.4.3.0.tar.bz2
from the geopaparazzi github repo which contains the latest version of the jni libraries as of now.
Replace the .so files in the spatialiteandroid library with the ones in the archive file.
You can find all versions of the library here: https://github.com/geopaparazzi/libjsqlite-spatialite-android/tree/master/archive:
I am new to Android development. I have succesfully installed eclipse with Android Developer Tool plugin and many of the samples work fine.
But Android samples - Accelerometer and APIDemos do not build. I see many build errors notifying to fix the errors in code. I dont think Google has released APIDemo sample with build errors.
Thanks in advance, please advice how to fix these errors, or if any configuration/setting is required.
I have set the Java compiler compliance level to 1.6.
Error information(for acceralometer sample):
The project contains error(s) in application. Please fix them before running
Error details:
The method onAccuracyChanged(Sensor, int) of type AccelerometerPlayActivity.SimulationView must override a superclass method
AccelerometerPlayActivity.java /AccelerometerPlay/src/com/example/android/accelerometerplay line 456
Java Problem
Call requires API level 8 (current min is 5):
android.view.Display#getRotation AccelerometerPlayActivity.java /AccelerometerPlay/src/com/example/android/accelerometerplay
line 389 Android Lint Problem
Regards,
Jai
Look for the line androidminSdkVersion ="5" in your android.manifest file
and change its value from 5 to 8 or anything more than 8
Alternative is
Go to project properties by right clicking on you project,
thereafter look for Android in properties.
You have to select the build target here equivalent to the api for which it the sample project is build for
Refer Image
Say if you are using the sample from folder android-12 then you have to check the same option(ie API Level 12) here in properties
A possible reason can be a slow PC, which does not build in time. Then errors occur due to absence of R.java
In that case (errors are with something like R.id.stuff), build the project and wait.
I found the fix myself!
Earlier I tried with Andriod version 4.0. Now I just tried ApiDemos sample with Android version 4.1.2. It worked fine. I also deployed the apk in my mobile. It just works fine.
Does anyone know where the android compat libary is
located in xmlvm so I could copy it by myself to the project folder because this is
what I guess is missing, also would be provided by target=android-on-iphone but as mentioned below this target isn't available in the current build.
I had absolutely no problem installing xmlvm and getting in touch with the
demo/samples also all the demos worked perfectly for me.
But now im stuck at the last 4 errors in xcode, i migrated my android project via --
skeleton=android:migrate then cross-compiled it via --target=iphone and opened
up the project in Xcode. after few project setup changes the errors went down from
72 to 4 errors ;)
however the errors are importing file not found errors of compat libs, so this
should somehow get to be solved i think...
is it because --target=android-on-iphone wasnt used by me because this option
will copy the android compat libary to the project folder.. well i tried to use this
target mentioned in 2 documentations of xmlvm but in the actual build of xmlvm
this target however does not exist..
How to solve these errors?
Screenshots:
http://img526.imageshack.us/img526/8957/bildschirmfoto20120620u.png
http://imageshack.us/f/138/bildschirmfoto20120620u.png/
From what I can see, it looks like you are using part of the Android API which is not yet implemented.
Unfortunately it seems that you either need to rewrite your application or implement the API yourself.