getting no resource identifier found error - android

I'm trying to compile iven-feed-reader project, but in the Android manifest file I keep getting this error:
Error:(16) No resource identifier found for attribute 'roundIcon' in package 'android'
Android manifest.xml:
<application
android:allowBackup="false"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:theme="#style/Theme_iven" >
<uses-library
android:name="com.sec.android.app.multiwindow"
android:required="false" />
Usually i try to rebuild/clean project to fix this error but it's not working this time.
Below are the dependencies i'm using
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'org.jsoup:jsoup:1.10.2'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
How to fix this error?

Have you added this below line in your manifest tag ?
xmlns:android="http://schemas.android.com/apk/res/android"

Related

How to add the correct admob or adview dependency to an Android app

I'm developing an app and I want to add an admob banner add to it. I asked the permissions in the manifest file for Internet and for the network state. Then I added the dependency for admob. After entering the dependency to the gradle file, the app in my phone app crashes during testing.
It happens when I add the dependency. I want to find the correct dependency or some how fix this if this happens because of another reason.
Here are the dependencies I added:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.gms:play-services-ads:18.3.0'
}
You need to add below Meta tag inside of Aplication in your Manifest
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
//Add this
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/admob_app_id" /> //Add here your admob app id
...
</application>
I hope this can help you!
Thank You.
I think you need to add 2 meta-data tags inside the manifest xml of your application.
<application>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/admob_app_id" /> // put your admob app id in quotes
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
Hope this helps

Manifest Merge issues with Lottie

I was getting started with Lottie when I came across this error. I added the dependency to my build.gradle
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'org.jsoup:jsoup:1.11.2'
implementation 'com.airbnb.android:lottie:2.8.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha06'
implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha06'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Since I added implementation 'com.airbnb.android:lottie:2.8.0' build succeeds but I cant run my application as there is an error in the Manifest Merging.
Merging Errors: Error: Attribute application#appComponentFactory value=(androidx.core.app.CoreComponentFactory) from AndroidManifest.xml:22:18-86 is also present at AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:14:5-35:19 to override. app main manifest (this file), line 21
Here is my Manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
xmlns:tools="http://schemas.android.com/tools"
package="com.rishav.sanfoundryfer">
<dist:module dist:instant="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:logo="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".QuestionActivity"
android:label="MCQs"/>
<activity android:name=".TopicActivity"
android:label="Select Topic"/>
<activity android:name=".SubjectActivity"
android:label="Select Subject"/>
<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>
The fact that the error has androidx.core.app.CoreComponentFactory points to the fact that the new "Jetpack" support library packages are being used. Seeing that your manifest uses the "older" packages points to the fact that it probably is used by lottie.
You can make sure that this is the reason by inspecting the library.
To resolve the issue you can use an older lottie library, start using the jetpack support library packages or resolve the merge manually. You can take a look at the merged manifest if you navigate to the AndroidManifest.xml and switch to the Merged Manifest tab at the bottom of the window.
Suggestion:
add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:14:5-35:19 to override.app main manifest (this file), line 21

VideoCastControllerActivity: ActivityNotFoundException

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.newco.cooltv.qa/com.google.android.libraries.cast.companionlibrary.cast.player.VideoCastControllerActivity}; have you declared this activity in your AndroidManifest.xml?
i am using cast companion library and tried both way
(1) Add this library from jCenter repo by adding the following line to your project's dependencies:
(2) Use the GitHub source and include that as a module dependency by following these steps:
Both are failing with above exception after call to
loadRemoteMedia(mediaInfo, 0, true);
in build.gradle i have specified below dependencies
// lib for chromecast
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:mediarouter-v7:23.3.0'
compile 'com.google.android.gms:play-services-cast:9.0.2'
compile project(':CastCompanionLibrary')
I am using Andorid Studio 2.1.2 and updated build.gradle of CCL with
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
Make sure you declare that in your Manifest file, something like:
<activity
android:name="com.google.android.libraries.cast.companionlibrary.cast.player.VideoCastControllerActivity"
android:label="#string/app_name"
android:launchMode="singleTask"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>

Amazon Device Messaging Stub! Android Studio

I'm trying to integrate Amazon Device Messaging with Android Studio. First I followed (integrating-your-app-with-adm). When I call
ADM adm = new ADM(getActivity());
if (adm.isSupported()) {
// ...
}
There's this output on logcat:
E/AndroidRuntime(24472): java.lang.RuntimeException: Stub!
E/AndroidRuntime(24472): at com.amazon.device.messaging.ADM.(Unknown Source)
So I followed Amazons (Integrating Amazon Libraries with Android Studio ) with the same result.
Then I tried this and this without success.
My AndroidManifest.xml looks like this:
...
<uses-permission android:name="de.mypackage.permission.RECEIVE_ADM_MESSAGE" />
<uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
<permission android:name=".permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
...
<application
android:name=".MyPackageApplication"
android:allowBackup="true"
android:allowClearUserData="true"
android:hardwareAccelerated="false"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
...
<service android:name=".service.ADMNotificationService" android:exported="false" />
<amazon:enable-feature android:name="com.amazon.device.messaging" android:required="true" />
<receiver android:name=".service.ADMNotificationService$MessageAlertReceiver"
android:permission="com.amazon.device.messaging.permission.SEND">
<intent-filter>
<action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
<action android:name="com.amazon.device.messaging.intent.RECEIVE" />
<category android:name="de.mypackage"/>
</intent-filter>
</receiver>
...
</application>
The local build.gradle looks like this:
...
dependencies {
...
provided files('libs/amazon-device-messaging-1.0.1.jar')
...
}
May you have an idea?
You probably have something along this lines in your dependencies section:
compile fileTree(include: ['*.jar'], dir: 'libs')
This means you're compiling all jars in libs folder into your app. So probably the answer that says switch compile to provided works, but in addition to provided you do compile for all jars in libs folder anyway.
You would need to remove the fileTree line, and include any jars you have there (excluding amazon-device-messaging-1.0.1.jar) manually.
The solution to fix the crash is to edit the build.gradle (Module:app) file.
Remove the line: compile fileTree(include: ['.jar'], dir: 'libs')*
Go to the libs folder and find out all the jar files you require
Include them one by one for compilation. For example, compile files('libs/ePOS2.jar')
Add ADM jar file provided files('libs/amazon-device-messaging-1.0.1.jar')
Build the project

AdMob error: Didn't find class "com.google.ads.AdView"

So I'm on Android Studio v 0.3.6 and I'm having problems with Google Play Services. I was already using the Admob jar in my project but I had to update it so I tried to add them via the instructions. My project compiles fine however when I try to run an activity I get the following error:
Didn't find class "com.google.ads.AdView" on path: /data/app/com.mre. example-1. apk
See the full error output here Relevant portion of my build.gradle:
apply plugin: 'android'
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile 'com.google.android.gms:play-services:4.0.30'
//compile project(':libraries:google-play-services_lib')
//compile files('libs/google-play-services.jar')
...
}
android {
compileSdkVersion 18
buildToolsVersion '18.0.1'
defaultConfig {
minSdkVersion 8
targetSdkVersion 18
}
}
Here's my manifest
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"ex">
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.games.APP_ID"
android:value="#string/app_id" />
<meta-data
android:name="com.google.android.gms.appstate.APP_ID"
android:value="#string/app_id" />
...
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
Here's the layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
...
<com.google.ads.AdView
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="50dp"
ads:adSize="BANNER"
ads:adUnitId="#string/ad_unit_id"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
android:gravity="center" />
...
</RelativeLayout>
Over the past two days I have tried every variation of adding the GPS library to my project, to just the jar to both to none. At first I deleted the jar from my /libs and added the required lines to my build.gradle but that didn't work either. I thank you in advance for any help you can provide.
The package changed to com.google.android.gms.ads.AdRequest and com.google.android.gms.ads.AdView
Change your import and your layouts
Follow this tutorial to migrate your apk.
In my case I forget to add google_play_services_lib to my project. I fixed that by adding this library... Hope it will help someone...
Landed in similar problem while configuring firebase. Need to add play-services as dependency in app level gradle file -
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.google.android.gms:play-services:9.0.0'
}
Important part here is -
compile 'com.google.android.gms:play-services:9.0.0'
Post this sync your project and all required classes should be available.

Categories

Resources