How to access packages created in android studio? - android

I am new to android and stuck at point. Please help!
I have created a dummy Hello world program (with project name testneha) in android studio. I created a new package "AppTest" folder inside the "com.example.ospune.testneha" folder. Inside the package, have created a JAVA class file with name AppTest1.
Folder Structure
com.example.ospune.test
AppTest(package folder)
AppTest1(java file)
MainActivity(file)
In AppTest1 file, onCreate folder I am calling "apptest layout file".
Now In the mainActivity file, I have added a button; which on being clicked calls startActivity mentioned in the AppTest1 class.
public void sendMessage(View view)
{
Intent intent = new Intent(this, com.example.ospune.test.neha.AppTest.AppTest1.class");
startActivity(intent);
}
My problem is when I click the button, I get a pop up saying "unfortunately, Test has stopped."
AndroidManifest.xml was also updated with the AppTest1.class activity
<activity
android:name=".AppTest.AppTest1"
android:parentActivityName=".MainActivity"
</activity>
I am clueless as what is the reason for this :(
LogCat error -
11-03 04:34:43.409 2055-2055/com.example.ospunelap_130.testneha I/art: Not late-enabling -Xcheck:jni (already on)
11-03 04:34:43.410 2055-2055/com.example.ospunelap_130.testneha I/art: Late-enabling JIT
11-03 04:34:43.419 2055-2055/com.example.ospunelap_130.testneha I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
11-03 04:34:43.507 2055-2055/com.example.ospunelap_130.testneha W/System: ClassLoader referenced unknown path: /data/app/com.example.ospunelap_130.testneha-2/lib/x86
11-03 04:34:43.914 2055-2083/com.example.ospunelap_130.testneha D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
11-03 04:34:43.918 2055-2055/com.example.ospunelap_130.testneha D/: HostConnection::get() New Host Connection established 0xad7f0110, tid 2055
11-03 04:34:44.008 2055-2083/com.example.ospunelap_130.testneha D/: HostConnection::get() New Host Connection established 0xad7f0420, tid 2083
11-03 04:34:44.033 2055-2083/com.example.ospunelap_130.testneha I/OpenGLRenderer: Initialized EGL, version 1.4
11-03 04:34:44.145 2055-2083/com.example.ospunelap_130.testneha W/EGL_emulation: eglSurfaceAttrib not implemented
11-03 04:34:44.145 2055-2083/com.example.ospunelap_130.testneha W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xabebf2c0, error=EGL_SUCCESS
11-03 04:34:45.360 2055-2055/com.example.ospunelap_130.testneha I/Choreographer: Skipped 66 frames! The application may be doing too much work on its main thread.
11-03 04:35:03.158 2055-2055/com.example.ospunelap_130.testneha D/AndroidRuntime: Shutting down VM
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: FATAL EXCEPTION: main
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: Process: com.example.ospunelap_130.testneha, PID: 2055
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ospunelap_130.testneha/com.example.ospunelap_130.testneha.AppTest.AppTest1}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.support.v7.widget.Toolbar.getTitle()' on a null object reference
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.support.v7.widget.Toolbar.getTitle()' on a null object reference
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.support.v7.internal.widget.ToolbarWidgetWrapper.<init>(ToolbarWidgetWrapper.java:100)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.support.v7.internal.widget.ToolbarWidgetWrapper.<init>(ToolbarWidgetWrapper.java:93)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.support.v7.internal.app.ToolbarActionBar.<init>(ToolbarActionBar.java:78)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.setSupportActionBar(AppCompatDelegateImplV7.java:206)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:99)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at com.example.ospunelap_130.testneha.AppTest.AppTest1.onCreate(AppTest1.java:22)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6237)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java) 
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417) 
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
11-03 04:35:03.159 2055-2055/com.example.ospunelap_130.testneha E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
11-03 04:35:07.335 2055-2055/com.example.ospunelap_130.testneha I/Process: Sending signal. PID: 2055 SIG: 9

EDIT:
The error is due to invoking toolbar.getTitle() method. The toolbar object is returning null. Try this:
Toolbar toolbar = (Toolbar) findviewById(R.id.toolbar);
to initialize the toolbar. The error is at line no. 22 according to logcat.

Related

app crash when first run on Android 4.4

I am using Android studio to build my app
I have 2 emulators the first uses Android 6.0 and the second uses Android 4.4
My app runs perfectly on the Android 6.0 but when I try it on 4.4 it crashes immediately.
I tried debugging the app by putting break point on the first like but it does not reach the first line. it crashes stright away.
The error message I got is not that clear, I dont know what the problem is and how to fix it.
01/23 17:26:16: Launching app
No apk changes detected since last installation, skipping installation of D:\__Schlogger\Android\Schlogger\app\build\outputs\apk\app-debug.apk
$ adb shell am force-stop com.asmgx.schlogger.app
$ adb shell am start -n "com.asmgx.schlogger.app/com.asmgx.schlogger.app.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.asmgx.schlogger.app | com.asmgx.schlogger.app.test
Waiting for application to come online: com.asmgx.schlogger.app | com.asmgx.schlogger.app.test
Waiting for application to come online: com.asmgx.schlogger.app | com.asmgx.schlogger.app.test
Waiting for application to come online: com.asmgx.schlogger.app | com.asmgx.schlogger.app.test
Connecting to com.asmgx.schlogger.app
I/dalvikvm: Debugger is active
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
Connected to the target VM, address: 'localhost:8607', transport: 'socket'
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1368)
W/dalvikvm: VFY: unable to resolve static field 7536 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
D/dalvikvm: VFY: replacing opcode 0x60 at 0x000e
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x9cd52b20)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.asmgx.schlogger.app, PID: 2822
java.lang.NoClassDefFoundError: com.google.android.gms.R$string
at com.google.android.gms.common.internal.zzai.<init>(Unknown Source)
at com.google.firebase.FirebaseOptions.fromResource(Unknown Source)
at com.google.firebase.FirebaseApp.zzek(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$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:5017)
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)
Disconnected from the target VM, address: 'localhost:8607', transport: 'socket'
-----------------------------------------------------------------------------------------------------
After applying the solutions provided, I got another error, and still does not know what does it mean?
01-23 03:02:29.954 9105-9105/? I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
01-23 03:02:29.954 9105-9105/? W/dalvikvm: VFY: unable to resolve virtual method 723: Landroid/content/res/TypedArray;.getType (I)I
01-23 03:02:29.954 9105-9105/? D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008
01-23 03:02:29.964 9105-9105/? E/VdcInflateDelegate: Exception while inflating <vector>
org.xmlpull.v1.XmlPullParserException: Binary XML file line #17<vector> tag requires viewportHeight > 0
at android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:720)
at android.support.graphics.drawable.VectorDrawableCompat.inflate(VectorDrawableCompat.java:654)
at android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner(VectorDrawableCompat.java:617)
at android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:745)
at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:365)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81)
at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:127)
at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:147)
at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:27)
at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:53)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:525)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:74)
at com.asmgx.schlogger.app.MainActivity.onCreate(MainActivity.java:78)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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)
01-23 03:02:29.964 9105-9105/? D/AndroidRuntime: Shutting down VM
01-23 03:02:29.964 9105-9105/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x9cd52b20)
01-23 03:02:29.974 9105-9105/? D/dalvikvm: GC_FOR_ALLOC freed 365K, 12% free 3858K/4380K, paused 3ms, total 3ms
01-23 03:02:29.974 9105-9105/? E/UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.asmgx.schlogger.app/com.asmgx.schlogger.app.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020054
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020054
at android.content.res.Resources.loadDrawable(Resources.java:2101)
at android.content.res.Resources.getDrawable(Resources.java:700)
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:200)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81)
at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:127)
at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:147)
at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:27)
at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:53)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:525)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:74)
at com.asmgx.schlogger.app.MainActivity.onCreate(MainActivity.java:78)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
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) 
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
at android.content.res.Resources.loadDrawable(Resources.java:2097)
at android.content.res.Resources.getDrawable(Resources.java:700) 
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374) 
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:200) 
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188) 
at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723) 
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193) 
at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81) 
at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:127) 
at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:147) 
at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:27) 
at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:53) 
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205) 
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185) 
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:525) 
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:74) 
at com.asmgx.schlogger.app.MainActivity.onCreate(MainActivity.java:78) 
at android.app.Activity.performCreate(Activity.java:5231) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
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) 
01-23 03:02:29.974 9105-9130/? I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:3 and remote module com.google.android.gms.tagmanager:8
01-23 03:02:29.974 9105-9130/? I/DynamiteModule: Selected remote version of com.google.android.gms.tagmanager, version >= 8
01-23 03:02:30.074 9105-9130/? W/GoogleTagManager: No container asset found in /assets/containers. Checking top level /assets directory for container assets.
01-23 03:02:30.194 9105-9130/? W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
01-23 03:02:30.194 9105-9130/? I/GoogleTagManager: Tag Manager initilization took 218ms
01-23 03:02:30.194 9105-9130/? D/FA: Logging event (FE): _ae, Bundle[{_o=crash, timestamp=1485158549979, fatal=1}]
01-23 03:02:30.194 9105-9130/com.asmgx.schlogger.app V/FA: Using measurement service
01-23 03:02:30.204 9105-9130/com.asmgx.schlogger.app V/FA: Connection attempt already in progress
01-23 03:02:30.234 9105-9131/com.asmgx.schlogger.app D/dalvikvm: GC_FOR_ALLOC freed 454K, 14% free 3914K/4528K, paused 7ms, total 10ms
01-23 03:02:30.294 9105-9105/com.asmgx.schlogger.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.asmgx.schlogger.app, PID: 9105
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.asmgx.schlogger.app/com.asmgx.schlogger.app.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020054
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020054
at android.content.res.Resources.loadDrawable(Resources.java:2101)
at android.content.res.Resources.getDrawable(Resources.java:700)
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:200)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81)
at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:127)
at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:147)
at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:27)
at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:53)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:525)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:74)
at com.asmgx.schlogger.app.MainActivity.onCreate(MainActivity.java:78)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
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) 
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
Try to use this
STEP 1:
Go to your dependency and add this line
compile 'com.android.support:multidex:1.0.1'
and in the defaultConfig Section add this
defaultConfig {
minSdkVersion xx
targetSdkVersion xx
versionCode x
multiDexEnabled true
}
Then
Create a class called e.g MyApp.java
public class MyApp extends Application{
#Override
public void onCreate() {
super.onCreate();
}
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
STEP :2
Go to your manifest and do the following in the Application Tag
<application
android:name="MyApp"
.
.
.
in your gradle, set
multiDexEnabled true
and in Application class:
Extend Application class with MultiDexApplication
#Override
protected void attachBaseContext(Context base) {
MultiDex.install(this);
super.attachBaseContext(base);
}
because MultiDexApplication has not been extended so that it can't include gms and any other dex classes so it's giving error at starting of gms String.
You can refer here for more information on how to use multidex :
https://developer.android.com/studio/build/multidex.html

Reminders app tutorial, app does not load, issue with java file

I am learning Android Studio from a book called "Learn Android Studio: Build Android Apps Quickly and Effectively" By: Clifton Craig; Adam Gerber. I am following a tutorial on how to build a Reminders app and can't get the app to load. In the tutorial, I have been instructed to alter the onCreate() method with what is provided in the book, making sure to import what they provided.
The altered code is provided here.
The logcat is provided below:
01-18 06:04:55.460 2212-2212/com.apress.gerber.reminders I/art: Not late-enabling -Xcheck:jni (already on)
01-18 06:04:55.800 2212-2212/com.apress.gerber.reminders W/System: ClassLoader referenced unknown path: /data/app/com.apress.gerber.reminders-2/lib/x86_64
01-18 06:04:55.960 2212-2212/com.apress.gerber.reminders D/AndroidRuntime: Shutting down VM
01-18 06:04:55.960 2212-2212/com.apress.gerber.reminders E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.apress.gerber.reminders, PID: 2212
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.apress.gerber.reminders/com.apress.gerber.reminders.RemindersActivity}: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.ListView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.ListView
at com.apress.gerber.reminders.RemindersActivity.onCreate(RemindersActivity.java:22)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
01-18 06:05:00.980 2212-2212/com.apress.gerber.reminders I/Process: Sending signal. PID: 2212 SIG: 9
The app will not load. The emulator gives an error. Any feedback on this would be greatly appreciated.

ViewPagerIndicator library doesn't work in 4.4

I am using viewpagerindicator library for circle indicator and it works great on 5.0(Lolipop), 6.0(Marshmallow) but it crashes on 4.4(Kitkat).I've tried using dependency based on module by adding library project and using following option but none of them works on 4.4
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1'
Here's the log.
2-29 18:27:22.992 32182-32182/com.kicksexchange D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0177
12-29 18:27:22.992 32182-32182/com.kicksexchange I/dalvikvm﹕ Could not find method com.viewpagerindicator.CirclePageIndicator.setViewPager, referenced from method com.kicksexchange.fragments.ProductDetail.updateUI
12-29 18:27:23.002 32182-32182/com.kicksexchange W/dalvikvm﹕ VFY: unable to resolve virtual method 62723: Lcom/viewpagerindicator/CirclePageIndicator;.setViewPager (Landroid/support/v4/view/ViewPager;)V
12-29 18:27:23.002 32182-32182/com.kicksexchange D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0271
12-29 18:27:23.072 32182-32182/com.kicksexchange D/ProductDetail﹕ onCreate Product Detail Fragment
12-29 18:27:23.072 32182-32182/com.kicksexchange D/ProductDetail﹕ 205
12-29 18:27:23.072 32182-32182/com.kicksexchange D/ProductDetail﹕ Nike Sports Shoes
12-29 18:27:23.192 32182-32182/com.kicksexchange D/AndroidRuntime﹕ Shutting down VM
12-29 18:27:23.192 32182-32182/com.kicksexchange W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x42046d58)
12-29 18:27:23.242 32182-32182/com.kicksexchange E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.kicksexchange, PID: 32182
android.view.InflateException: Binary XML file line #122: Error inflating class com.viewpagerindicator.CirclePageIndicator
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.kicksexchange.fragments.ProductDetail.onCreateView(ProductDetail.java:152)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5050)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.viewpagerindicator.CirclePageIndicator" on path: DexPathList[[zip file "/data/app/com.kicksexchange-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.kicksexchange-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.kicksexchange.fragments.ProductDetail.onCreateView(ProductDetail.java:152)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5050)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)

Android Studio Emulation on Mac OS X - InflateException: Binary XML (MapBox)

This is a really specific issue, so it may be hard to diagnose.
I have an Android app that is working on an Android phone and is emulated correctly on a Windows 8.1 x86 emulator (via Android Studio), but when I run it in an x86 emulator on my Mac (OS X 10.11.1), it runs until I try to inflate the activity with the MapBox map.
To summarize, this is what works / what I've done:
Works on Windows 8.1 Android Studio Emulator
Works on an Android 5.1 Moto X
My Mac has the Intel x86 Emulator Accelerator (HAXM) installed
I am running an x86 Emulator via Android Studio for Mac
This error occurs just when inflating the MapBox activity:
10-30 12:16:03.848 4557-4557/? I/art: Not late-enabling -Xcheck:jni (already on)
10-30 12:16:03.848 4557-4557/? I/art: Late-enabling JIT
10-30 12:16:03.852 4557-4557/? I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
10-30 12:16:05.276 4557-4611/com.example.example.thisapp I/GMPM: App measurement is starting up
10-30 12:16:05.278 4557-4611/com.example.example.thisapp E/GMPM: getGoogleAppId failed with status: 10
10-30 12:16:05.279 4557-4611/com.example.example.thisapp E/GMPM: Uploading is not possible. App measurement disabled
10-30 12:16:05.336 4557-4573/com.example.example.thisapp W/art: Suspending all threads took: 19.618ms
10-30 12:16:05.522 4557-4626/com.example.example.thisapp D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-30 12:16:05.528 4557-4557/com.example.example.thisapp D/: HostConnection::get() New Host Connection established 0xb401ca30, tid 4557
10-30 12:16:05.632 4557-4626/com.example.example.thisapp D/: HostConnection::get() New Host Connection established 0xaf8be1e0, tid 4626
10-30 12:16:05.658 4557-4626/com.example.example.thisapp I/OpenGLRenderer: Initialized EGL, version 1.4
10-30 12:16:05.693 4557-4626/com.example.example.thisapp W/EGL_emulation: eglSurfaceAttrib not implemented
10-30 12:16:05.693 4557-4626/com.example.example.thisapp W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xabe3a540, error=EGL_SUCCESS
10-30 12:16:11.189 4557-4557/com.example.example.thisapp D/AndroidRuntime: Shutting down VM
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: FATAL EXCEPTION: main
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: Process: com.example.example.thisapp, PID: 4557
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.example.thisapp/com.example.example.thisapp.MapsActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class com.mapbox.mapboxsdk.views.MapView
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class com.mapbox.mapboxsdk.views.MapView
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Activity.setContentView(Activity.java:2166)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.example.example.thisapp.MapsActivity.onCreate(MapsActivity.java:79)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6237)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class com.mapbox.mapboxsdk.views.MapView
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:645)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Activity.setContentView(Activity.java:2166)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.example.example.thisapp.MapsActivity.onCreate(MapsActivity.java:79)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6237)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Native Method)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:619)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Activity.setContentView(Activity.java:2166)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.example.example.thisapp.MapsActivity.onCreate(MapsActivity.java:79)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6237)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.example.example.thisapp-2/lib/x86/libmapbox-gl.so: has text relocations
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.Runtime.loadLibrary(Runtime.java:372)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.System.loadLibrary(System.java:1076)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.mapbox.mapboxsdk.views.NativeMapView.<clinit>(NativeMapView.java:37)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.mapbox.mapboxsdk.views.MapView.initialize(MapView.java:593)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.mapbox.mapboxsdk.views.MapView.<init>(MapView.java:538)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Native Method)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:619)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Activity.setContentView(Activity.java:2166)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.example.example.thisapp.MapsActivity.onCreate(MapsActivity.java:79)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6237)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-30 12:16:11.199 4557-4557/com.example.example.thisapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-30 12:16:11.360 4557-4573/com.example.example.thisapp W/art: Suspending all threads took: 37.146ms
10-30 12:16:11.372 4557-4577/com.example.example.thisapp I/art: Background sticky concurrent mark sweep GC freed 9470(718KB) AllocSpace objects, 4(80KB) LOS objects, 48% free, 1890KB/3MB, paused 4.151ms total 202.120ms
10-30 12:16:11.407 4557-4577/com.example.example.thisapp W/art: Suspending all threads took: 34.815ms
The other InflateException / Binary XML error answers I've seen haven't worked or are not applicable.

Contacts List Read Permission Error in Android

As you can tell I am a newbie to Android :) and struggling with retrieving contacts list. I did add android.permission.READ_CONTACTS in AndroidManifest.xml but still it is not working. I am running it on Windows 10, in case if that makes any difference. Thanks in advance.
09-07 17:27:15.819 5272-5272/? I/art﹕ Not late-enabling -Xcheck:jni (already on)
09-07 17:27:15.819 5272-5272/? I/art﹕ Late-enabling JIT
09-07 17:27:15.821 5272-5272/? I/art﹕ JIT created with code_cache_capacity=2MB compile_threshold=1000
09-07 17:27:15.871 5272-5272/com.sr.phonecontactslist W/System﹕ ClassLoader referenced unknown path: /data/app/com.sr.phonecontactslist-1/lib/x86
09-07 17:27:15.879 5272-5272/com.sr.phonecontactslist D/AndroidRuntime﹕ Shutting down VM
09-07 17:27:15.879 5272-5272/com.sr.phonecontactslist E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.sr.phonecontactslist, PID: 5272
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sr.phonecontactslist/com.sr.phonecontactslist.MainActivity}: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{15540fd 5272:com.sr.phonecontactslist/u0a59} (pid=5272, uid=10059) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{15540fd 5272:com.sr.phonecontactslist/u0a59} (pid=5272, uid=10059) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
at android.os.Parcel.readException(Parcel.java:1599)
at android.os.Parcel.readException(Parcel.java:1552)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3550)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:4778)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1468)
at android.content.ContentResolver.query(ContentResolver.java:475)
at android.content.ContentResolver.query(ContentResolver.java:434)
at com.sr.phonecontactslist.MainActivity.onCreate(MainActivity.java:20)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
            at android.app.ActivityThread.-wrap11(ActivityThread.java)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:148)
            at android.app.ActivityThread.main(ActivityThread.java:5417)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Categories

Resources