I'm working on an location-aware Android app that uses Google Maps. I upgraded by ADT to 23.0.0.1245622 the other day. I think I was on v22.6.2-1085508 before then.
Now the map view only contains the Google logo and the +/- buttons. And, eerily, my logcat contains the following line:
07-01 12:15:08.548: E/Google Maps Android API(6299): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
I have tried cleaning the project, by the way. No dice. I tried running this on an AVD instead of my Galaxy S3. No dice. I tried reverting to a previous revision of my code using git reset --hard. Still no dice. Perhaps most importantly, I tried creating a new API key in the console, and pasted that into my manifest. (Incidentally, I reverted to my older key after trying this experiment, if that is at all significant.)
I will post a full logcat below:
07-01 12:14:51.920: D/ActivityThread(6299): handleBindApplication:com.gregeveritt.hoodies
07-01 12:14:51.920: D/ActivityThread(6299): setTargetHeapUtilization:0.75
07-01 12:14:51.920: D/ActivityThread(6299): setTargetHeapMinFree:524288
07-01 12:14:52.560: I/Google Maps Android API(6299): Google Play services client version: 4132500
07-01 12:14:52.560: I/dalvikvm(6299): Could not find method guj.a, referenced from method gqi.a
07-01 12:14:52.560: W/dalvikvm(6299): VFY: unable to resolve static method 24932: Lguj;.a (Landroid/content/Context;)Lgri;
07-01 12:14:52.560: D/dalvikvm(6299): VFY: replacing opcode 0x71 at 0x0003
07-01 12:14:52.570: E/dalvikvm(6299): Could not find class 'gpr', referenced from method gps.a
07-01 12:14:52.570: W/dalvikvm(6299): VFY: unable to resolve new-instance 4089 (Lgpr;) in Lgps;
07-01 12:14:52.570: D/dalvikvm(6299): VFY: replacing opcode 0x22 at 0x0000
07-01 12:14:52.570: E/dalvikvm(6299): Could not find class 'gpr', referenced from method gps.a
07-01 12:14:52.570: W/dalvikvm(6299): VFY: unable to resolve new-instance 4089 (Lgpr;) in Lgps;
07-01 12:14:52.570: D/dalvikvm(6299): VFY: replacing opcode 0x22 at 0x0000
07-01 12:14:52.570: E/dalvikvm(6299): Could not find class 'gpr', referenced from method gps.a
07-01 12:14:52.570: W/dalvikvm(6299): VFY: unable to resolve new-instance 4089 (Lgpr;) in Lgps;
07-01 12:14:52.570: D/dalvikvm(6299): VFY: replacing opcode 0x22 at 0x0000
07-01 12:14:52.570: D/dalvikvm(6299): DexOpt: unable to opt direct call 0x5e9f at 0x0a in Lgps;.a
07-01 12:14:52.570: D/dalvikvm(6299): DexOpt: unable to opt direct call 0x5e9f at 0x0c in Lgps;.a
07-01 12:14:52.570: D/dalvikvm(6299): DexOpt: unable to opt direct call 0x5e9f at 0x0a in Lgps;.a
07-01 12:14:52.601: I/Google Maps Android API(6299): Google Play services package version: 5082036
07-01 12:14:52.611: W/dalvikvm(6299): VFY: unable to resolve static field 20868 (t) in Lyp;
07-01 12:14:52.611: D/dalvikvm(6299): VFY: replacing opcode 0x62 at 0x000e
07-01 12:14:52.611: W/dalvikvm(6299): VFY: unable to resolve static field 20868 (t) in Lyp;
07-01 12:14:52.611: D/dalvikvm(6299): VFY: replacing opcode 0x62 at 0x000d
07-01 12:14:52.931: W/ActivityThread(6299): ClassLoader.loadClass: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());
07-01 12:14:52.971: I/dalvikvm(6299): Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4022 'Lgln;'
07-01 12:14:52.971: W/dalvikvm(6299): Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
07-01 12:14:52.971: E/dalvikvm(6299): Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a
07-01 12:14:52.971: W/dalvikvm(6299): VFY: unable to resolve check-cast 2086 (Lcom/google/android/gms/location/internal/ParcelableGeofence;) in Lglt;
07-01 12:14:52.971: D/dalvikvm(6299): VFY: replacing opcode 0x1f at 0x0019
07-01 12:14:53.111: I/Adreno200-EGL(6299): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB_2.5.5.04.02.02.092.059_msm8960_JB_2.5.5_CL3896081_release_AU (CL3896081)
07-01 12:14:53.111: I/Adreno200-EGL(6299): Build Date: 06/25/13 Tue
07-01 12:14:53.111: I/Adreno200-EGL(6299): Local Branch:
07-01 12:14:53.111: I/Adreno200-EGL(6299): Remote Branch: quic/jb_2.5.5
07-01 12:14:53.111: I/Adreno200-EGL(6299): Local Patches: NONE
07-01 12:14:53.111: I/Adreno200-EGL(6299): Reconstruct Branch: AU_LINUX_ANDROID_JB_2.5.5.04.02.02.092.059 + NOTHING
07-01 12:14:53.161: D/OpenGLRenderer(6299): Enabling debug mode 0
07-01 12:14:53.311: I/Google Maps Android API(6299): Failed to contact Google servers. Another attempt will be made when connectivity is established.
07-01 12:14:54.022: I/Choreographer(6299): Skipped 51 frames! The application may be doing too much work on its main thread.
07-01 12:14:54.723: I/Google Maps Android API(6299): Google Play services package version: 5082036
07-01 12:14:55.964: I/Choreographer(6299): Skipped 61 frames! The application may be doing too much work on its main thread.
07-01 12:14:56.304: I/Timeline(6299): Timeline: Activity_idle id: android.os.BinderProxy#41bc4ef8 time:302027791
07-01 12:14:56.304: I/Timeline(6299): Timeline: Activity_idle id: android.os.BinderProxy#41bc4ef8 time:302027791
07-01 12:15:08.548: E/Google Maps Android API(6299): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
07-01 12:15:58.571: W/IInputConnectionWrapper(6299): getExtractedText on inactive InputConnection
07-01 12:15:58.571: W/IInputConnectionWrapper(6299): getTextBeforeCursor on inactive InputConnection
07-01 12:15:58.581: W/IInputConnectionWrapper(6299): getSelectedText on inactive InputConnection
07-01 12:15:58.581: W/IInputConnectionWrapper(6299): getTextAfterCursor on inactive InputConnection
07-01 12:16:04.027: I/Google Maps Android API(6299): Google Play services package version: 5082036
07-01 12:16:04.167: W/IInputConnectionWrapper(6299): getExtractedText on inactive InputConnection
07-01 12:16:04.227: W/IInputConnectionWrapper(6299): getTextBeforeCursor on inactive InputConnection
07-01 12:16:05.468: W/IInputConnectionWrapper(6299): getSelectedText on inactive InputConnection
07-01 12:16:05.498: W/IInputConnectionWrapper(6299): getTextAfterCursor on inactive InputConnection
07-01 12:16:05.518: I/Timeline(6299): Timeline: Activity_idle id: android.os.BinderProxy#41bc4ef8 time:302097011
07-01 12:16:51.027: I/Timeline(6299): Timeline: Activity_idle id: android.os.BinderProxy#41bc4ef8 time:302142518
07-01 12:17:31.530: I/Google Maps Android API(6299): Google Play services package version: 5082036
07-01 12:17:32.521: I/Choreographer(6299): Skipped 49 frames! The application may be doing too much work on its main thread.
07-01 12:17:33.142: I/Timeline(6299): Timeline: Activity_idle id: android.os.BinderProxy#41bc4ef8 time:302184634
Here is my manifest, with my api key blotted out:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gregeveritt.hoodies"
android:versionCode="1"
android:versionName="0.3" >
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.gregeveritt.hoodies.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>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my_api_key" />
</application>
</manifest>
Oh, and here's my map creation code, as well:
#Override
public void onConnected(Bundle dataBundle) {
Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
try {
showNeighborhood();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// TODO potentially switch to SupportMapFragment, lower MinSDK from 12 to 11
mMap = ( (MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
CameraUpdate startingCamera = CameraUpdateFactory.newLatLng( new LatLng(mCurrentLocation.getLatitude(), mCurrentLocation.getLongitude()) );
mMap.moveCamera(startingCamera);
// TODO What if mMap was null-checked?
}
Note: Somewhere in this process, I also switched from a 32-bit JDK to a 64-bit one. I doubt that's relevant at all, but I just like to cover my bases.
While looking over user2103379's answer and checking my API key, I found that the package name and the API key were correct. However, the SHA-1 for my new debug key was not added to the list of accepted clients. Oops! Anyway, I put the new SHA-1 in there, cleaned the Eclipse project (after disabling automatic post-clean build) and built the project anew. Worked fine.
The Issue is probably happening because the Map is not loaded and the app is trying to locate you in an unloaded Map. The Map is not loading with your api key or package name. I think your api key has got changed . Please check your api key and package name.
Related
I'm using Tesseract in Android Studio to recognize texts in a picture. When I call the following function like this:
String textResult = doOcr(bitmapTreated,"eng");
Then the program exits.
public String doOcr(Bitmap bitmap, String language) {
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(getSDPath(), language);
bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
baseApi.setImage(bitmap);
String text = baseApi.getUTF8Text();
baseApi.clear();
baseApi.end();
return text;
}
Here are the results:
06-24 21:37:23.205 30643-30643/? D/dalvikvm: Late-enabling CheckJNI
06-24 21:37:23.335 30643-30643/com.example.text_recognization D/dalvikvm: GetMethodID: not returning static method Landroid/os/Process;.getTotalMemory ()J
06-24 21:37:23.335 30643-30643/com.example.text_recognization D/dalvikvm: GetMethodID: not returning static method Landroid/os/Process;.getFreeMemory ()J
06-24 21:37:23.365 30643-30643/com.example.text_recognization I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
06-24 21:37:23.365 30643-30643/com.example.text_recognization W/dalvikvm: VFY: unable to resolve virtual method 422: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
06-24 21:37:23.365 30643-30643/com.example.text_recognization D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
06-24 21:37:23.365 30643-30643/com.example.text_recognization I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
06-24 21:37:23.365 30643-30643/com.example.text_recognization W/dalvikvm: VFY: unable to resolve virtual method 444: Landroid/content/res/TypedArray;.getType (I)I
06-24 21:37:23.365 30643-30643/com.example.text_recognization D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
06-24 21:37:23.435 30643-30643/com.example.text_recognization I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.2.2.1_RB1.04.04.04.090.052_msm8974_LNX.LA.3.5.2.2.1_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.24.00.15
Build Date: 07/01/15 Wed
Local Branch: mybranch11515920
Remote Branch: quic/LNX.LA.3.5.2.2.1_rb1
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.2.2.1_RB1.04.04.04.090.052 + NOTHING
06-24 21:37:23.465 30643-30643/com.example.text_recognization D/OpenGLRenderer: Enabling debug mode 0
06-24 21:37:23.525 30643-30643/com.example.text_recognization I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#43519b38 time:579991957
I debug it, and it stops in the class TessBaseAPI
static {
System.loadLibrary("lept");
System.loadLibrary("tess");
nativeClassInit();
}
I don't know whether the environment configuration is wrong or my code is wrong.
And the following is the build.grade file:
com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.example.zhouying.text_recognization"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile files('libs/tess-two.tesseract3.01-leptonica1.68-LibJPEG6b.jar')
}
if I change the support library as follows:
compile 'com.android.support:appcompat-v7:22.0.1'
There will be a red line indicates that "The support library shouldn't use a different version than the compileSdkVersion".
Then I change the compileSdkVersion and targetSdkVersion to 22, I can see errors.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(24) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/Library/Android/sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1
And I can see a red line under "compile 'com.android.support:design:23.1.1'".I continue to change it to "compile 'com.android.support:design:22.0.1'.
It shows
Failed to resolve com.android.support:appcompat-v7:22.0.1
Failed to resolve com.android.support:design:22.0.1
This may be happening due to a bug in some versions of the Android support library.
Try updating your support library:
compile 'com.android.support:appcompat-v7:22.1.0'
I have been trying to connect android studio apps to wamp server my sql database. When i perform my test on mobile phone, it has been giving me this error.
W/dalvikvm: VFY: unable to resolve virtual method 424:
Landroid/content/res/TypedArray;.getChangingConfigurations ()I
W/dalvikvm: VFY: unable to resolve virtual method 446:
Landroid/content/res/TypedArray;.getType (I)I
W/System.err: java.net.UnknownHostException:
http://l92.168.1.2/apexStore2/user_register.php
I have been making sure the pc that i run my wamp server and mobile phone i use to test the app connect to the same wifi. I have added this to my manifest file.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
This is my url, i have use my ipv4 address. What have seems to be the matter? How should i fix this error?
private static final String LOGIN_URL = "http://l92.168.1.2/apexStore2/user_login.php";
I'm currently working on a project and so far only have the splash and main screen done. I wanted to see how it would run in an Android environment so I ran it as an Android Application. The emulator booted up just fine but when it load the app or "Uploading Project-android.apk onto device 'emulator-5554'
Installing Project-android.apk..." it prompts up that it "Unfortunately, Project has stopped. Here I copied the logcat for reference.
06-26 23:33:53.190: D/dalvikvm(1808): Not late-enabling CheckJNI (already on)
06-26 23:33:53.280: D/dalvikvm(1808): Trying to load lib /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48
06-26 23:33:53.280: D/dalvikvm(1808): Added shared lib /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48
06-26 23:33:53.280: D/dalvikvm(1808): No JNI_OnLoad found in /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48, skipping init
06-26 23:33:53.280: D/(1808): HostConnection::get() New Host Connection established 0xb90f3dc0, tid 1808
06-26 23:33:53.460: I/AndroidInput(1808): sensor listener setup
06-26 23:33:53.550: W/EGL_emulation(1808): eglSurfaceAttrib not implemented
06-26 23:33:53.550: D/OpenGLRenderer(1808): Enabling debug mode 0
06-26 23:33:53.560: D/(1808): HostConnection::get() New Host Connection established 0xb910b590, tid 1823
06-26 23:33:53.600: W/GL2JNIView(1808): creating OpenGL ES 2.0 context
06-26 23:33:53.800: D/dalvikvm(1808): Trying to load lib /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48
06-26 23:33:53.800: D/dalvikvm(1808): Shared lib '/data/app- lib/com.levellabs.project.android-2/libgdx.so' already loaded in same CL 0xb1fbed48
06-26 23:33:53.800: I/GL2(1808): all initialized 2
06-26 23:33:53.800: I/AndroidGraphics(1808): OGL renderer: Android Emulator OpenGL ES Translator (GeForce GTX 770/PCIe/SSE2)
06-26 23:33:53.800: I/AndroidGraphics(1808): OGL vendor: Google (NVIDIA Corporation)
06-26 23:33:53.800: I/AndroidGraphics(1808): OGL version: OpenGL ES 2.0 (4.5.0 NVIDIA 350.12)
06-26 23:33:53.800: I/AndroidGraphics(1808): OGL extensions: GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_texture_npot GL_OES_rgb8_rgba8
06-26 23:33:53.800: E/EGL_emulation(1808): [getAttribValue] Bad attribute idx
06-26 23:33:53.800: E/EGL_emulation(1808): tid 1823: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-26 23:33:53.800: E/EGL_emulation(1808): [getAttribValue] Bad attribute idx
06-26 23:33:53.800: E/EGL_emulation(1808): tid 1823: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-26 23:33:53.800: I/AndroidGraphics(1808): framebuffer: (5, 6, 5, 0)
06-26 23:33:53.800: I/AndroidGraphics(1808): depthbuffer: (24)
06-26 23:33:53.800: I/AndroidGraphics(1808): stencilbuffer: (0)
06-26 23:33:53.800: I/AndroidGraphics(1808): samples: (0)
06-26 23:33:53.800: I/AndroidGraphics(1808): coverage sampling: (false)
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed meshes/app: { }
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed textures/app: { }
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed cubemap/app: { }
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed shaders/app: { }
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed buffers/app: { }
06-26 23:33:55.540: I/dalvikvm(1808): Could not find method aurelienribon.tweenengine.TweenManager.update, referenced from method com.levellabs.project.GameScreen.render
06-26 23:33:55.540: W/dalvikvm(1808): VFY: unable to resolve virtual method 369: Laurelienribon/tweenengine/TweenManager;.update (F)V
06-26 23:33:55.540: D/dalvikvm(1808): VFY: replacing opcode 0x6e at 0x0008
06-26 23:33:55.540: D/dalvikvm(1808): GC_FOR_ALLOC freed 407K, 14% free 2931K/3392K, paused 2ms, total 2ms
06-26 23:33:55.540: E/dalvikvm(1808): Could not find class 'aurelienribon.tweenengine.TweenManager', referenced from method com.levellabs.project.GameScreen.show
06-26 23:33:55.540: W/dalvikvm(1808): VFY: unable to resolve new-instance 100 (Laurelienribon/tweenengine/TweenManager;) in Lcom/levellabs/project/GameScreen;
06-26 23:33:55.540: D/dalvikvm(1808): VFY: replacing opcode 0x22 at 0x001e
06-26 23:33:55.540: D/dalvikvm(1808): DexOpt: unable to opt direct call 0x0170 at 0x20 in Lcom/levellabs/project/GameScreen;.show
06-26 23:33:55.540: I/dalvikvm(1808): Failed resolving Lcom/levellabs/project/tween/SpriteAccessor; interface 98 'Laurelienribon/tweenengine/TweenAccessor;'
06-26 23:33:55.540: W/dalvikvm(1808): Link of class 'Lcom/levellabs/project/tween/SpriteAccessor;' failed
06-26 23:33:55.540: D/dalvikvm(1808): DexOpt: unable to opt direct call 0x345e at 0x29 in Lcom/levellabs/project/GameScreen;.show
06-26 23:33:55.540: I/dalvikvm(1808): Failed resolving Lcom/levellabs/project/GameScreen$1; interface 99 'Laurelienribon/tweenengine/TweenCallback;'
06-26 23:33:55.540: W/dalvikvm(1808): Link of class 'Lcom/levellabs/project/GameScreen$1;' failed
06-26 23:33:55.540: D/dalvikvm(1808): DexOpt: unable to opt direct call 0x3434 at 0x54 in Lcom/levellabs/project/GameScreen;.show
06-26 23:33:55.660: D/dalvikvm(1808): GC_FOR_ALLOC freed 71K, 9% free 3192K/3472K, paused 2ms, total 2ms
06-26 23:33:56.120: W/dalvikvm(1808): threadid=11: thread exiting with uncaught exception (group=0xb1cecb20)
06-26 23:33:56.120: E/AndroidRuntime(1808): FATAL EXCEPTION: GLThread 75
06-26 23:33:56.120: E/AndroidRuntime(1808): Process: com.levellabs.project.android, PID: 1808
06-26 23:33:56.120: E/AndroidRuntime(1808): java.lang.NoClassDefFoundError: aurelienribon.tweenengine.TweenManager
06-26 23:33:56.120: E/AndroidRuntime(1808): at com.levellabs.project.GameScreen.show(GameScreen.java:68)
06-26 23:33:56.120: E/AndroidRuntime(1808): at com.badlogic.gdx.Game.setScreen(Game.java:61)
06-26 23:33:56.120: E/AndroidRuntime(1808): at com.levellabs.project.Project.create(Project.java:24)
06-26 23:33:56.120: E/AndroidRuntime(1808): at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphi cs.java:241)
06-26 23:33:56.120: E/AndroidRuntime(1808): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512)
06-26 23:33:56.120: E/AndroidRuntime(1808): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
06-26 23:33:56.130: I/AndroidInput(1808): sensor listener tear down
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed meshes/app: { }
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed textures/app: { }
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed cubemap/app: { }
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed shaders/app: { }
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed buffers/app: { }
I think your jar file version which has some native functions does not matches the libgdx.so file version which does not have that method. Better you compile the c++ libgdx library using Android NDK to match the native functions. I got this from your error
No JNI_OnLoad found in /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48, skipping init
......
......
Could not find method aurelienribon.tweenengine.TweenManager.update, referenced from method com.levellabs.project.GameScreen.render
This means some of the native methods are not properly binded by the JNI
If you are running inside an emulator, you need corresponding .so files live libgdx.....so files
Refer this Android ndk + libgdx
If you want the ready made JAR files and .so files download here http://libgdx.badlogicgames.com/nightlies/dist/
You can see there are 11 JAR files and folders like armeabi/ armeabi-v7a/ x86/
Go through the README files for further setup needs and compilations steps.
There is also a success comment here Libgdx tween not working on Android
You can also download the Demo App https://java-universal-tween-engine.googlecode.com/files/tween-engine-demo-6.3.0.zip and check the libs folder inside it for the JAR files
If you need more help, ping me via https://chat.stackoverflow.com/rooms/50272/androidians chat room, I will help you
I've spent the last two hours trying to figure out how to do this, and am coming up blank. I've looked through many of the entries here on stackoverflow related to this...although I've tried to follow the fixes as written nothing has helped. I think if I had a better understanding of how Java, Android, and Eclipse worked I could use the previous answers, but I'm going to need a more basic explanation. Here's what I'm trying to do: I've created an Android Library Project called AndroidUILibrary. I can't post the image of what my Java Build Path window looks like (need 10 reputation points), but I am exporting both the src and gen folders from my project.
In this library project I have the following class:
public class FileDialogFragment extends DialogFragment {
#Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
activity = getActivity();
activity.setContentView(R.id.fileDialogFragmentLinearLayout);
and the library's manifest looks like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sailbravado.androiduilibrary"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<library />
<application
android:allowBackup="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
</manifest>
In my Android Application I have the following code:
final FileDialogFragment fileDialog = new FileDialogFragment();
fileDialog.setCanSelectFiles(false);
fileDialog.setOnClickListener(new DialogInterface.OnClickListener() {
#Override
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
logFolderValueTextView.setText(fileDialog.getSelectedFiles().get(0).getAbsolutePath());
logFolderValueTextView.setTag(true);
}
}
});
fileDialog.show(activity.getFragmentManager(), "");
In my Android application's Java Build Path I added AndroidUILibrary to the Projects tab, androiduilibrary.jar to the Libraries tab, and ensured that all entries are checked in Order and Export. I then attempt to run the application. The Console shows the following output:
[2014-09-20 18:45:03 - GPSLogger] Dx
trouble writing output: already prepared
[2014-09-20 18:45:04 - GPSLogger] ------------------------------
[2014-09-20 18:45:04 - GPSLogger] Android Launch!
[2014-09-20 18:45:04 - GPSLogger] adb is running normally.
[2014-09-20 18:45:04 - GPSLogger] Performing com.sailbravado.gpslogger.GPSLoggerActivity activity launch
[2014-09-20 18:45:04 - GPSLogger] Automatic Target Mode: using device 'E5ATCT027686'
[2014-09-20 18:45:04 - GPSLogger] Uploading GPSLogger.apk onto device 'E5ATCT027686'
[2014-09-20 18:45:04 - GPSLogger] Installing GPSLogger.apk...
[2014-09-20 18:45:07 - GPSLogger] Success!
[2014-09-20 18:45:07 - AndroidUILibrary] Could not find AndroidUILibrary.apk!
[2014-09-20 18:45:07 - GPSLogger] Starting activity com.sailbravado.gpslogger.GPSLoggerActivity on device E5ATCT027686
[2014-09-20 18:45:08 - GPSLogger] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sailbravado.gpslogger/.GPSLoggerActivity }
When the "Dx" entry in the Console shows up, I notice a new folder gets created in my project hierarchy: bin/dexedLibs. It contains two JAR files...my androiduilibrary and appcompat_v7, both followed by a 32-digit hex number. The application launches fine, but when I invoke the part that should create the dialog, I get:
09-20 18:53:58.355: E/AndroidRuntime(2739): FATAL EXCEPTION: main
09-20 18:53:58.355: E/AndroidRuntime(2739): Process: com.sailbravado.gpslogger, PID: 2739
09-20 18:53:58.355: E/AndroidRuntime(2739): java.lang.NoClassDefFoundError: com.sailbravado.androiduilibrary.R$id
09-20 18:53:58.355: E/AndroidRuntime(2739): at com.sailbravado.androiduilibrary.FileDialogFragment.onCreateDialog(FileDialogFragment.java:251)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.app.DialogFragment.getLayoutInflater(DialogFragment.java:398)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.app.BackStackRecord.run(BackStackRecord.java:685)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.os.Handler.handleCallback(Handler.java:733)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.os.Handler.dispatchMessage(Handler.java:95)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.os.Looper.loop(Looper.java:136)
09-20 18:53:58.355: E/AndroidRuntime(2739): at android.app.ActivityThread.main(ActivityThread.java:5072)
09-20 18:53:58.355: E/AndroidRuntime(2739): at java.lang.reflect.Method.invokeNative(Native Method)
09-20 18:53:58.355: E/AndroidRuntime(2739): at java.lang.reflect.Method.invoke(Method.java:515)
09-20 18:53:58.355: E/AndroidRuntime(2739): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-20 18:53:58.355: E/AndroidRuntime(2739): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
09-20 18:53:58.355: E/AndroidRuntime(2739): at dalvik.system.NativeStart.main(Native Method)
Opening in the debugger, the exception is being thrown from the setContentView() call in the library code.
I tried adding a uses-library tag in the application's manifest, but I get:
[2014-09-20 18:02:51 - GPSLogger] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2014-09-20 18:02:51 - GPSLogger] Please check logcat output for more details.
[2014-09-20 18:02:51 - GPSLogger] Launch canceled!
Thanks in advance for any advice.
I'm facing a strange issue when declaring a Content Provider in my project. I'm copying the classes and Manifest declaration from another project of my own. It's working OK on my other project.
Here's part of my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.qr"
android:installLocation="auto"
android:versionCode="540"
android:versionName="5.4" >
(...)
<application
android:name=".Application"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:logo="#drawable/ic_launch" >
(...)
<provider
android:name=".provider.HistoryProvider"
android:authorities="com.example.qr.History"
android:exported="true"
android:multiprocess="true"
android:readPermission="com.example.qr.History.read"
android:writePermission="com.example.qr.History.write" />
(...)
</application>
</manifest>
When I run my app, I get this stack trace:
FATAL EXCEPTION: main
java.lang.NullPointerException
at android.app.ActivityThread.installProvider(ActivityThread.java:4783)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4430)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
This is the whole stack trace. No 'com.example' trace is included. Of course some code in my app is producing this but the actual crash happens in Android.
Because my own classes are not included in the stack trace, I really don't know where to look.
I've run the code in an emulator with Android 4.2 and I've compared it with the source code of that version of Android, so I know the crash is produced in this line of ActivityThread:
4782 ApplicationInfo ai = info.applicationInfo;
4783 if (context.getPackageName().equals(ai.packageName)) {
Here's a link to the source code of this class.
If I don't declare the content provider (i.e. if I remove from my Manifest), the app works perfectly.
I've added some logs to my Application class, as well as the main Activity class. The crash is produced before either is launched.
So, my question is: what in my code can be producing context, context.getPackageName() or info.applicationInfo to be null during installation?
EDIT
When triggering the stack trace in the emulator several times, I only get this between traces:
09-11 23:10:21.250: E/AndroidRuntime(933): at dalvik.system.NativeStart.main(Native Method)
09-11 23:10:21.470: D/dalvikvm(933): GC_CONCURRENT freed 142K, 9% free 2951K/3224K, paused 78ms+3ms, total 225ms
09-11 23:10:44.030: I/Process(933): Sending signal. PID: 933 SIG: 9
09-11 23:10:46.940: D/dalvikvm(947): GC_CONCURRENT freed 164K, 10% free 2711K/2996K, paused 13ms+114ms, total 201ms
09-11 23:10:47.170: I/ActivityThread(947): Pub com.example.qr.History: com.example.qr.provider.HistoryProvider
09-11 23:10:47.170: D/AndroidRuntime(947): Shutting down VM
09-11 23:10:47.170: W/dalvikvm(947): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
09-11 23:10:47.180: E/AndroidRuntime(947): FATAL EXCEPTION: main