I've just started to build my first android app and this 1st time errors are bugging me now since 2 days. Finding no solution I had to come here. I have been following Androids official tutorial for my first app and can't open my app.
Error: "Unfortunately "app name" has stopped"
Here is my manisfest file,
Code:
<manifest xmlns:android=" [B]removed due to new member at the forum warning! 10 posts minimum need to post link:([/B]
package="app2.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
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>
Log Cat
03-10 08:59:54.310: D/dalvikvm(1671): Not late-enabling CheckJNI (already on)
03-10 08:59:54.400: D/AndroidRuntime(1671): Shutting down VM
03-10 08:59:54.400: W/dalvikvm(1671): threadid=1: thread exiting with uncaught exception (group=0xb2d88b20)
03-10 08:59:54.400: E/AndroidRuntime(1671): FATAL EXCEPTION: main
03-10 08:59:54.400: E/AndroidRuntime(1671): Process: app2.android, PID: 1671
03-10 08:59:54.400: E/AndroidRuntime(1671): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{app2.android/app2.android.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "app2.android.MainActivity" on path: DexPathList[[zip file "/data/app/app2.android-1.apk"],nativeLibraryDirectories=[/data/app-lib/app2.android-1, /vendor/lib, /system/lib]]
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.app.ActivityThread.access$800(ActivityThread.java:135)
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.os.Handler.dispatchMessage(Handler.java:102)
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.os.Looper.loop(Looper.java:136)
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.app.ActivityThread.main(ActivityThread.java:5017)
03-10 08:59:54.400: E/AndroidRuntime(1671): at java.lang.reflect.Method.invokeNative(Native Method)
03-10 08:59:54.400: E/AndroidRuntime(1671): at java.lang.reflect.Method.invoke(Method.java:515)
03-10 08:59:54.400: E/AndroidRuntime(1671): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-10 08:59:54.400: E/AndroidRuntime(1671): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-10 08:59:54.400: E/AndroidRuntime(1671): at dalvik.system.NativeStart.main(Native Method)
03-10 08:59:54.400: E/AndroidRuntime(1671): Caused by: java.lang.ClassNotFoundException: Didn't find class "app2.android.MainActivity" on path: DexPathList[[zip file "/data/app/app2.android-1.apk"],nativeLibraryDirectories=[/data/app-lib/app2.android-1, /vendor/lib, /system/lib]]
03-10 08:59:54.400: E/AndroidRuntime(1671): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-10 08:59:54.400: E/AndroidRuntime(1671): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
03-10 08:59:54.400: E/AndroidRuntime(1671): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
03-10 08:59:54.400: E/AndroidRuntime(1671): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
03-10 08:59:54.400: E/AndroidRuntime(1671): ... 11 more
I have been rolling all over the internet for solutions, tried so many, doesn't work!!! PLEASE HELP!
Activity name change to
.MainActivity in manifest
Sent from my GT-S7392 using XDA Premium 4 mobile app
arpitkh96 said:
Activity name change to
.MainActivity in manifest
Sent from my GT-S7392 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
i did. Same error!:crying:
Try writing the full package name to instead of just "MainActivity"
<activity android:name="app2.android.MainActivity" >
In the manifest change your activity name to <activity android:name="app2.android.MainActivity" > and also make sure that your project src folder has correct package inside (named app2.android)
Related
Alright i finally got a SIM card for my baby. Howerver for some weird reason i get a force close when trying to access the Mobile Networks menu in the system settings. Logcat snippet is below:
Code:
05-08 12:43:58.141 I/ActivityManager( 210): START {act=android.intent.action.MAIN cmp=com.android.phone/.Settings} from pid 913
05-08 12:43:58.144 D/AndroidRuntime( 913): Shutting down VM
05-08 12:43:58.144 W/dalvikvm( 913): threadid=1: thread exiting with uncaught exception (group=0x40a311f8)
05-08 12:43:58.154 E/AndroidRuntime( 913): FATAL EXCEPTION: main
05-08 12:43:58.154 E/AndroidRuntime( 913): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.phone/com.a
ndroid.phone.Settings}; have you declared this activity in your AndroidManifest.xml?
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1508)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.app.Activity.startActivityForResult(Activity.java:3190)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.app.Activity.startActivity(Activity.java:3297)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.preference.Preference.performClick(Preference.java:957)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:202)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.widget.AdapterView.performItemClick(AdapterView.java:292)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.widget.AbsListView.performItemClick(AbsListView.java:1083)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2539)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.widget.AbsListView$1.run(AbsListView.java:3193)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.os.Handler.handleCallback(Handler.java:605)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.os.Handler.dispatchMessage(Handler.java:92)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.os.Looper.loop(Looper.java:137)
05-08 12:43:58.154 E/AndroidRuntime( 913): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-08 12:43:58.154 E/AndroidRuntime( 913): at java.lang.reflect.Method.invokeNative(Native Method)
05-08 12:43:58.154 E/AndroidRuntime( 913): at java.lang.reflect.Method.invoke(Method.java:511)
05-08 12:43:58.154 E/AndroidRuntime( 913): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-08 12:43:58.154 E/AndroidRuntime( 913): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-08 12:43:58.154 E/AndroidRuntime( 913): at dalvik.system.NativeStart.main(Native Method)
05-08 12:43:58.164 W/ActivityManager( 210): Force finishing activity com.android.settings/.SubSettings
05-08 12:43:58.681 W/ActivityManager( 210): Activity pause timeout for ActivityRecord{416a5ff8 com.android.settings/.SubSettings}
05-08 12:43:58.684 I/Process ( 210): Sending signal. PID: 913 SIG: 3
05-08 12:43:58.684 I/dalvikvm( 913): threadid=3: reacting to signal 3
05-08 12:43:58.688 I/dalvikvm( 913): Wrote stack traces to '/data/anr/traces.txt'
05-08 12:43:59.214 I/Process ( 210): Sending signal. PID: 913 SIG: 3
05-08 12:43:59.218 I/dalvikvm( 913): threadid=3: reacting to signal 3
Secondly, when trying to dial out, i get a FC logcat is below:
Code:
05-08 12:47:30.374 W/dalvikvm( 1315): threadid=1: thread exiting with uncaught exception (group=0x40a311f8)
05-08 12:47:30.374 I/ActivityManager( 210): START {act=android.intent.action.CALL_PRIVILEGED dat=tel:x flg=0x10000000 (has extras)} from pid 1315
05-08 12:47:30.384 E/AndroidRuntime( 1315): FATAL EXCEPTION: main
05-08 12:47:30.384 E/AndroidRuntime( 1315): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.
CALL_PRIVILEGED dat=tel:x flg=0x10000000 (has extras) }
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1482)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.app.Activity.startActivityFromFragment(Activity.java:3488)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.app.Fragment.startActivity(Fragment.java:973)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at com.android.contacts.dialpad.DialpadFragment.dialButtonPressed(DialpadFragment.java:1174)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at com.android.contacts.dialpad.DialpadFragment.onClick(DialpadFragment.java:953)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.view.View.performClick(View.java:3511)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.view.View$PerformClick.run(View.java:14105)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.os.Handler.handleCallback(Handler.java:605)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.os.Handler.dispatchMessage(Handler.java:92)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.os.Looper.loop(Looper.java:137)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at java.lang.reflect.Method.invokeNative(Native Method)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at java.lang.reflect.Method.invoke(Method.java:511)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-08 12:47:30.384 E/AndroidRuntime( 1315): at dalvik.system.NativeStart.main(Native Method)
05-08 12:47:30.398 W/ActivityManager( 210): Force finishing activity com.android.contacts/.activities.DialtactsActivity
05-08 12:47:30.891 I/TaskSwitcherService( 1098): Handle command: org.rabold.android.taskswitcher.action.UPDATE_THUMBNAILS
05-08 12:47:30.898 I/TaskSwitcherService( 1098): Querying thumbnail for task #11: ComponentInfo{com.android.contacts/com.android.contacts.activities.D
ialtactsActivity}
05-08 12:47:30.911 W/ActivityManager( 210): Activity pause timeout for ActivityRecord{414f2918 com.android.contacts/.activities.DialtactsActivity}
05-08 12:47:30.915 I/Process ( 210): Sending signal. PID: 1315 SIG: 3
05-08 12:47:30.915 I/dalvikvm( 1315): threadid=3: reacting to signal 3
05-08 12:47:30.921 I/dalvikvm( 1315): Wrote stack traces to '/data/anr/traces.txt'
Btw there is no traces.txt for some reason i looked -.-
Also this is NOT ROM related it is something to do with my data partition as when i factory reset or wipe my data partition everything works. I would PREFER to find and fix this problem as i have a lot of data and would NOT like to start over again -.-
Thanks all for looking
Bleh nobody has any idea?
Sent from my HTC HD2 using Tapatalk
Hey dude, once i had the same problem as you have it right now
it looks like no ROM issue at all
but after i did clean install. my device work flawlessly
you should try clean install
good luck
mainweb said:
Hey dude, once i had the same problem as you have it right now
it looks like no ROM issue at all
but after i did clean install. my device work flawlessly
you should try clean install
good luck
Click to expand...
Click to collapse
Thanks man however im trying to stear away from clean install. :/
as for an update: Ive narrowed it down to the directory /data/system upon deletion of that directory, it almost acts like a clean install. But all my apps get FC when trying to launch. So i deleted that directory and rebooted, then tried restoring the files but then i get a boot loop. i think clean install is the only option
Guys,I am trying to integrate admob SDK in my app from the past 3 hours and have no luck.
I have added the jar libraries ( build path), included in build paths, everything is good there.
main activity :
Code:
// Create the adView
adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID);
// Lookup your LinearLayout assuming it's been given
// the attribute android:id="@+id/mainLayout"
RelativeLayout layout = (RelativeLayout)findViewById(R.id.ad);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());
layout
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<com.google.ads.AdView
android:id="@+id/ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
ads:adSize="BANNER"
ads:adUnitId="a15XZXXXXX3"
ads:loadAdOnCreate="true" />
everything loaded on the manifest file as well!
LOGCAT :
Code:
07-09 15:33:20.362: D/dalvikvm(12621): GC_CONCURRENT freed 188K, 3% free 8916K/9132K, paused 5ms+8ms, total 46ms
07-09 15:33:20.362: E/AndroidRuntime(12621): FATAL EXCEPTION: main
07-09 15:33:20.362: E/AndroidRuntime(12621): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.PACKAGE/com.PACKAGE.MainActivity}: java.lang.NullPointerException
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.os.Handler.dispatchMessage(Handler.java:99)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.os.Looper.loop(Looper.java:137)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-09 15:33:20.362: E/AndroidRuntime(12621): at java.lang.reflect.Method.invokeNative(Native Method)
07-09 15:33:20.362: E/AndroidRuntime(12621): at java.lang.reflect.Method.invoke(Method.java:511)
07-09 15:33:20.362: E/AndroidRuntime(12621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-09 15:33:20.362: E/AndroidRuntime(12621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-09 15:33:20.362: E/AndroidRuntime(12621): at dalvik.system.NativeStart.main(Native Method)
07-09 15:33:20.362: E/AndroidRuntime(12621): Caused by: java.lang.NullPointerException
07-09 15:33:20.362: E/AndroidRuntime(12621): at com.PACKAGE.MainActivity.onCreate(MainActivity.java:42)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.Activity.performCreate(Activity.java:5104)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
07-09 15:33:20.362: E/AndroidRuntime(12621): ... 11 more
07-09 15:33:22.877: I/Process(12621): Sending signal. PID: 12621 SIG: 9
chintz24 said:
Guys,I am trying to integrate admob SDK in my app from the past 3 hours and have no luck.
07-09 15:33:20.362: E/AndroidRuntime(12621): Caused by: java.lang.NullPointerException
07-09 15:33:20.362: E/AndroidRuntime(12621): at com.PACKAGE.MainActivity.onCreate(MainActivity.java:42)
Click to expand...
Click to collapse
says there, line 42, your asking "NULL" to do something! No idea what is on line 42, but would assume it's your ad view, so maybe your loading the wrong layout ? or even attempting to findViewById before setContentView() ? Would need more info/code
deanwray said:
says there, line 42, your asking "NULL" to do something! No idea what is on line 42, but would assume it's your ad view, so maybe your loading the wrong layout ? or even attempting to findViewById before setContentView() ? Would need more info/code
Click to expand...
Click to collapse
or even attempting to findViewById before setContentView()
This is what I was doing.
Thanks a lot.
Also does it take time to load ads?
because I dont see anything. Not even blank "ads by google"
chintz24 said:
or even attempting to findViewById before setContentView()
This is what I was doing.
Thanks a lot.
Also does it take time to load ads?
because I dont see anything. Not even blank "ads by google"
Click to expand...
Click to collapse
No idea, not used ads yet
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<com.google.ads.AdView
android:id="@+id/ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
ads:adSize="BANNER"
ads:adUnitId="aXXXXXXXXXXX"
ads:loadAdOnCreate="true" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true" />
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:minHeight="1dip" />
</RelativeLayout>
This is my layout.xml
Thanks, its sorted, I didnt have any container for my ads. Done now
chintz24 said:
Guys,I am trying to integrate admob SDK in my app from the past 3 hours and have no luck.
I have added the jar libraries ( build path), included in build paths, everything is good there.
main activity :
Code:
// Create the adView
adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID);
// Lookup your LinearLayout assuming it's been given
// the attribute android:id="@+id/mainLayout"
RelativeLayout layout = (RelativeLayout)findViewById(R.id.ad);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());
layout
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<com.google.ads.AdView
android:id="@+id/ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
ads:adSize="BANNER"
ads:adUnitId="a15XZXXXXX3"
ads:loadAdOnCreate="true" />
everything loaded on the manifest file as well!
LOGCAT :
Code:
07-09 15:33:20.362: D/dalvikvm(12621): GC_CONCURRENT freed 188K, 3% free 8916K/9132K, paused 5ms+8ms, total 46ms
07-09 15:33:20.362: E/AndroidRuntime(12621): FATAL EXCEPTION: main
07-09 15:33:20.362: E/AndroidRuntime(12621): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.PACKAGE/com.PACKAGE.MainActivity}: java.lang.NullPointerException
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.os.Handler.dispatchMessage(Handler.java:99)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.os.Looper.loop(Looper.java:137)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-09 15:33:20.362: E/AndroidRuntime(12621): at java.lang.reflect.Method.invokeNative(Native Method)
07-09 15:33:20.362: E/AndroidRuntime(12621): at java.lang.reflect.Method.invoke(Method.java:511)
07-09 15:33:20.362: E/AndroidRuntime(12621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-09 15:33:20.362: E/AndroidRuntime(12621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-09 15:33:20.362: E/AndroidRuntime(12621): at dalvik.system.NativeStart.main(Native Method)
07-09 15:33:20.362: E/AndroidRuntime(12621): Caused by: java.lang.NullPointerException
07-09 15:33:20.362: E/AndroidRuntime(12621): at com.PACKAGE.MainActivity.onCreate(MainActivity.java:42)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.Activity.performCreate(Activity.java:5104)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
07-09 15:33:20.362: E/AndroidRuntime(12621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
07-09 15:33:20.362: E/AndroidRuntime(12621): ... 11 more
07-09 15:33:22.877: I/Process(12621): Sending signal. PID: 12621 SIG: 9
Click to expand...
Click to collapse
Hi,
You are mixing the two solutions for integration of admob banners (XML and code). The coding solution assumes that you have a layout that you want to populate with ads (useful when using different ad networks). In your case you define the admob banner in the XML so you don't need to call it at all in the code, If you think to set a listener (to do something when admob failed to show ads) in this case you can call and set your ad listener (that you implement on the activity) this way:
AdView adView = (AdView)findViewById(R.id.ad);
adView.setAdListener (this);
adView.loadAd(new AdRequest());
Hope this will help
Hey, i was working through intent, when I encountered this error. My app seems to crash, when any of the button is clicked..
Please help me out.. I am providing all the codes..
manifest:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.intent"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.intent.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>
main_activity.xml:
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10sp" >
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="onClickWebBrowser"
android:onClick="onClickWebBrowser" />
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button1"
android:layout_alignParentBottom="true"
android:text="oClickMakeCalls"
android:onClick="onClickMakeCalls"/>
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/button1"
android:layout_centerVertical="true"
android:text="onClickShowMap"
android:onClick="onClickShowMap" />
</RelativeLayout>
MainActivity.java:
Code:
package com.example.intent;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
public class MainActivity extends Activity {
int request_code = 1;
[user=439709]@override[/user]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void onClickWebBrowser(View v) {
Intent i = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("www.crazyandroidgalaxy.blogspot.in"));
startActivity(i);
}
public void onClickMakeCalls(View v) {
Intent i = new Intent(android.content.Intent.ACTION_DIAL,
Uri.parse("01123235616"));
startActivity(i);
}
public void onClickShowMap(View v) {
Intent i = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("“geo:37.827500,-122.481670”"));
startActivity(i);
}
}
logcat:
Code:
07-11 12:46:55.290: D/AndroidRuntime(284): Shutting down VM
07-11 12:46:55.290: W/dalvikvm(284): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-11 12:46:55.569: E/AndroidRuntime(284): FATAL EXCEPTION: main
07-11 12:46:55.569: E/AndroidRuntime(284): java.lang.IllegalStateException: Could not execute method of the activity
07-11 12:46:55.569: E/AndroidRuntime(284): at android.view.View$1.onClick(View.java:2072)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.view.View.performClick(View.java:2408)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.view.View$PerformClick.run(View.java:8816)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.os.Handler.handleCallback(Handler.java:587)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.os.Handler.dispatchMessage(Handler.java:92)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.os.Looper.loop(Looper.java:123)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-11 12:46:55.569: E/AndroidRuntime(284): at java.lang.reflect.Method.invokeNative(Native Method)
07-11 12:46:55.569: E/AndroidRuntime(284): at java.lang.reflect.Method.invoke(Method.java:521)
07-11 12:46:55.569: E/AndroidRuntime(284): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-11 12:46:55.569: E/AndroidRuntime(284): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-11 12:46:55.569: E/AndroidRuntime(284): at dalvik.system.NativeStart.main(Native Method)
07-11 12:46:55.569: E/AndroidRuntime(284): Caused by: java.lang.reflect.InvocationTargetException
07-11 12:46:55.569: E/AndroidRuntime(284): at com.example.intent.MainActivity.onClickWebBrowser(MainActivity.java:24)
07-11 12:46:55.569: E/AndroidRuntime(284): at java.lang.reflect.Method.invokeNative(Native Method)
07-11 12:46:55.569: E/AndroidRuntime(284): at java.lang.reflect.Method.invoke(Method.java:521)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.view.View$1.onClick(View.java:2067)
07-11 12:46:55.569: E/AndroidRuntime(284): ... 11 more
07-11 12:46:55.569: E/AndroidRuntime(284): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=www.crazyandroidgalaxy.blogspot.in }
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.Activity.startActivityForResult(Activity.java:2817)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.Activity.startActivity(Activity.java:2923)
07-11 12:46:55.569: E/AndroidRuntime(284): ... 15 more
07-11 12:46:55.569: E/AndroidRuntime(284): FATAL EXCEPTION: main
07-11 12:46:55.569: E/AndroidRuntime(284): java.lang.IllegalStateException: Could not execute method of the activity
07-11 12:46:55.569: E/AndroidRuntime(284): at android.view.View$1.onClick(View.java:2072)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.view.View.performClick(View.java:2408)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.view.View$PerformClick.run(View.java:8816)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.os.Handler.handleCallback(Handler.java:587)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.os.Handler.dispatchMessage(Handler.java:92)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.os.Looper.loop(Looper.java:123)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-11 12:46:55.569: E/AndroidRuntime(284): at java.lang.reflect.Method.invokeNative(Native Method)
07-11 12:46:55.569: E/AndroidRuntime(284): at java.lang.reflect.Method.invoke(Method.java:521)
07-11 12:46:55.569: E/AndroidRuntime(284): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-11 12:46:55.569: E/AndroidRuntime(284): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-11 12:46:55.569: E/AndroidRuntime(284): at dalvik.system.NativeStart.main(Native Method)
07-11 12:46:55.569: E/AndroidRuntime(284): Caused by: java.lang.reflect.InvocationTargetException
07-11 12:46:55.569: E/AndroidRuntime(284): at com.example.intent.MainActivity.onClickWebBrowser(MainActivity.java:24)
07-11 12:46:55.569: E/AndroidRuntime(284): at java.lang.reflect.Method.invokeNative(Native Method)
07-11 12:46:55.569: E/AndroidRuntime(284): at java.lang.reflect.Method.invoke(Method.java:521)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.view.View$1.onClick(View.java:2067)
07-11 12:46:55.569: E/AndroidRuntime(284): ... 11 more
07-11 12:46:55.569: E/AndroidRuntime(284): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=www.crazyandroidgalaxy.blogspot.in }
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.Activity.startActivityForResult(Activity.java:2817)
07-11 12:46:55.569: E/AndroidRuntime(284): at android.app.Activity.startActivity(Activity.java:2923)
07-11 12:46:55.569: E/AndroidRuntime(284): ... 15 more
07-11 12:46:57.890: I/Process(284): Sending signal. PID: 284 SIG: 9
Please help me out! Thanks in advance..
Aren't there prefixes for the Uris?
Try "tel:<your number>" for example for the dial intent. (If that does not work, search for the right prefix.)
Its strange, i got this code from a book (begining android application development.)
How can it be faulty..
I dont find any prefix for the uriS
edit:
Actually, there is a prefix for the dialing intent.
But not, for the browser intent.
So, my app is still cashing
edit: actually, it.worked. But the map is still crashing
Sent from my GT-S6102 using xda app-developers app
Unfortunately, i donot have an Android device on hand. I was trying to run the sample Geofencing app provided on Android Developer.
However, the app crashes as soon as it is initiated. The emulator details are (PLATFORM = Android 4.4.2, API = 19, CPU = ARM)
I get this LogCat error:
Code:
05-29 09:28:08.633: E/AndroidRuntime(1375): FATAL EXCEPTION: main
05-29 09:28:08.633: E/AndroidRuntime(1375): Process: com.example.android.geofence, PID: 1375
05-29 09:28:08.633: E/AndroidRuntime(1375): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.geofence/com.example.android.geofence.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.android.geofence.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.android.geofence-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.android.geofence-1, /system/lib]]
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.os.Handler.dispatchMessage(Handler.java:102)
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.os.Looper.loop(Looper.java:136)
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-29 09:28:08.633: E/AndroidRuntime(1375): at java.lang.reflect.Method.invokeNative(Native Method)
05-29 09:28:08.633: E/AndroidRuntime(1375): at java.lang.reflect.Method.invoke(Method.java:515)
05-29 09:28:08.633: E/AndroidRuntime(1375): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-29 09:28:08.633: E/AndroidRuntime(1375): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-29 09:28:08.633: E/AndroidRuntime(1375): at dalvik.system.NativeStart.main(Native Method)
05-29 09:28:08.633: E/AndroidRuntime(1375): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.android.geofence.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.android.geofence-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.android.geofence-1, /system/lib]]
05-29 09:28:08.633: E/AndroidRuntime(1375): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
05-29 09:28:08.633: E/AndroidRuntime(1375): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
05-29 09:28:08.633: E/AndroidRuntime(1375): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
05-29 09:28:08.633: E/AndroidRuntime(1375): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
05-29 09:28:08.633: E/AndroidRuntime(1375): ... 11 more
05-29 09:28:12.323: I/Process(1375): Sending signal. PID: 1375 SIG: 9
I'm trying to make QuickMemo work on CM... So far it's not going anywhere as I'm kinda noob with Android... And I'm hoping someone with more knowledge can help me!
I copied LGQMemo.apk to /system/priv-app and was able to run it through Secure settings Launch activity and here is what I got in return:
06-11 11:54:48.412 I/ActivityManager( 826): START u0 {flg=0x10000000 cmp=com.lge.QuickClip/.QuickClipActivity} from pid 8370
06-11 11:54:48.422 I/SecureSettings.ActionService( 8370): onHandleIntent::Action Success
06-11 11:54:48.422 V/Zygote ( 8527): Switching descriptor 42 to /dev/null
06-11 11:54:48.422 V/Zygote ( 8527): Switching descriptor 9 to /dev/null
06-11 11:54:48.422 I/ActivityManager( 826): Start proc com.lge.QuickClip for activity com.lge.QuickClip/.QuickClipActivity: pid=8527 uid=10149 gids={50149, 1028, 1015}
06-11 11:54:48.462 I/dalvikvm( 8527): DexOpt: mismatch dep name: '/data/dalvik-cache/[email protected]@[email protected]' vs. '/system/framework/core.odex'
06-11 11:54:48.462 E/dalvikvm( 8527): /system/priv-app/LGQMemo.apk odex has stale dependencies
06-11 11:54:48.462 D/ActivityThread( 8527): handleBindApplication:com.lge.QuickClip
06-11 11:54:48.462 D/ActivityThread( 8527): setTargetHeapUtilization:0.75
06-11 11:54:48.462 D/ActivityThread( 8527): setTargetHeapMinFree:2097152
06-11 11:54:48.462 W/dalvikvm( 8527): Unable to resolve superclass of Lcom/lge/QuickClip/QuickClipActivity; (270)
06-11 11:54:48.462 W/dalvikvm( 8527): Link of class 'Lcom/lge/QuickClip/QuickClipActivity;' failed
06-11 11:54:48.462 D/AndroidRuntime( 8527): Shutting down VM
06-11 11:54:48.462 W/dalvikvm( 8527): threadid=1: thread exiting with uncaught exception (group=0x419b2ce0)
06-11 11:54:48.472 E/AndroidRuntime( 8527): FATAL EXCEPTION: main
06-11 11:54:48.472 E/AndroidRuntime( 8527): Process: com.lge.QuickClip, PID: 8527
06-11 11:54:48.472 E/AndroidRuntime( 8527): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.lge.QuickClip/com.lge.QuickClip.QuickClipActivity}: java.lang.ClassNotFoundException: Didn't find class "com.lge.QuickClip.QuickClipActivity" on path: DexPathList[[zip file "/system/priv-app/LGQMemo.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2120)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2253)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.access$800(ActivityThread.java:145)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.os.Handler.dispatchMessage(Handler.java:102)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.os.Looper.loop(Looper.java:136)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.main(ActivityThread.java:5128)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at java.lang.reflect.Method.invokeNative(Native Method)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at java.lang.reflect.Method.invoke(Method.java:515)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at dalvik.system.NativeStart.main(Native Method)
06-11 11:54:48.472 E/AndroidRuntime( 8527): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.lge.QuickClip.QuickClipActivity" on path: DexPathList[[zip file "/system/priv-app/LGQMemo.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
06-11 11:54:48.472 E/AndroidRuntime( 8527): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2111)
06-11 11:54:48.472 E/AndroidRuntime( 8527): ... 12 more
06-11 11:54:48.472 W/ActivityManager( 826): Force finishing activity com.lge.QuickClip/.QuickClipActivity
06-11 11:54:48.472 W/InputMethodManagerService( 826): Window already focused, ignoring focus gain of: [email protected] attribute=null, token = [email protected]
06-11 11:54:48.972 W/ActivityManager( 826): Activity pause timeout for ActivityRecord{424ae208 u0 com.lge.QuickClip/.QuickClipActivity t15 f}
06-11 11:54:49.022 I/Timeline( 1458): Timeline: Activity_idle id: [email protected] time:413509
06-11 11:54:49.482 D/qcom_sensors_hal( 826): hal_sensor1_data_cb: msg_type 2
06-11 11:54:49.922 I/Process ( 8527): Sending signal. PID: 8527 SIG: 9
06-11 11:54:49.932 D/PhoneStatusBar( 1239): disable: < expand icons alerts ticker system_info back home recent CLOCK* search >
06-11 11:54:49.932 W/InputMethodManagerService( 826): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$S[email protected] attribute=null, token = [email protected]
06-11 11:54:49.932 I/ActivityManager( 826): Process com.lge.QuickClip (pid 8527) has died.
Click to expand...
Click to collapse
Since I cannot install it directly, I was wondering why can the Secure Settings find the application and it's main activity but in the logcat it says it cannot be found?
Thanks in advance! (QMemo and QMemo.odex taken from latest CloudyFlex 2.4)
You may want to look for his people got the remote working. Pretty sure it looks for the eula being agreed to before it works
Sent from my LG-VS980 using Tapatalk
Hummm... But wouldn't it need to be shown on the EULA when you first start the system? As I recall, only the remote and VuTalk where shown...
I tried copying some files the the system/framework folder and got a reboot AND system format for free! Had to reinstall CM! Damn! (as I said I'm not a android/linux expert hehehe)