Flurry integration Android throwing errors - java

I'm trying to integrate flurry into my android app. I'm using the recommended setting and have repositories{jcenter()} and
// Required for Flurry Analytics integration
compile 'com.flurry.android:analytics:8.2.0#aar'
// Optional - If you want to use the Ads SDK
compile 'com.flurry.android:ads:8.2.0#aar'
in the gradle as the docs suggest. I keep getting errors in the that Application is not resolved. The docs really blow and I'm not 100% sure what going on. I've never integrated flurry before can someone please help! I put the manifest and the class i'm using below. I know it doesn't have a key I'm still working on removing errors. I'm dumping the that class in the main file for simplicity for now.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tempconversion.october.com.myapplication">
<!-- Required permissions - Internet access -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- Highly Recommended permission - External memory pre-caching -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Optional permission - Location based ad targeting -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="F to C and K"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
class in main file
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
new FlurryAgent.Builder()
.withLogEnabled(true)
.withCaptureUncaughtExceptions(true)
.withContinueSessionMillis(10)
.withLogLevel(VERBOSE)
.build(this, FLURRY_API_KEY);
}
}

Declare the application name in manifest.xml file.
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="F to C and K"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

Related

I set android:exported but I am still getting error: android:exported needs to be explicitly specified for <receiver>

I am moving from SDK version 30 to 31 and I add android:exported in intent-filter but still I am getting this error:
Merging Errors: Error: android:exported needs to be explicitly specified for . 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.
<?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.mycompany.webviewapp">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:name=".App"
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">
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
<activity android:name="com.mycompany.webviewapp.SplashActivity"
android:exported="true"
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="com.mycompany.webviewapp.MainActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.VIEW"></action>
</intent-filter>
</activity>
<service android:name="com.mycompany.webviewapp.FCM.MyFirebaseMessagingService">
</service>
<meta-data android:name="applovin.sdk.key"
android:value="sdk api here"/>
</application>
</manifest>
The reason is because some of the dependency libraries that you're using have elements which do not have "android:exported" attribute.
You need to do this:
Lower the version in your gradle to 30 and sync and build.
Go to your AndroidManifest.xml file and click on "Merged Manifest".
Find items such as Activity, Receiver, Service, etc that don't have "android:exported" attribute.
Then add them to your AndroidManifest.xml file in this way.
<activity
android:name="SomeActivity"
android:exported="false"
tools:node="merge"
tools:replace="android:exported" />
Now you can increase your version to 31.
I resolve my issue. I just check the merged manifest and look for reciver. In onesignal, I found out reciver with intent filter defined without android:exported. I just add android:exported="false".

Using O Auth for google api on android app

What should i add here for the scheme for URl redirect, can i add anything, like "com.example.oauth/:oauth2redirect"(Package name:/ oauth2redirect)?.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.oauth">
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.INTERNET">
</uses-permission>
<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/Theme.Oauth">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme=" ">
</data>
</intent-filter>
The most common option when learning Mobile OAuth is to start with a value like this, using a reverse DNS style of naming, to include your company + app names:
com.mycompany.myapp:/callback
A good starting point for something to compare against is the Android AppAuth Code Sample, where you just specify a scheme value in the gradle file.
If it helps, my Blog Post has some step by step instructions to get the sample running.

How to fix the default activity not found problem?

my problem is related to Android Studio.Whenever I try to run my app I get an error that says default activity not found.Please help me out,it's really important.Thank you in advance!
Just in case,I've got 2 classes: the first one is MainActivity,the second one is CatRepository
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.cats">
<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=".ui.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Try to replace <activity android:name=".ui.MainActivity"> by <activity android:name=".MainActivity">
Try putting full package name of your Activity.
You can try invalidating cache and restart.
File -> Invalidate Cache/Restart
Also after doing this, sync your project. : File-> Sync Project with Gradle Files

<uses permission> in android studio is not working / application is not asking for permission

I am trying to make an app which starts by asking permission and accesses the hotspot of any device and any android version with which the very first problem which is bothering me is that why is not working, i have tried it on two devices and both of the attempts were unsuccessful.Please can anyone help me out to point my mistake. I checked similar questions related to it and have tried correcting it too but still not working..
here is the xml code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.akshay.turnonhotspot2">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<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=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
It is changed since Android API 23.
You also have to ask permissions at Runtime.
Check this document
Permissions are asked when when you need user personal data such as contacts, storage(photo, video, file) and etc..
You don't need to ask permission for android.permission.INTERNET, android.permission.ACCESS_NETWORK_STATE, android.permission.ACCESS_WIFI_STATE, android.permission.CHANGE_WIFI_STATE

Android AWS Security Credential Issue

I am having a problem integrating the AmazonS3PersonalFileStore demo app login into my App
I have set up my TVM and everything works fine on the demo app, it also runs correctly when I copy/paste the project and rename it.
The issue comes when I begin pasting my .javas from my main app into the pasted Demo app, now when I login, I get the error
Credential Problem!
AWS Credentials not configured correctly. Please review the README file.
the readme refers to project setup and the .properties file, all of which I did not touch
Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws.demo.personalfilestore"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".S3PersonalFileStore"
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=".Login"></activity>
<activity android:name=".s3.S3BucketView"></activity>
<activity android:name=".s3.S3ObjectView"></activity>
<activity android:name=".s3.S3AddObjectView"></activity>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.MainMenu"
android:label="#string/main_menu" />
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.TripMain"
android:label="#string/trips"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.TripView"
android:label="#string/trip_view"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.DiagnosticsMain"
android:label="#string/diagnostics"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.DtcListView"
android:label="#string/dtcs"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.RpmComparison"
android:label="#string/rpm_distribution"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.UbiMain"
android:label="#string/ubi"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.UbiView"
android:label="#string/ubi_view"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.UsageMain"
android:label="#string/usage"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.EnvironmentalMain"
android:label="#string/environmental_main"/>
<activity
android:screenOrientation="portrait"
android:name="com.example.indrive.ComparisonMain"
android:label="#string/vehicle_comparison"/>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxx"/>
</application>
</manifest>
Although I have added new code, I am pretty sure that none of it is running, since none of my activities are being created
Update: I tried adding an EC2 role to the TVM Elastic Beanstalk with the same permissions as the IAM TVMUser, but the demo app wouldn't even work
Update 2: Tried a bunch of different IAM configurations for the TVM IAM User / Elastic Beanstalk, nothing worked
I had the same issue when integrating the AmazonS3PersonalFileStore demo app login into my app.
The problem was that the request to the TVM via the HTTP request was blocked. This is due to the android sdk's StrictMode.ThreadPolicy which does not allow network operations to execute on the UI thread.
This restriction can be changed, using:
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
Add the above code into your main activity's onCreate() method.
In addition, it is always recommended to move network operation off the UI thread, for example, using AsyncTask.
I am confident this will fix your problem.

Categories

Resources