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.
Related
while I am using login with facebook I am getting this type of exception.please resolve my problem.
exeption is:FacebookActivity could not be started. Please make sure you added FacebookActivity to the AndroidManifest.
Just add this line in your AndroidManifest.xml file
<application
---------------------
your application themes & label
--------------------->
<activity android:name=".FacebookActivity"
android:label="#string/app_name"/>
</application
you need to add this line to your manifest file.
<activity>
...
</activity>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<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" />
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider1234"
android:exported="true" />
</application>
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 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).
Hi guys i'm trying to get my app (very basic atm) to include a FB login but I keep getting: invalid app id whenever I click my on my log in with facebook button. I've done the hash correctly (or so I believe and have registered with my fb dev account). Here is my mainfest: `
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.examples.sebastianshelley.jump" >
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/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.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>
</manifest>
And here's my strings.xml file with the app_id hash:
<resources>
<string name="app_name">Jump</string>
<string name="action_settings">Settings</string>
<string name="Facebook">Facebook</string>
<string name="app_id">KVjqf5zxlsetd9RzUzs0Xhw8WtE=</string>
<string name="title_activity_main_activity2">MainActivity2Activity</string>
<string name="facebookButton">Facebook</string>
</resources>
Anybody have any idea?
The app_id given by you is not valid one. App Id will be like this : 1234567890. I believe app_id mentioned by you is the Key_hash for your keystore.
You can read more here : https://developers.facebook.com/docs/android/getting-started
This question is related to the releasing the app to app store.
I am getting this error in commend line.
error= ERROR getting 'android:name' attribute: attribute is not an integer value
actually I am launching the app, but its showing the error in commend line.
Edit:
here is my Manifest.xml file code
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="17" />
<application
android:name="mobile.briltime.brilnet.SdkDemoLowLevelApp"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<activity android:label="#string/app_name"
android:name="mobile.briltime.brilnet.SplaseScreen"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="mobile.briltime.brilnet.MainActivity"
android:screenOrientation="portrait"></activity>
<activity android:name="mobile.briltime.brilnet.LoginManual"
android:screenOrientation="portrait"></activity>
<activity android:name="mobile.briltime.brilnet.AnimationStackedFrames"
android:screenOrientation="portrait"></activity>
<activity android:name="mobile.briltime.brilnet.Login"
android:screenOrientation="portrait"></activity>
<activity android:name="mobile.briltime.brilnet.MyFriendListActivity"
android:screenOrientation="portrait"></activity>
<provider
android:name="com.c2call.sdk.pub.db.provider.C2CallContentProvider"
android:authorities="mobile.briltime.brilnet.content"
android:exported="true"
android:grantUriPermissions="true" >
<grant-uri-permission android:pathPattern=".*" />
</provider>
</application>
thanks for your contribution, finally i solved the problem.
Simply I delete the screen orientation from the manifest file and now its working.
My guess is that you have your android:name attribute hardcoded. Change it to a string resource.
Example:
android:name = "MyAppName"
to
android:name = "#string/app_name"
with strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">MyAppName</string>
</resources>
I guessed this (you didn't give us enough information to do more) because the resource ids in Android are ints, generated by aapt.
More about the Manifest and String Resources.
I don't know why that should be an issue to the Playstore though...