ACRA error reporting failed - android

I am using famous ACRA Error reporting tool to send crash logs to document which I have uploaded on my Google Doc.
I have followed all below steps mentioned in
https://github.com/ACRA/acra/wiki/BasicSetup
But still my application does not send error reports to document which I have uploaded.
I could see following error logs generated by ACRA.
01-01 02:11:19.995: E/ACRA(6054): ACRA caught a RuntimeException
exception for com.example.arcasample. Building report.
Below is my source code which I believe is flawless.
MyApplication.java
package com.example.arcasample;
import org.acra.ACRA;
import org.acra.ErrorReporter;
import org.acra.annotation.ReportsCrashes;
import android.app.Application;
#ReportsCrashes(formKey = "XXXX")
public class MyApplication extends Application
{
#Override
public void onCreate()
{
// ErrorReporter.getInstance().init(this); This is not helping me
ACRA.init(this);
super.onCreate();
}
}
MainActivity.java
package com.example.arcasample;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends Activity
{
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
int a = 10 / 0; <= This will cause crash.
Log.i("vipul", "" + a);
}
}
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.arcasample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="MyApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.arcasample.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>
</application>
</manifest>
Can someone please let me know if I am missing anything.
Thanks in advance.

Well I tried deleting form created on Google docs and recreated it.I wonder what mistake i had done before?.
Anyways recreating form and carefully noting down form key resolved my issue.

Related

Parse Error: There was a problem parsing the package

I try to resolve this error from various methods in my Hello World App.These are;
-Go to Security-->Unknown sources.
-Go to About phone-->Build number.
-Update my manifest file whose picture is given below.
-Test app both on phone Y625 Huawei and on tablet T1-701u tab.
-Reboot android phone and android studio (version 3.4.1).
-Transfer apk file via data cable or airmove software.
But none of them works to solve the issue.
I develop my Hello World. Firstly i faced insufficient heap size error issue which has solved on the temporary basis. After build up my app, Parsing the package issue has emerged.
Manifest File:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hw04">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
MainActivity.java
package com.example.hw04;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Parse Error
There was a problem parsing the package enter code here

Custom Application class onCreate() never called

I'm trying to initialize Parse on a custom Application class:
import android.app.Application;
import android.util.Log;
import com.parse.Parse;
import com.parse.ParseException;
import com.parse.ParseInstallation;
import com.parse.SaveCallback;
public class SomeApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
initializeParse();
}
private void initializeParse() {
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("##########")
.clientKey("############")
.server("https://#####.com/parse/")
.build()
);
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.saveInBackground(new SaveCallback() {
#Override
public void done(ParseException e) {
// Do something here
}
});
}
}
And I already declare this Application in AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.someproject">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".SomeApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AnotherActivity"/>
</application>
</manifest>
But my custom Application is never called. I tried to put logs and break points on onCreate method, clean project, rebuild project, close and re-open Android Studio, uninstall and reinstall the app and nothing ... so, I need help.
Thanks!
Disable Instant Run, Clean build, Rebuild the project and then run again.
I had the same issue. Disabling instant run worked for me. It is weird Application class not getting called. But it happened.
In my case I forgot about declaration in the manifest:
<application
android:name=".App"
...>
This worked for me - try using this property in your Manifest file:
<application
android:name=".SomeApplication"
android:usesCleartextTraffic="true"

Android google maps get error Couldn't get connection factory client

Android google maps get error Couldn't get connection factory client, I have get apikey from here, this is my code:
MainActivity.java
package com.haichal.map;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
public class MainActivity extends MapActivity
{
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
#Override
protected boolean isRouteDisplayed() {
return false;
}
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="#+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0IbdGeqd17e6zbTdNfSze2pEt1jJzEEPoOM0jZw"
/>
</RelativeLayout>
Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.haichal.map"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".MainActivity"
android:label="#string/title_app" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And in android project target, I using Google Apis, platform 4.1.2, Api level 16.
In my eclipse project no get error(no red ballon), I debug and install success, but when I run apps, maps just get blank grid, not get maps, if I look in log cat I get message error Couldn't get connection factory client.
How to solved my problem?
when i run apps, maps just get blank grid, not get maps
Either your device does not have Internet access (at least to the Google Maps server), or your API key is wrong. Another possibility would be that you lack the INTERNET permission, but it appears that you have that already.
if i look in log cat i get message error Couldn't get connection factory client
That message happens all of the time, even when your app works.

AdMob: AdLoader timed out after 60000ms while getting the URL

I read a lot of previous AdMob posts, but none sufficiently answer the question about the AdLoader timeout problem. This is the error: http://i42.tinypic.com/9s5ag4.jpg
Note: I am using older jar file (GoogleAdMobAdsSdk-4.1.1.jar) because I am targeting an older Android version.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.something.www"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".AdActivityActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation" >
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
AdActivity.java
package com.something.www;
import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import com.google.ads.*;
public class AdActivity extends Activity {
private AdView adView;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
adView = new AdView(this, AdSize.BANNER, "xxxxxxxxxxxxxxx");
LinearLayout layout = (LinearLayout) findViewById(R.id.main);
layout.addView(adView);
AdRequest ar = new AdRequest();
ar.addTestDevice(AdRequest.TEST_EMULATOR);
ar.addTestDevice("425EF274CEBECB11F9EFEBF5B51458B1");
adView.loadAd(ar);
return;
}
}
The code looks fine - this is likely just a network error? Can you reach the internet on a web browser on the emulator/device?
FYI, you can still target old Android versions with the latest AdMob SDK (currently 4.3.1). Check out this blog post for details on how to migrate to 4.3.1.
I was getting this same error (AdLoader timed out after 60000ms while getting the URL), but only in release builds. The error was shown in under 1 second, so it might be a different issue than the one you are having. Disabling proguard optimizations by adding the following to my proguard.cfg solved the problem:
-dontoptimize
# Also comment out the existing line controlling optimizations:
# -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

Simple Hello Android.....not workign

EDIT: SOLVED I JUST HAD TO WAIT FOR AWHILE
So I followed the simple "Hello Android" tutorial:
http://developer.android.com/resources/tutorials/hello-world.html
got everything set up fine.....stuff works but when I go to actually run it.....it just says "Android_" in my virtual device....
I tried running it on 2.1 2.2 2.3.1 and 2.3.3 VD's and get the same thing?
package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
Any ideas? My first venture into android is a failing one ;_;
PIC:
bigger:http://img.photobucket.com/albums/v720/bmw_pyro/Untitled-2.png
MANIFEST:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloandroid"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloAndroid"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
"Android _" is the first loading emulator splash screen, so you are saying that you get stuck there? If that's the case, that has nothing to do with your code.

Categories

Resources