Cannot import Request and Session classes from Facebook Android Sdk - facebook

I am trying to import com.facebook.Request and com.facebook.Session classes with the goal of getting the Facebook friendlist from Facebook into my app.
import com.facebook.Request;
import com.facebook.Session;
But the words Request and Session keep being in red, as Android studio cannot recognize it. Anyone knows how to fix this? I appreciate any insight!
This is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.demouser.bond">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".SplashActivity"
android:theme="#style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainContactScreen"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".IndividualContactActivity"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".CalendarMainActivity"
android:parentActivityName=".MainContactScreen"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".IndividualContactPage"
android:parentActivityName=".MainContactScreen"
android:windowSoftInputMode="adjustPan" />
<activity android:name=".TemplateMainActivity" />
<receiver
android:name=".AlarmBroadcastReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<meta-data
android:name="com.facebook.accountkit.ApplicationName"
android:value="#string/app_name" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/FACEBOOK_APP_ID" />
<meta-data
android:name="com.facebook.accountkit.ClientToken"
android:value="#string/ACCOUNT_KIT_CLIENT_TOKEN" />
<meta-data
android:name="com.facebook.accountkit.FacebookAppEventsEnabled"
android:value="true" />
<activity
android:name="com.facebook.accountkit.ui.AccountKitActivity"
android:theme="#style/Theme.AccountKit"
tools:replace="android:theme" />
<activity android:name=".FacebookLoginActivity" />
</application>
</manifest>
App Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.demouser.bond"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.facebook.android:account-kit-sdk:4.+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// Facebook Android SDK (everything)
compile 'com.facebook.android:facebook-android-sdk:4.28.0'
}
Project Gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And if it is helpful, this is my res/values/string.xml file:
<resources>
<string name="app_name">Bond</string>
<string name="calendar_name">Android Custom Calendar</string>
<string name="current_date">January, 2018</string>
<string name="add_event">ADD CALENDAR EVENT</string>
<string name="sun">SUN</string>
<string name="mon">MON</string>
<string name="tue">TUE</string>
<string name="wed">WED</string>
<string name="thu">THU</string>
<string name="fri">FRI</string>
<string name="sat">SAT</string>
<string name="last_date">30</string>
<string name="action_settings">Settings</string>
<string name="title_item_list">Items</string>
<string name="title_item_detail">Item Detail</string>
<string name="facebook_app_id">137757443587015</string>
<string name="fb_login_protocol_scheme">fb137757443587015</string>
<string name="FACEBOOK_APP_ID">137757443587015</string>
<string name="ACCOUNT_KIT_CLIENT_TOKEN">[ACCOUNT_KIT_CLIENT_TOKEN]</string>
</resources>

Related

Apps targeting Android 12 required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined

my xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="apppackagename">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="sms" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="tel" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
</queries>
<application
android:label="app name"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
my gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "appid"
minSdkVersion 21
targetSdkVersion 31
versionCode 23
versionName "3.0.7"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:30.2.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.browser:browser:1.3.0'
implementation 'com.google.firebase:firebase-auth'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
I try this xml after get error where I set targetSdkVersion 31 in android/app/build.gradle
but Still got error of
'
Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
'
and also try https://github.com/flutter/flutter/issues/98055 (same problem that mention in this link)
but this is not working for me I worked with flutter version 2.10.4

flutter: why two apk are installing instead of one

i was working on my project and IDK what happened my project is one app but showing 2 icons, but only one is working and other one is not working how to solve this please any one can help me
this is my AndroidManifest code
android:configChanges="orientation|keyboardHidden|keyboard|
screenSize|smallestScreenSize|locale|la
youtDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
tools:ignore="WrongManifestParent">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<!--fb login -->
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken"
android:value="#string/facebook_client_token"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<activity
android:name=".MyActivity"
android:theme="#style/LaunchTheme"
>
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
and here code build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 33
flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID
(https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.sample"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-
build-configuration.
minSdkVersion 21
flutter.minSdkVersion
targetSdkVersion 30
flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:30.3.2')
implementation 'com.facebook.android:facebook-android-sdk:latest.release'
implementation 'com.zoho.salesiq:mobilisten:4.2.8'
}
is it because of i migrated the app or something ? please help me with this
It looks like you have multiple launchers, please choose only one Activity!
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Flutter App on play store showing error "Your device isn't compatible with this version"

Play Store keeps showing "Your device isn't compatible with this version".
I had referred to the following posts and have tried all possible ways to add/remove the permissions in Manifest file, however, I still couldn't get rid of the error in the Play Store.
My Flutter App Showing "Your device isn't compatible with this version
Your device isn't compatible with this version" but it installs via adb just fine on Nexus7
Just reaching out to you all for some solutions.
I am using Samsung S10 Android 12.
Here is my android/app/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.firebase.crashlytics'
android.buildTypes.release.ndk.debugSymbolLevel = 'FULL'
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
// compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.someApp"
// minSdkVersion flutter.minSdkVersion
// targetSdkVersion flutter.targetSdkVersion
minSdkVersion 29
targetSdkVersion 33
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-basement:17.5.0'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation "io.grpc:grpc-okhttp:1.32.2"
implementation platform('com.google.firebase:firebase-bom:30.3.2')
implementation 'com.google.firebase:firebase-analytics'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}
Here is my android/app/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.someApp">
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
<!-- Permissions -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera"
android:required="false"/>
<!-- <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />-->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:label="#string/app_name"
android:name="${applicationName}"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Local notification Start-->
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="someApp_channel" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- Local notification End-->
</activity>
<!-- Braintree Start-->
<activity
android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="${applicationId}.braintree" />
</intent-filter>
</activity>
<!-- Braintree End-->
<!-- Image Crop Start-->
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
<!-- Image Crop End-->
<!-- Google Pay Start-->
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true"/>
<!-- Google Pay End-->
<!-- Facebook Start-->
<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="someApp" />
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="#string/facebook_client_token"/>
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!-- Facebook End-->
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

Couldn't find class in spite of the fact that Dex is enabled

I am trying to migrate an app from Eclipse to the android studio I have just the files and the last person who was writing it in eclipse didn't export it for importing project. I have started a new project and manually imported the files and the lib files and tried to solve the errors till the program is now running with no Gradle errors. now I am in this situation that the dex in Gradle is enabled but when I run the program it is confused and tells me it doesn't recognize some classes.
this is my manifest file
<permission
android:name="com.company.MyProject.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<supports-screens android:smallScreens="true" />
<supports-screens android:normalScreens="true" />
<supports-screens android:largeScreens="true" />
<supports-screens android:xlargeScreens="true" />
<supports-screens android:anyDensity="true" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.company.MyProject.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<permission
android:name="com.company.MyProject.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.company.MyProject.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:name="com.company.MyProject.TruckApplication"
android:allowBackup="true"
android:icon="#drawable/MyProject_logo"
android:label="#string/app_name"
android:largeHeap="true"
android:sharedUserId="android.uid.system"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name="com.company.MyProject.Authenticate_user_Activity"
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.company.MyProject.Login_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.SubmitWaiver_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.PrepStopChoice"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<!--<activity-->
<!--android:name="com.company.MyProject.Surveyold_Activity"-->
<!--android:configChanges="keyboardHidden|orientation|screenSize"-->
<!--android:screenOrientation="portrait" >-->
<!--</activity>-->
<activity
android:name="com.company.MyProject.GetStops_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Load_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.AddComment_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
</activity>
<activity
android:name="com.company.MyProject.StopDetail_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.CaptureImage_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Survey_Activity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.GetDirection_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Map_FragmentActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.TabBar"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.ShowStopList_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.PrepActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.company.MyProject.TransprentActivity"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="stateHidden|adjustPan" >
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.company.MyProject" />
</intent-filter>
</receiver>
<service android:name="com.MyProject.Service.SyncService" >
</service>
<receiver android:name="com.MyProject.BrodcastReciver.NetworkStateReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver android:name="com.company.MyProject.RepeatingAlarmService" />
<receiver android:name="com.company.MyProject.RepeatingAlaramCommunication" />
<receiver android:name="com.company.MyProject.ReaptingAlramNewStops" />
<service android:name="com.MyProject.Service.LogoutService" >
</service>
<service android:name="com.MyProject.Service.CallNewStop_Service" >
</service>
<service android:name="com.MyProject.Service.CheckingGooglePlayVersionService" >
</service>
<receiver
android:name="com.MyProject.BrodcastReciver.DateTimeChangeReceiver"
android:enabled="true"
android:exported="false" >
<intent_filter>
<action android:name="android.intent.action.DATE_CHANGED" />
</intent_filter>
</receiver>
<!-- Start the Service if applicable on boot -->
<receiver android:name="com.MyProject.BrodcastReciver.PhoneReStartReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name="com.company.MyProject.TruckLocationUpdateService"
android:enabled="true" />
<service
android:name="com.company.MyProject.TruckCommubicationcountService"
android:enabled="true" />
<service android:name="com.company.MyProject.GCMIntentService" />
<service android:name="com.company.MyProject.HandleNotification" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyB6Ae82d_eLZ1nMYIW7EaaQ3-2-Xn7duHs" />
<!-- android:value="AIzaSyAkZzWl6FSP89yWf7VeX6ooYvd6SuRnV4E" /> -->
</application>
<!--<uses-permission-->
<!--android:name="android.permission.ACCESS_MOCK_LOCATION"-->
<!--android:required="false" />-->
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-permission
android:name="android.permission.FLASHLIGHT"
android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
android:protectionLevel="normal"
android:required="false" />
this is my gradle File
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.company.MyProject"
minSdkVersion 14
targetSdkVersion 25
versionCode 70
versionName "7.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// compile 'com.android.support:appcompat-v4:25'
testCompile 'junit:junit:4.12'
// compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.google.android.gms:play-services:10.2.1'
// compile "com.google.android.gms:play-services-gcm:10.2.1"
// compile 'org.apache.httpcomponents:httpmime:4.5.3'
// compile files('libs/gson-2.2.4.jar')
// compile files('libs/httpmime-4.2.2.jar')
// compile files('libs/joda-time-2.1.jar')
// compile files('libs/universal-image-loader-1.9.4.jar')
compile files('libs/android-support-v4.jar')
}
And this is my error log
AndroidRuntime: FATAL EXCEPTION: main
Process: com.company.MyProject, PID: 27974
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.MyProject/com.company.MyProject.Authenticate_user_Activity}: java.lang.ClassNotFoundException: Didn't find class "com.company.MyProject.Authenticate_user_Activity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.company.MyProject.Authenticate_user_Activity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/MyProject/Interface/Authenticate_Interface;
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
... 12 more
04-04 19:37:17.028 27974-27974/com.company.MyProject E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.MyProject.Interface.Authenticate_Interface" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 15 more
could you guys please help me to solve my problem.

Android Facebook Login button XML error

I want to create a test project works 'facebook login'.
I made with reference to the developers site and blog equal, But I met with an error message on xml.
[error massage]
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.facebooktest.zoit.facebooktest/com.facebooktest.zoit.facebooktest.MainActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class com.facebook.login.widget.LoginButton
[xml]
<com.facebook.login.widget.LoginButton
android:id="#+id/facebook_login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="30dp"
android:layout_marginTop="30dp" />
[Manifest]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebooktest.zoit.facebooktest">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<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" />
</manifest>
[MainActivity]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
facebookLoginButton.registerCallback(callbackManager,
new FacebookCallback<LoginResult>() {...
...
public void onActivityResult(...
void geHashKey(){...
void geHashKey(){ ...
public void onResume(){ ...
public void onPause(){...
Do you know what's wrong? please help.
I know!
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
setContentView(R.layout.activity_main);
"setContentView(R.layout.activity_main);"
I succeeded to move the this code below to Facebook code.