@Override
public void donateOnClic(ActivityOrganizationModel activityOrganizationModel) {
DonateActivity.startActivity(activityOrganizationModel, getScreenName(), getContext());
try {
sendToMixpanelLanguage(Config.MIXPANEL_EVENT_DONATION_ACTIVITY);
} catch (JSONException e) {
e.printStackTrace();
}
}
V/FA: Inactivity, disconnecting from the service
E/HTTP: <-- 500 INTERNAL SERVER ERROR https://automator.appgain.io/automessages/5e403f53970b2b000b92de74/firevent/userdidnotdonate/123468393 (7568ms)
E/HTTP: Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: x-parse-master-key,x-parse-application-id,Accept,Accept-Version,Content-Length,Content-MD5,Content-Type,Date,X-Auth-Token,authToken,appapikey,Authorization,appid
Content-Type: text/html; charset=UTF-8
Date: Sun, 07 Nov 2021 09:00:58 GMT
Server: gunicorn/19.6.0
Via: kong/0.11.2
X-Kong-Proxy-Latency: 2862
X-Kong-Upstream-Latency: 3764
Content-Length: 291
Connection: keep-alive
E/HTTP: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
<-- END HTTP (291-byte body)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.quantatil.ikhar, PID: 22387
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
at com.google.gson.Gson.fromJson(Gson.java:927)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at io.appgain.sdk.controller.Utils.getAppGainFailure(Utils.java:81)
at io.appgain.sdk.controller.Automator$1$2.onResponse(Automator.java:65)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:71)
at android.os.Handler.handleCallback(Handler.java:794)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
at com.google.gson.Gson.fromJson(Gson.java:927)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at io.appgain.sdk.controller.Utils.getAppGainFailure(Utils.java:81)
at io.appgain.sdk.controller.Automator$1$2.onResponse(Automator.java:65)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:71)
at android.os.Handler.handleCallback(Handler.java:794)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
问题是:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
当您试图将JSON
对象转换为POJO
时,就会发生这种情况,但在本例中,JSON
对象&POJO
对象根本不匹配,因此GSON
抛出此异常
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
因此,应用程序在GSON
会话状态下崩溃,其中GSON
正在expose一个JSON
对象(对应于您的POJO
),但得到一个HTML
页面。
每次我点击按钮1,我的应用程序就会崩溃。同一活动中的另一个按钮可以正常工作。我已经试过更换按钮和代码了。控制台中没有错误。
问题内容: 我一直试图在Eclipse中制作我的第一个android应用程序(一个简单的温度转换器),但是当我单击手机上的按钮时,该应用程序崩溃了。这是完整的Java代码 单击按钮时的LogCat 最后是按钮的xml 我不确定如何解决此问题,因此希望有人可以提供帮助。谢谢。 问题答案: 首先初始化您的按钮,然后将onclicklistener设置为它们 同样设置另一个按钮
在logcat我看到了这个- 需要关于发生了什么以及如何解决的建议。我使用的是android studio北极狐2020.3.1补丁3。
} 以下是我从logcat收到的错误:
一切正常,应用程序出现了。但当我点击任何切换按钮时,应用程序就会崩溃。 我试过了,但找不到问题。其实我的知识还不够,我是这个领域的新手。所以请帮帮我。 这是查看活动。JAVA 还有这只logcat 2020-03-18 03:16:50.407 31609-31609/? E/lpaper。wallper:运行时设置的未知位_标志:0x8000 2020-03-18 03:17:04.862 31
每当我单击登录页面中的“注册”按钮时,应用程序就会崩溃,无法移动到下一个活动。我已经在这个问题上纠缠了一天,似乎在任何地方都找不到解决办法。 下面是我为注册按钮方法编写的代码。(和是文本输入布局) Logcat在第7行显示错误,即ref.child(…行)。我尝试了第7行的替代方法,如: