I made a libgdx app and trying to build with Android studio and Proguard. The problem is that I can run it well in debug mode. But when I generate APK file, run it, it has this error :
Error reading file: ui/uiskin.json
at com.badlogic.gdx.utils.Json.a(Unknown Source)
at com.badlogic.gdx.scenes.scene2d.ui.Skin.a(Unknown Source)
at com.badlogic.gdx.scenes.scene2d.ui.Skin.<init>(Unknown Source)
at jangkoo.a.a.a.a(Unknown Source)
at jangkoo.a.e.af.a(Unknown Source)
at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(Unknown Source)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
Caused by: com.badlogic.gdx.utils.SerializationException: Field not found: down (com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle)
Clearly the last line says Field not found: down in json file.
What's wrong? what should I do?
Related
I am a newcomer who want to learn android.My friend suggested me to read the code of that player,but when I imported the project and compiled it,it crashed...
12-22 20:58:07.755 4870-4870/com.example.android.uamp
E/AndroidRuntime: FATAL EXCEPTION: main Process:
com.example.android.uamp, PID: 4870 java.lang.RuntimeException: Unable
to start activity
ComponentInfo{com.example.android.uamp/com.example.android.uamp.ui.MusicPlayerActivity}:
java.lang.RuntimeException: com.google.android.gms.internal.zzsb$zza:
No acceptable module found. Local version is 0 and remote version is
0. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2448)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) at
java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) Caused
by: java.lang.RuntimeException:
com.google.android.gms.internal.zzsb$zza: No acceptable module found.
Local version is 0 and remote version is 0. at
com.google.android.gms.internal.zzni.zzbg(Unknown Source) at
com.google.android.gms.internal.zzni.zza(Unknown Source) at
com.google.android.gms.cast.framework.CastContext.(Unknown
Source) at
com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown
Source) at
com.example.android.uamp.ui.ActionBarCastActivity.onCreate(ActionBarCastActivity.java:141)
at
com.example.android.uamp.ui.BaseActivity.onCreate(BaseActivity.java:49)
at
com.example.android.uamp.ui.MusicPlayerActivity.onCreate(MusicPlayerActivity.java:57)
at android.app.Activity.performCreate(Activity.java:6100) at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) at
java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: com.google.android.gms.internal.zzsb$zza: No acceptable
module found. Local version is 0 and remote version is 0. at
com.google.android.gms.internal.zzsb.zza(Unknown Source) at
com.google.android.gms.internal.zzni.zzbg(Unknown Source) at
com.google.android.gms.internal.zzni.zza(Unknown Source) at
com.google.android.gms.cast.framework.CastContext.(Unknown
Source) at
com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown
Source) at
com.example.android.uamp.ui.ActionBarCastActivity.onCreate(ActionBarCastActivity.java:141)
at
com.example.android.uamp.ui.BaseActivity.onCreate(BaseActivity.java:49)
at
com.example.android.uamp.ui.MusicPlayerActivity.onCreate(MusicPlayerActivity.java:57)
at android.app.Activity.performCreate(Activity.java:6100) at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) at
java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Well,when I searched for answers,the responses were not useful...
And if you have some wonderful open source project to recommend ,hope you can tell me.Thx.
Sorry for my poor english...
You need to update your google play service of device.
You can see this Bug report which already has been addressed
and possibility you will have to update your gcm dependency then appropriate modifications of code will also required mean the deprecated methods will be needed to replaced with new one in the project for e.g GoogleApiAvailability to register token etc so also make sure you are using the latest gcm dependency in your project
My project run normally in Android Studio version 2.1.2.In my project used Google map when I update AS to version 2.2 project not run (I do not use fire base but in log this error shown)
this is error log:
java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions
at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:4818)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4413)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4353)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5045)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
I was stuck with the same error for 2-3 days after i updated my Android Studio. There are many similar error questions on stack overflow. But nothing worked.
To solve it i created a new project in android studio. Copied all my code and dependencies to the new project and it worked for me.
And follow this link stackoverflow.com/a/37364044/6812027 and try to implement methods given.
I'm working on updating an existing app to Marshmallow, and have just noticed there is this message in logcat when the app launches:
E/Parcel﹕ Class not found when unmarshalling: com.redacted.TheClass
java.lang.ClassNotFoundException: com.redacted.TheClass.
It only occurs on Samsung devices, not LG nor Motorola.
After more investigation I found the problem is also present in Lollipop and thus is present in a shipped version of the app.
However, despite it being an exception it appears to be having no detrimental effect - the app passed testing on Lollipop and is functioning as intended on L and M builds.
Therefore I'd like to find out if there are any consequences to not fixing this problem? Is the app functioning properly despite this exception chance, and if some sands get shifted elsewhere it might stop working?
Why not fix it ??!! You are all jumping up and down to ask. The reason is the app is not available on the app store, it is pre-installed into devices' roms and distributing a new .apk to device manufacturers would delay their Marshmallow roms building schedule. Therefore I do not want to create a new .apk unless there is a potential that the app could stop working, even though its been working fine with this issue.
In other words, I'll like to know in depth what causes this error message, but more particularly why it is that the app continues to function despite their being an OS level exception.
The full stack trace is:
11-24 09:03:43.065 3641-5600/? E/Parcel﹕ Class not found when unmarshalling: com.redacted.TheClass
java.lang.ClassNotFoundException: com.redacted.TheClass
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at android.os.Parcel.readParcelableCreator(Parcel.java:2383)
at android.os.Parcel.readParcelable(Parcel.java:2337)
at android.os.Parcel.readValue(Parcel.java:2243)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2592)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:920)
at android.content.Intent.getStringExtra(Intent.java:6171)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:2688)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:2127)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6151)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:5928)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:170)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3836)
at android.os.Binder.execTransact(Binder.java:453)
Caused by: java.lang.ClassNotFoundException: com.cequint.cityid.CityIdResponse
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at android.os.Parcel.readParcelableCreator(Parcel.java:2383)
at android.os.Parcel.readParcelable(Parcel.java:2337)
at android.os.Parcel.readValue(Parcel.java:2243)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2592)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:920)
at android.content.Intent.getStringExtra(Intent.java:6171)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:2688)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:2127)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6151)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:5928)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:170)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3836)
at android.os.Binder.execTransact(Binder.java:453)
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
The class inherits from Parcelable and is used to store several ints, booleans and Strings along with an activity (declared as Class).
When a state machine wants to switch to a new activity it creates an instance of this class and sets the activity then passes it to a method as a parameter. The method then uses the class to create an intent to launch the activity.
After update to android studio 1.3.2 and the latest version of sdk , i have this error on my Apps please any one have any idea to resolve this problem.
Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 7895000 but found 7571000. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
at com.google.android.gms.common.GooglePlayServicesUtil.zzad(Unknown Source)
at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.maps.internal.zzy.zzaG(Unknown Source)
at com.google.android.gms.maps.internal.zzy.zzaF(Unknown Source)
at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$zzb.zzwP(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$zzb.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.onCreate(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment.onCreate(Unknown Source)
at android.support.v4.app.Fragment.performCreate(Fragment.java:1939)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:978)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1175)
at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1277)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2232)
at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:111)
at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:278)
at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:31)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:78)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:329)
at android.app.Activity.setContentView(Activity.java:1944)
at com.mac125.muslimtools_tunisie.activities.MapsActivity.onCreate(MapsActivity.java:21)
at android.app.Activity.performCreate(Activity.java:5264)
I think you/Android Studio did not update the Google Play Services Version correctly.
From the error message, you can see Android Studio is complaining about the outdated version 7571000 (which is 7.5), and the current version should be 7895000 (7.8)
Changing this number should fix the problem.
I am guessing that you are following some kind of tutorial and you copied their manifest, for usually people put #integer/google_play_services_version and reference to the integer/google_play_services_version for the newest version (even Android Studio display it as a number)
Try to add
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
in your xml
I created a new Android project in Intellij 14, then added Scala SDK 2.11.6 to it (scope provided was the only option that worked for me). The project runs fine if I don't use any Scala class. But once I use, say, string interpolation, as soon as the code is run, the app crashes with this error:
06-20 18:36:27.277 1995-1995/com.pcn.android.games.jacks D/AndroidRuntime﹕ Shutting down VM
06-20 18:36:27.289 1995-1995/com.pcn.android.games.jacks E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.pcn.android.games.jacks, PID: 1995
java.lang.NoClassDefFoundError: Failed resolution of: Lscala/StringContext;
at com.pcn.android.games.jacks.MyActivity.onCreate(MyActivity.scala:16)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "scala.StringContext" on path: DexPathList[[zip file "/data/app/com.pcn.android.games.jacks-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.pcn.android.games.jacks.MyActivity.onCreate(MyActivity.scala:16)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Suppressed: java.lang.ClassNotFoundException: scala.StringContext
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I use IntelliJ 14.1.3, Java 1.7.0_80. My proguard-project.txt file is empty, but this persists whether I turn on Proguard or not.
What have I done wrong that prevents Scala classes from being seen at runtime?
What have I done wrong that prevents Scala classes from being seen at runtime?
Hard to tell without looking into your build files and the way your app is building. I suggest you move to the Gradle build system and use one of the android-scala plugins, such as this one. I used it about 3-4 months ago in one of my apps and it worked as a charm.
Gradle-based builds will save you a lot of the time, because it's officially supported by Google and it's used by many people (thus you'll be more likely to get the help from community). It also supports some features not supported by Intellij-based build system, such as build flavors/splits and is constantly optimized by Google engineers to get the fastest build times possible.