java - App stopped after first launch, but no errors -


hello, lot time re according issue.

i trying run app in android studio , builds fine 0 errors, app icon showing on device(i tried on different devices , emulators btw) when launches, crashes after few seconds, saying "my app" has stopped. tried view logcat errors , didnt understand problem.

here logcat error file, , tell me if need other information problem please.

    03-28 19:20:23.382 13915-13921/? e/jdwp: failed sending reply debugger: broken pipe 03-28 19:20:23.532 13915-13929/? e/dalvikvm: not find class 'android.app.appopsmanager', referenced method com.google.android.gms.internal.zzadf.zzg 03-28 19:20:23.762 13915-13915/? e/dalvikvm: not find class 'android.graphics.drawable.rippledrawable', referenced method android.support.v7.widget.appcompatimagehelper.hasoverlappingrendering 03-28 19:20:23.782 13915-13915/? e/onesignal: onesignal appid format invalid.                                               example: 'b2f7f966-d8cc-11e4-bed1-df8f05be55ba'                                                java.lang.numberformatexception: invalid long: "xxxxxxxx"                                                   @ java.lang.long.invalidlong(long.java:125)                                                   @ java.lang.long.parse(long.java:362)                                                   @ java.lang.long.parselong(long.java:353)                                                   @ java.util.uuid.fromstring(uuid.java:201)                                                   @ com.onesignal.osutils.initializationchecker(osutils.java:52)                                                   @ com.onesignal.onesignal.init(onesignal.java:238)                                                   @ com.onesignal.onesignal.init(onesignal.java:215)                                                   @ com.onesignal.onesignal.access$000(onesignal.java:68)                                                   @ com.onesignal.onesignal$builder.init(onesignal.java:142)                                                   @ com.mp3player.searchonline.mainactivity.oncreate(mainactivity.java:65)                                                   @ android.app.activity.performcreate(activity.java:5326)                                                   @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1097)                                                   @ android.app.activitythread.performlaunchactivity(activitythread.java:2218)                                                   @ android.app.activitythread.handlelaunchactivity(activitythread.java:2309)                                                   @ android.app.activitythread.access$700(activitythread.java:157)                                                   @ android.app.activitythread$h.handlemessage(activitythread.java:1289)                                                   @ android.os.handler.dispatchmessage(handler.java:99)                                                   @ android.os.looper.loop(looper.java:176)                                                   @ android.app.activitythread.main(activitythread.java:5317)                                                   @ java.lang.reflect.method.invokenative(native method)                                                   @ java.lang.reflect.method.invoke(method.java:511)                                                   @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1102)                                                   @ com.android.internal.os.zygoteinit.main(zygoteinit.java:869)                                                   @ dalvik.system.nativestart.main(native method) 03-28 19:20:27.816 13915-13915/com.usmans.songscloud e/androidruntime: fatal exception: main                                                                        java.lang.noclassdeffounderror: android.support.v7.internal.widget.tintmanager                                                                            @ android.support.design.widget.tablayout$tabview.<init>(tablayout.java:1041)                                                                            @ android.support.design.widget.tablayout.createtabview(tablayout.java:582)                                                                            @ android.support.design.widget.tablayout.addtabview(tablayout.java:616)                                                                            @ android.support.design.widget.tablayout.addtab(tablayout.java:334)                                                                            @ android.support.design.widget.tablayout.addtab(tablayout.java:309)                                                                            @ android.support.design.widget.tablayout.settabsfrompageradapter(tablayout.java:571)                                                                            @ android.support.design.widget.tablayout.setupwithviewpager(tablayout.java:550)                                                                            @ com.mp3player.searchonline.mainactivity.setview(mainactivity.java:93)                                                                            @ com.mp3player.searchonline.mainactivity.oncreate(mainactivity.java:86)                                                                            @ android.app.activity.performcreate(activity.java:5326)                                                                            @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1097)                                                                            @ android.app.activitythread.performlaunchactivity(activitythread.java:2218)                                                                            @ android.app.activitythread.handlelaunchactivity(activitythread.java:2309)                                                                            @ android.app.activitythread.access$700(activitythread.java:157)                                                                            @ android.app.activitythread$h.handlemessage(activitythread.java:1289)                                                                            @ android.os.handler.dispatchmessage(handler.java:99)                                                                            @ android.os.looper.loop(looper.java:176)                                                                            @ android.app.activitythread.main(activitythread.java:5317)                                                                            @ java.lang.reflect.method.invokenative(native method)                                                                            @ java.lang.reflect.method.invoke(method.java:511)                                                                            @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1102)                                                                            @ com.android.internal.os.zygoteinit.main(zygoteinit.java:869)                                                                            @ dalvik.system.nativestart.main(native method) 

manifest file

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.mp3player.searchonline" >      <uses-sdk         android:minsdkversion="9"         android:targetsdkversion="21" />      <uses-permission android:name="android.permission.internet" />     <uses-permission android:name="android.permission.access_network_state" />     <uses-permission android:name="android.permission.write_external_storage" />     <uses-permission android:name="android.permission.write_settings" />     <uses-permission android:name="android.permission.wake_lock"/>      <uses-permission android:name="android.permission.read_phone_state" />     <uses-permission android:name="android.permission.read_external_storage" />      <application         android:allowbackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:theme="@style/mymaterialtheme"         android:name="com.mp3player.searchonline.app" >         <!--this meta-data tag required use google play services.-->         <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />         <activity             android:name="com.google.android.gms.ads.adactivity"             android:configchanges="keyboard|keyboardhidden|orientation|screenlayout|uimode|screensize|smallestscreensize"/>         <activity             android:name="com.mp3player.searchonline.mainactivity"             android:label="@string/app_name"             android:windowsoftinputmode="adjustnothing" >             <intent-filter>                 <action android:name="android.intent.action.main" />                  <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>         <activity             android:name="com.mp3player.searchonline.playeractivity"             android:label="@string/app_name"             android:theme="@style/mydialogtheme" >             </activity>     </application>  </manifest> 

mainactivity.java

package com.mp3player.searchonline; /**  * created usman jamil on 02/02/2017.  * usmans.net  * skype usman.jamil78  * email usmanjamil547@gmail.com  */ import android.app.progressdialog; import android.content.dialoginterface; import android.content.intent; import android.content.sharedpreferences; import android.net.uri; import android.os.bundle; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.tablayout; import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.support.v4.view.viewpager; import android.support.v4.widget.cursoradapter; import android.support.v4.widget.simplecursoradapter; import android.support.v7.app.alertdialog; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.searchview; import android.support.v7.widget.toolbar; import android.support.design.widget.snackbar; import com.onesignal.onesignal; import java.util.arraylist; import java.util.list;  import android.support.design.widget.coordinatorlayout; import android.view.keyevent; import android.view.menuitem; import android.view.view;  public class mainactivity extends appcompatactivity implements constants  {      private toolbar toolbar;     private tablayout tablayout;     private viewpager viewpager;     private coordinatorlayout coordinatorlayout;     private searchview msearchview;     private menuitem searchmenuitem;     string[] final_suggestions=null;     private simplecursoradapter madapter;         string searchtext=null;     songfragment fragment;     progressdialog pdialog;     string tabfragmentb;     boolean = false;     floatingactionbutton sharebutton;     string urs;     sharedpreferences sharedpreferences;      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_main);         coordinatorlayout = (coordinatorlayout) findviewbyid(r.id                 .coordinatorlayout);         toolbar = (toolbar) findviewbyid(r.id.toolbar);         setsupportactionbar(toolbar);         viewpager = (viewpager) findviewbyid(r.id.viewpager);         int id = viewpager.getcurrentitem();         onesignal.startinit(this).init();          getsupportactionbar().setdisplayhomeasupenabled(false);          sharebutton = (floatingactionbutton) findviewbyid(r.id.fav);         sharebutton.setonclicklistener(new view.onclicklistener() {             public void onclick(view v) {             onshare();             }         });          final string[] = new string[] {"cityname"};         final int[] = new int[] {android.r.id.text1};         madapter = new simplecursoradapter(this,                 android.r.layout.simple_list_item_1,                 null,                 from,                 to,                 cursoradapter.flag_register_content_observer);     snackbar snackbar = snackbar .make(coordinatorlayout, getstring(r.string.welcomemsg), snackbar.length_long);     songfragment toy1 = (songfragment) getsupportfragmentmanager().findfragmentbytag(                 "android:switcher:" + viewpager.getid() + ":" + 0);         setview();         snackbar.show();     }     public void setview(){        sharebutton.setvisibility(view.visible);         setupviewpager(viewpager);         tablayout = (tablayout) findviewbyid(r.id.tabs);         tablayout.setupwithviewpager(viewpager);     }      private void setupviewpager(viewpager viewpager) {         viewpageradapter adapter = new viewpageradapter(getsupportfragmentmanager());         adapter.addfragment(new songfragment(), "search");             adapter.addfragment(new downloadfragment(), "downloaded");         viewpager.setadapter(adapter);     }       class viewpageradapter extends fragmentpageradapter {         private final list<fragment> mfragmentlist = new arraylist<>();         private final list<string> mfragmenttitlelist = new arraylist<>();          public viewpageradapter(fragmentmanager manager) {             super(manager);         }          @override         public fragment getitem(int position) {             return mfragmentlist.get(position);         }          @override         public int getcount() {             return mfragmentlist.size();         }          public void addfragment(fragment fragment, string title) {             mfragmentlist.add(fragment);             mfragmenttitlelist.add(title);         }          @override         public charsequence getpagetitle(int position) {             return mfragmenttitlelist.get(position);         }     }     public fragment getactivefragment() {         if (getsupportfragmentmanager().getbackstackentrycount() == 0) {             return null;         }         string tag = getsupportfragmentmanager().getbackstackentryat(getsupportfragmentmanager().getbackstackentrycount() - 1).getname();         return getsupportfragmentmanager().findfragmentbytag(tag);       }     @override     public boolean onkeydown(int paramint, keyevent paramkeyevent) {         if ((paramint == 4) && (paramkeyevent.getrepeatcount() == 0)) {           onexit();         }         return super.onkeydown(paramint, paramkeyevent);     }      public void onexit() {         alertdialog.builder localbuilder = new alertdialog.builder(this);         localbuilder.settitle("rate us");         localbuilder                 .setmessage(getstring(r.string.rating)).setneutralbutton("rate",                         new dialoginterface.onclicklistener() {                             @override                             public void onclick(                                     dialoginterface paramanonymousdialoginterface,                                     int paramanonymousint) {                                 mainactivity.this.ratee(mainactivity.this                                         .getapplicationcontext()                                         .getpackagename());                             }                         })                 .setnegativebutton("no", new dialoginterface.onclicklistener() {                     @override                     public void onclick(                             dialoginterface paramanonymousdialoginterface,                             int paramanonymousint) {                          paramanonymousdialoginterface.dismiss();                         mainactivity.this.finish();                      }                 });         localbuilder.show();     }     public void onshare() {         alertdialog.builder localbuilder = new alertdialog.builder(this);         localbuilder.settitle("share");         localbuilder                 .setmessage(getstring(r.string.share)).setneutralbutton("share",                 new dialoginterface.onclicklistener() {                     @override                     public void onclick(                             dialoginterface paramanonymousdialoginterface,                             int paramanonymousint) {                         mainactivity.this.share(getstring(r.string.sharemsg)+mainactivity.this                                 .getapplicationcontext()                                 .getpackagename());                     }                 })                 .setnegativebutton("no", new dialoginterface.onclicklistener() {                     @override                     public void onclick(                             dialoginterface paramanonymousdialoginterface,                             int paramanonymousint) {                         paramanonymousdialoginterface.dismiss();                     }                 });         localbuilder.show();     }      public void ratee(string paramstring) {         try {             intent localintent = new intent("android.intent.action.view");             localintent                     .setdata(uri.parse("market://details?id=" + paramstring));             startactivity(localintent);             return;         } catch (exception localexception) {          }     }     public void share(string paramstring) {     try {             intent sendintent = new intent();         sendintent.setaction(intent.action_send);         sendintent.putextra(intent.extra_text,paramstring);         sendintent.settype("text/plain");         startactivity(sendintent);             return;         } catch (exception localexception) {          }      }      @override     protected void onpause() {         super.onpause();     }      @override     protected void onresume() {         super.onresume();     }      @override     protected void ondestroy() {         super.ondestroy();     }   } 

build.gradle

apply plugin: 'com.android.application'  android {     compilesdkversion 25     buildtoolsversion '25.0.0'      defaultconfig {         applicationid "com.usmans.songscloud"         minsdkversion 14         targetsdkversion 25         versioncode 1         versionname "1.0"         manifestplaceholders = [onesignal_app_id: "xxxxxxxx-e269-4dfb-8b48-357b707acdae",                                 // project number pulled dashboard, local value ignored.                                 onesignal_google_project_number: "108880509xxxx"]         uselibrary 'org.apache.http.legacy'     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     } } repositories {     maven {         url 'https://dl.bintray.com/ayz4sci/maven/'     } }  dependencies {     compile filetree(include: ['*.jar'], dir: 'libs')     compile 'com.android.support:appcompat-v7:25.0.0'     compile 'com.android.support:design:22.2.0'     compile 'com.cjj.materialrefeshlayout:library:1.3.0'     compile 'com.squareup.picasso:picasso:2.5.2'     compile 'com.ayz4sci.androidfactory:downloadprogress:1.0.1'     compile 'com.android.support:support-v4:25.0.0'     // required onesignal, if have added fcm.     compile 'com.google.android.gms:play-services-gcm:+'     // required geotagging     compile 'com.google.android.gms:play-services-location:+'     compile 'com.google.android.gms:play-services-analytics:+'     // play-services-analytics needed when using 8.1.0 or older.     // compile 'com.google.android.gms:play-services-analytics:+'     compile 'com.google.android.gms:play-services-ads:10.2.1'     compile 'com.onesignal:onesignal:3.4.3' } 

a khay mehdi :) had soungcloud rah dima fih machakil ila badalti sdk kon khalitiha 22 aykhdam


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -