Just importing Facebook SDK crashes my android app, it was working fine but it start to crash, I comment every section uses facebook SDK it still crash
I use facebook sdk version "4.24.0"
07-05 12:50:30.309 10354-10412/andrewhossam.cuju_android E/art: No implementation found for long com.android.tools.profiler.support.network.HttpTracker$Connection.nextId() (tried Java_com_android_tools_profiler_support_network_HttpTracker_00024Connection_nextId and Java_com_android_tools_profiler_support_network_HttpTracker_00024Connection_nextId__)
--------- beginning of crash
07-05 12:50:30.310 10354-10412/andrewhossam.cuju_android E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: andrewhossam.cuju_android, PID: 10354
java.lang.UnsatisfiedLinkError: No implementation found for long com.android.tools.profiler.support.network.HttpTracker$Connection.nextId() (tried Java_com_android_tools_profiler_support_network_HttpTracker_00024Connection_nextId and Java_com_android_tools_profiler_support_network_HttpTracker_00024Connection_nextId__)
at com.android.tools.profiler.support.network.HttpTracker$Connection.nextId(Native Method)
at com.android.tools.profiler.support.network.HttpTracker$Connection.<init>(HttpTracker.java:191)
at com.android.tools.profiler.support.network.HttpTracker$Connection.<init>(HttpTracker.java:186)
at com.android.tools.profiler.support.network.HttpTracker.trackConnection(HttpTracker.java:280)
at com.android.tools.profiler.support.network.httpurl.HttpsURLConnection$.<init>(HttpsURLConnection$.java:55)
at com.android.tools.profiler.support.network.httpurl.HttpURLWrapper.wrapURLConnectionHelper(HttpURLWrapper.java:40)
at com.android.tools.profiler.support.network.httpurl.HttpURLWrapper.wrapURLConnection(HttpURLWrapper.java:55)
at com.facebook.GraphRequest.createConnection(GraphRequest.java:1410)
at com.facebook.GraphRequest.toHttpConnection(GraphRequest.java:1070)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1158)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1134)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1118)
at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1093)
at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:987)
at com.facebook.internal.FetchedAppSettingsManager.getAppSettingsQueryResponse(FetchedAppSettingsManager.java:207)
at com.facebook.internal.FetchedAppSettingsManager.access$100(FetchedAppSettingsManager.java:47)
at com.facebook.internal.FetchedAppSettingsManager$1.run(FetchedAppSettingsManager.java:122)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
07-05 12:50:30.311 1104-1960/? E/ActivityManager: App crashed! Process: andrewhossam.cuju_android
Uncheck "Enable advanced profiling" in Run->Edit Config->profiling tab
after search for days i found it !
add this to your manifest file :
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
Related
I am trying to get an Android Things project to build and run on a Raspberry Pi 3. The files are found here. I am connected to my Raspberry Pi 3 via Ethernet. I plugged the ethernet cable directly from my laptop to the rPi and used Internet Sharing. I then used adb connect to connect to the device and it successfully connects.
I am running:
Android Studio 3.1.2
Build #AI-173.4720617, built on April 13, 2018
JRE: 1.8.0_152-release-1024-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6
Changes were made to Android Studio so I had to change some code around. I downloaded the files and updated the PeripheralManagerService to PeripheralManager instead.
PeripheralManager pioService = PeripheralManager.getInstance();
When I click the Run button, I get the following error (please keep in mind that I already added the following permission to Android Manifest file above the application section):
<uses-permission android:name="com.google.android.things.permission.USE_PERIPHERAL_IO"/>
Please help me with figure out what I am still missing. Thanks!
06-08 01:43:28.746 3598-3598/? I/zygote: Late-enabling -Xcheck:jni 06-08 01:43:28.993 3598-3598/apps.hackstermia.buttonthings I/MainActivity: Starting ButtonActivity
06-08 01:43:29.013 3598-3598/apps.hackstermia.buttonthings I/MainActivity: Configuring GPIO pins
06-08 01:43:29.017 3598-3598/apps.hackstermia.buttonthings D/AndroidRuntime: Shutting down VM
06-08 01:43:29.028 3598-3598/apps.hackstermia.buttonthings E/AndroidRuntime: FATAL EXCEPTION: main
Process: apps.hackstermia.buttonthings, PID: 3598
java.lang.RuntimeException: Unable to start activity ComponentInfo{apps.hackstermia.buttonthings/apps.hackstermia.buttonthings.MainActivity}: java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.USE_PERIPHERAL_IO
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.USE_PERIPHERAL_IO
at android.os.Parcel.readException(Parcel.java:2005)
at android.os.Parcel.readException(Parcel.java:1951)
at com.google.android.things.pio.IPeripheralManagerClient$Stub$Proxy.GetGpioClient(IPeripheralManagerClient.java:759)
at com.google.android.things.pio.GpioImpl.<init>(GpioImpl.java:50)
at com.google.android.things.pio.PeripheralManager.openGpio(PeripheralManager.java:197)
at apps.hackstermia.buttonthings.MainActivity.onCreate(MainActivity.java:26)
at android.app.Activity.performCreate(Activity.java:7010)
at android.app.Activity.performCreate(Activity.java:7001)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
06-08 01:43:29.047 3598-3598/apps.hackstermia.buttonthings I/Process: Sending signal. PID: 3598 SIG: 9
At first, following lines should be included by AndroidManifest just before application tag
<uses-permission android:name="com.google.android.things.permission.USE_PERIPHERAL_IO" />
<uses-permission android:name="com.google.android.things.permission.MANAGE_INPUT_DRIVERS" />
Then, if you install application via adb, you should install <APK> with -g option as follow as recomended by #Devunwired here
adb install -g <APK>
friends~!
I had the same problem with my Android Studio 3.1.3 and RaspberryPi 3 and AndroidThings. This platform was killing my "blink" app, because I had a lacks permission of "[..] USE_PERIPHERAL_IO".
For my problem, the solution was adding this sentence:
<uses-permission android:name="com.google.android.things.permission.USE_PERIPHERAL_IO"/>
<uses-permission android:name="com.google.android.things.permission.MANAGE_INPUT_DRIVERS" />
to my Android Manifest file.
Thanks, anyone for help :))
Thanks for your input everyone.
I found out that the permission in the manifest file needs to be a direct child, or outside of the application
I had the same issue. Tried different approaches as mentioned above. What really works for me
1. update your android studio to the latest version. Mine was 3.0.1. After upgrade, it is 3.1.3
2. update the os version of android things to the latest. It was 0.6. After upgrade, it is 1.0.1.
3. Set those permission in android manifest
<uses-permission android:name="com.google.android.things.permission.USE_PERIPHERAL_IO"/>
<uses-permission android:name="com.google.android.things.permission.MANAGE_INPUT_DRIVERS" />
hope those steps will make your android things working
Depending on the version of Android Studio, the prisons are applied and granted on upgrades and installs or only on installs (on older versions)
Rebooting the device should fix it, uninstalling and reinstalling the app should also fix it.
I am trying to use Chrome Custom Tabs in my Android application. My MainActivity class extends AppCompatActivity. In onCreate, I invoke startCustomTabs. Below is the code for that:
private void startCustomTab(){
CustomTabsIntent intent = new CustomTabsIntent.Builder().setToolbarColor(getResources().getColor(R.color.colorPrimary)).build();
intent.launchUrl(this, Uri.parse("http://github.com/black-dragon/SaavnExtractor"));
}
As soon as the app launches, it crashes with following the error:
11-16 10:55:38.561 30093-30093/com.nick.saavnextractor
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nick.saavnextractor, PID: 30093
java.lang.NoSuchMethodError: No static method
startActivity(Landroid/app/Activity;Landroid/content/Intent;Landroid/os/Bundle;)V
in class Landroid/support/v4/app/ActivityCompat; or its super classes
(declaration of 'android.support.v4.app.ActivityCompat' appears in
/data/data/com.nick.saavnextractor/files/instant-run/dex/slice-com.android.support-support-compat-25.0.0_15c83dd4ec129d2d74bfda2e34f6aeeb93d83fa1-classes.dex)
at android.support.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:262)
at com.nick.saavnextractor.MainActivity.startCustomTab(MainActivity.java:325)
at com.nick.saavnextractor.MainActivity.onCreate(MainActivity.java:111)
at android.app.Activity.performCreate(Activity.java:6311)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2539)
at android.app.ActivityThread.access$900(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5507)
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)
Note: If I execute the same code with the same methods in a new app, the Custom Tabs launch fine.
Okay, so here is the resolution. I was using build tools version 25.0.0 but my SDK platform was 24.
Update the build tools, platform tools & SDK to same version and then you won't face this issue.
Along with #Nick's answer, I also had to update the Facebook SDK version and the crash stopped happening.
You need to add Customtabs dependency in your build.gradle file.
implementation 'com.android.support:customtabs:28.0.0'
I'm trying to modify this project from android studio 2 but when I try to run the app from Android 4.4.2 and connect to a bluetooth device, it gives these error messages.
06-02 14:51:30.126 12669-12669/com.example.ti.ble.sensortag E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.ti.ble.sensortag, PID: 12669
java.lang.IllegalArgumentException: null is not a valid Bluetooth address
at android.bluetooth.BluetoothDevice.<init>(BluetoothDevice.java:564)
at android.bluetooth.BluetoothAdapter.getRemoteDevice(BluetoothAdapter.java:418)
at com.example.ti.ble.common.BluetoothLeService.disconnect(BluetoothLeService.java:635)
at com.example.ti.ble.sensortag.MainActivity.onConnect(MainActivity.java:320)
at com.example.ti.ble.sensortag.MainActivity.onDeviceClick(MainActivity.java:379)
at com.example.ti.ble.sensortag.ScanView$1.onItemClick(ScanView.java:205)
at android.widget.AdapterView.performItemClick(AdapterView.java:299)
at android.widget.AbsListView.performItemClick(AbsListView.java:1152)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3014)
at android.widget.AbsListView$3.run(AbsListView.java:3865)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5341)
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:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
The project can be found here SensorTag20 Project. How do I fix these problems?
Turns out, I just needed to restart the device everytime I reprogram it.
UPDATE: A UI bug was preventing me from importing google-play-services_lib. I had to click immediately below the SDK list to be able to scroll to see the Library box. See the image in the accepted answer for more info.
I am using Android IDE to get a Hello World map app, which I have named Intactless2. The files are all named correctly, android-support-v4.jar in /libs, I have a valid API key, etc.
I followed Google's Android Maps guide, copying and pasting the Java and activity_main.xml verbatim:
https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2
I correctly added everything there to my manifest. I got an error on <meta-data android:name="com.google.android.gms.version"... 's value being incorrect, so I hardcoded the integer from the version.xml file so that it's android:value="4030500". Otherwise my manifest is unchanged.
I tried all of the solutions in the top Google hits for the error messages I'm getting and it still won't run. Normally, this would indicate an idiosyncratic bug that I haven't thought about that might even be unrelated to Google Play Services, but I rebuilt it exactly as Google's guide suggests and redid all of the recommendations in those posts and still can't use Google Play Services.
I am running a 4.4 emulator and 4.4 is the minimum version my project will build to. I have tried the following to be able to use google-play-services/google-play-services_lib in my app:
1) Made an Eclipse project for Google Play Services and added it to my project. Right-click on my project -> Properties -> Java Build Path -> Projects Add -> google-play-services_lib.
a) Checked google-play-services_lib in Order & Export
b) Unchecked oogle-play-services_lib in Order and Export
2) Copy-pasted google-play-services, google-play-services_lib, and google-play-services.properties from my Android SDK directory to my /libs directory in my project.
1) Properties -> Android -> Target Build Path -> Android 4.4
2) Properties -> Android -> Target Build Path -> Google APIs (the one directly below "Android 4.4)
That's a lot of combinations including the solutions people on StackOverflow have suggested.
Also, if I add <uses-library android:name="com.google.android.gms.maps" /> (or remove the gms as some guides advise) to my manifest, I get this LogCat error:
11-13 00:57:18.890: E/PackageManager(938): Package com.example.intactless2 requires unavailable shared library com.google.android.gms.maps; failing!
Importing google-play-services/google-play-services_lib as an Eclipse project:
Screenshot of google-play-services_lib Eclipse project: http://postimg.org/image/ukbqjk9lp/
Screenshot of my hello world Maps project in Package Explorer: http://postimg.org/image/589t2137h/
Console output:
...
[2013-11-12 21:57:13 - Intactless2] Installing Intactless2.apk...
[2013-11-12 21:57:19 - Intactless2] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2013-11-12 21:57:19 - Intactless2] Please check logcat output for more details.
[2013-11-12 21:57:19 - Intactless2] Launch canceled!
LogCat:
11-13 01:03:44.870: E/AndroidRuntime(1886): FATAL EXCEPTION: main
11-13 01:03:44.870: E/AndroidRuntime(1886): Process: com.example.intactless2, PID: 1886
11-13 01:03:44.870: E/AndroidRuntime(1886): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.intactless2/com.example.intactless2.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
11-13 01:03:44.870: E/AndroidRuntime(1886): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
11-13 01:03:44.870: E/AndroidRuntime(1886): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
11-13 01:03:44.870: E/AndroidRuntime(1886): at android.app.ActivityThread.access$700(ActivityThread.java:135)
...
Putting google-play-services.jar, google-play-services_lib.jar, and google-play-services.jar.properties directly into my project's /libs directory
Screenshot of my hello world Maps project in Package Explorer: http://postimg.org/image/l68z4crl7/
Console output:
...
[2013-11-12 22:15:20 - Intactless2] Uploading Intactless2.apk onto device 'emulator-5554'
[2013-11-12 22:15:20 - Intactless2] Installing Intactless2.apk...
[2013-11-12 22:15:37 - Intactless2] Success!
[2013-11-12 22:15:37 - Intactless2] Starting activity com.example.intactless2.MainActivity on device emulator-5554
[2013-11-12 22:15:41 - Intactless2] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.intactless2/.MainActivity }
LogCat:
11-13 01:15:43.990: E/AndroidRuntime(1959): FATAL EXCEPTION: main
11-13 01:15:43.990: E/AndroidRuntime(1959): Process: com.example.intactless2, PID: 1959
11-13 01:15:43.990: E/AndroidRuntime(1959): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
11-13 01:15:43.990: E/AndroidRuntime(1959): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
11-13 01:15:43.990: E/AndroidRuntime(1959): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
11-13 01:15:43.990: E/AndroidRuntime(1959): at android.app.Activity.onCreateView(Activity.java:4784)
11-13 01:15:43.990: E/AndroidRuntime(1959): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
11-13 01:15:43.990: E/AndroidRuntime(1959): at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
11-13 01:15:43.990: E/AndroidRuntime(1959): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
11-13 01:15:43.990: E/AndroidRuntime(1959): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
11-13 01:15:43.990: E/AndroidRuntime(1959): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
11-13 01:15:43.990: E/AndroidRuntime(1959): at android.app.Activity.setContentView(Activity.java:1928)
11-13 01:15:43.990: E/AndroidRuntime(1959): at com.example.intactless2.MainActivity.onCreate(MainActivity.java:11)
11-13 01:15:43.990: E/AndroidRuntime(1959): at android.app.Activity.performCreate(Activity.java:5243)
Thank you in advance! Any help is appreciated. :)
You mentioned you are using a 4.4 emulator - you need to use the Google APIs (Google Inc.) - API Level 19 emulator to test with Google Play Services.
I Think You have error in you XML file ,because in log-cat you are getting
Binary XML file line #2: Error inflating class fragment first you try to rectify it
My Activity extends from MapActivity, I have descried it correctly in the manifest, I have put the <uses-library> tag inside the <application> tag I am building with goole apis library and the maps.jar is there only one time(no duplicates) and the app runs and works perfect on most devices.
However I got a crash report with ClassDefNotFoundException which occurred on ZTE Blade device with Android 2.1. I am building with google apis 2.1
Does anyone have suggestions for that?
I am providing the stack trace too:
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:2165)
at android.view.View.performClick(View.java:2506)
at android.view.View$PerformClick.run(View.java:9112)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3835)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at android.view.View$1.onClick(View.java:2160)
... 11 more
Caused by: java.lang.NoClassDefFoundError: com.testing.asd.android.ui.InfoActivity
at com.testing.asd.android.ui.HomeScreen.onClick(HomeScreen.java:60)
... 14 more
com.testing.asd.android.ui.InfoActivity extends MapActivity. The problem is only on one device so far. I tested it on Android 2.3 and 4.2 and it is ok there.
I'm not sure if this is the case with the ZTE Blade, but there are some devices (such as the Kindle Fire) that don't have the Google APIs. I think these phones will show a NoClassDefFoundError if your app uses MapView.