I have some problem with facebook SKD. I get invalid app ID when I am trying to login. Can you please help me figure out what the problem is?
My facebook app looks like this:
Manifest:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.facebook.FacebookActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="70208723325****" />
</application>
In case anyone has this problem, I fixed it with not putting the appId value directly in the manifest file. Instead you should put it in strings and then in manifest you put
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
It's strange but it works for me.
1.Try to change the facebook status and review as yes.
2.Enter the Key hash value (Setting -> keyhash).
Related
I am launching my android app from android studio, the app is working fine but unable to launch it from the launcher as it is not showing up there. Looking at other posts it seems that this issue could be because of incorrect AndroidManifest.xml, but mine seems to fine based on other answers.
Below is AndroidManifest.xml from my project.
Full file is here -> https://pastebin.com/E7KMxQZD
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I am developing an android application using android studio, which has 2 activity so far, LoginActivity and the MainActivity, But when I run the application it installs in my cellphone or virtual machine, but does not appear anywhere. I looked into the installed application and the application is installed. I believe my problem is on the Manifest, but I do not know how to solve it.
The complete code is here on GitHub: https://github.com/SoftwareEngineeringClass/MobileApplication/tree/master/Minerva
and here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name=".Minerva"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/app_name" >
<itent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</itent-filter>
</activity>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
</application>
I believe the first thing I'd do is set a breakpoint at the beginning of the launcher Activity and see if execution gets there or not. No matter what Logcat will tell you something is wrong. You have to run it in debug mode of course. Attach the debugger. If you give me all your code I'd be more than happy to take a look and give you a definitive answer quickly.
Do you know if you require permissions? , maybe it is the problem that not allow you to run. Also if you can share your activity I can help you.
I have two android applications using google analytics. I setup it as instruction in this link:
https://developers.google.com/analytics/devguides/collection/android/v4/
But, when I install this two apps, I received error
INSTALL_FAILED_CONFLICTING_PROVIDER
I don't use provider with android:authorities
My application tag in manifest as below
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:name="android.support.multidex.MultiDexApplication">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<activity
android:name="com.game.gdx.android.AndroidLauncher"
android:label="#string/app_name"
android:screenOrientation="sensorLandscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.game.gdx.android.WebViewActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="sensorLandscape"
android:label="#string/app_name" />
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="#string/app_name" />
</application>
The authority that is listed in android:authorities must be unique. See this link for more info: http://developer.android.com/guide/topics/manifest/provider-element.html#auth
One last hing to check, make sure in both of your manifests you have same package name is defined. Use this same package name to get the google analytics configuration file.
<manifest package="com.your.program" ... >
After completing that make sure you uninstall your both apps and install again.
I have taken a picture of the Facebook instruction below. What is wrong with it? My app keeps crashing with exception concerning ApplicationId should not be null. But I have added my app id as <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/> in the manifest; that is after adding it as a string in the strings.xml resource as <string name="facebook_app_id">0000000000</string>
So I figure the instructions is wrong because it does not say which uses-permission to add and it says to call the string resource key com.facebook.sdk.ApplicationId with value Facebook_app_id. Here is the link https://developers.facebook.com/docs/android/getting-started#eclipse
Quite simply
1.) Create app on Facebook, get the app_id that you will subsequently use to attach to your app.
2.) Define your applicationId in the AndroidManifest.xml like this:
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/app_id"/>
under <application android:label="#string/app_name".... tag
where app_id is a string within your strings.xml.
Example (Facebook Sample application):
<application android:label="#string/app_name"
android:icon="#drawable/icon"
android:theme="#android:style/Theme.NoTitleBar"
>
<activity android:name=".HelloFacebookSampleActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.LoginActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="#string/app_name" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/app_id"/>
</application>
Note the value added under the <application> tag
and in strings.xml (MAKE SURE TO DO THIS)
<string name="app_id">xxxxxxxxxxxx</string>
3.) Set permissions in manifest
<uses-permission android:name="android.permission.INTERNET"/>
This is an android requirement, so the app can access the internet.
So with permissions the above manifest will look like
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="#string/app_name"
android:icon="#drawable/icon"
android:theme="#android:style/Theme.NoTitleBar"
>
<activity android:name=".HelloFacebookSampleActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.LoginActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="#string/app_name" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/app_id"/>
</application>
I had the same problem. And here is how I solved it — I think. At least after doing these things, the problem went away.
in strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
….
<string name="com.facebook.sdk.ApplicationId">facebook_app_id</string>
<string name="facebook_app_id">111111111</string>
….
</resources>
in manifest
<application
… >
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
</application>
</manifest>
Notice there are two entries in the strings.xml file.
I am trying to add a second activity to my android manifest file but am receiving a INSTALL_PARSE_FAILED_MANIFEST_MALFORMED error. I have isolated the offending code to this line:
<activity android:name="com.MyPackage.Main.FacebookLoginActivity"
android:label="Facebook"></activity>
When I type it in like this
<activity android:name=".FacebookLoginActivity"
android:label="Facebook"></activity>
it works fine but when I try to start the activity via
this.startActivity(new Intent(this, FacebookLoginActivity.class));
I get an error saying cannot locate "com.MyPackage.Main/com.MyPackage.Main.FacebookLoginActivity".
Is that activity wrong in some way?
Here a portion of my manifest file:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:allowBackup="true">
<activity
android:name=".MainActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:theme="#style/Theme.NoBackground">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.MyPackage.Main.FacebookLoginActivity" android:label="Facebook"></activity>
<activity android:name="com.facebook.LoginActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="#string/app_name" />
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
</application>
Try changing you package declaration to com.mypackage.main.
Your class name would be com.mypackage.main.FacebookLoginActivity