Errors in manifest - android

After I switched from Eclipse to Android Studio, i got these errors, and i have now idea how to solve them, i'm still not familiar with AS.
[com.google.firebase:firebase-iid:9.8.0] K:\drawing-board\build\intermediates\exploded-aar\com.google.firebase\firebase-iid\9.8.0\AndroidManifest.xml:24:17-71 Error:
Attribute permission#${applicationId}.permission.C2D_MESSAGE#name at [com.google.firebase:firebase-iid:9.8.0] AndroidManifest.xml:24:17-71 requires a placeholder substitution but no value for <applicationId> is provided.
[com.google.firebase:firebase-iid:9.8.0] K:\drawing-board\build\intermediates\exploded-aar\com.google.firebase\firebase-iid\9.8.0\AndroidManifest.xml:26:22-76 Error:
Attribute uses-permission#${applicationId}.permission.C2D_MESSAGE#name at [com.google.firebase:firebase-iid:9.8.0] AndroidManifest.xml:26:22-76 requires a placeholder substitution but no value for <applicationId> is provided.
[com.google.firebase:firebase-iid:9.8.0] K:\drawing-board\build\intermediates\exploded-aar\com.google.firebase\firebase-iid\9.8.0\AndroidManifest.xml:34:27-58 Error:
Attribute category#${applicationId}#name at [com.google.firebase:firebase-iid:9.8.0] AndroidManifest.xml:34:27-58 requires a placeholder substitution but no value for <applicationId> is provided.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
[com.google.firebase:firebase-common:9.8.0] K:\drawing-board\build\intermediates\exploded-aar\com.google.firebase\firebase-common\9.8.0\AndroidManifest.xml:6:19-78 Error:
Attribute provider#com.google.firebase.provider.FirebaseInitProvider#authorities at [com.google.firebase:firebase-common:9.8.0] AndroidManifest.xml:6:19-78 requires a placeholder substitution but no value for <applicationId> is provided.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
K:\drawing-board\AndroidManifest.xml:57:13-59:29 Error:
Missing one of the key attributes 'action#name,category#name' on element intent-filter at AndroidManifest.xml:57:13-59:29
K:\drawing-board\AndroidManifest.xml Error:
Validation failed, exiting
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:processDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Thank you!
Sorry here's my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="example.dessin"
android:versionCode="25"
android:versionName="2.1.4" >
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true" />
<uses-sdk android:minSdkVersion="11" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Holo.Light">
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".Splash"
android:label="#string/app_name"
android:exported="true"
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=".StickerDialog" android:label="Dialog Example"
android:theme="#android:style/Theme.NoTitleBar" />
<activity
android:name=".Paint"
android:configChanges="orientation|screenSize|keyboard|keyboardHidden">
<intent-filter>
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
</application>
</manifest>
How i can merge the manifest?? and fix these bugs? and how the hell i can stop these errors for god sake!!! Thank you very much!!

You need to add the applicationId placeholder to the application gradle. This happens with the integration of Firebase, after updating to Gradle 2.2.0-alpha1
android {
...
defaultConfig {
applicationId "com.example.my.app"
...
}
}
Worked for me..
Found here

Related

java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException

Suddenly, I tried to open my application and the app did not wanted to start. It stopped before opening it. I started searching and tried all of other similar questions, but none worked. this is my log:
2020-07-18 22:27:41.652 21042-21042/? I/art: Not late-enabling -Xcheck:jni (already on)
2020-07-18 22:27:41.652 21042-21042/? W/art: Unexpected CPU variant for X86 using defaults: x86
2020-07-18 22:27:41.878 21042-21042/? W/System: ClassLoader referenced unknown path: /data/app/com.ainimei.remotemouse-1/lib/x86
2020-07-18 22:27:41.900 21042-21042/? D/AndroidRuntime: Shutting down VM
2020-07-18 22:27:41.900 21042-21042/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ainimei.remotemouse, PID: 21042
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to add a valid App ID inside the AndroidManifest. *
* Google Ad Manager publishers should follow instructions here: *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. *
******************************************************************************
at android.app.ActivityThread.installProvider(ActivityThread.java:5856)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
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.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to add a valid App ID inside the AndroidManifest. *
* Google Ad Manager publishers should follow instructions here: *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. *
******************************************************************************
at com.google.android.gms.internal.ads.zzyz.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:33)
at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:3)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
... 10 more
here is my androidManifest.xml:
note that the code has no meta-data tag. But I never needed it until now. Also my app does not use ads on it.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ainimei.remotemouse">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="#drawable/ainimei_logo_icon"
android:label="#string/app_name"
android:roundIcon="#drawable/ainimei_logo_icon"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SelectConnectionType" />
<activity android:name=".ControlBluetoothConnection" />
<activity android:name=".Connection" />
<activity
android:name=".KeyboardActivity"
android:screenOrientation="landscape" />
<activity
android:name=".ProfileSettingsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".loginActivity"
android:screenOrientation="portrait" />
<activity
android:name=".buyPremiumActivity"
android:screenOrientation="portrait" />
<activity
android:name=".select_control"
android:screenOrientation="portrait" />
<activity
android:name=".SettingsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I keep trying anyways.
In your manifest file , inside the application tag put this code
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
/// pass the key generated from your admob which contains ~(APP ID)
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/> //
</application>
just check whether meta-data tag is out of activity tag
if it is like this
<manifest>
<application>
<activity>
<meta-data>
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-4347201915048498~6120388314"/>
</activity>
</application>
</manifest>
this should be changed to this
<manifest>
<application>
<activity>
</activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-4347201915048498~6120388314"/>
</application>
</manifest>

Cordova geolocation plugin & cordova firebase plugin conflicting

I'm facing this issue while working with two plugins:
cordova-plugin-geolocation-firebase and cordova-plugin-firebase.
Seems like both of them try to add the extension googleServices which is causing the build to fail. Any help with this will be really helpful :)
FAILURE: Build failed with an exception.
* Where:
Script 'app/platforms/android/cordova-support-google-services/www-build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> Cannot add extension with name 'googleServices', as there is an extension already registered with that name.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Script 'app/platforms/android/cordova-support-google-services/www-build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> Cannot add extension with name 'googleServices', as there is an extension already registered with that name.
Thanks.
Here's my AndroidManifest.xml
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="2" android:versionName="0.0.2" package="kz.starget.www" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="#android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="#string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.transistorsoft.locationmanager.license_key" android:value="" />
<service android:exported="true" android:name="com.transistorsoft.cordova.backgroundfetch.HeadlessJobService" android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver android:name="com.transistorsoft.cordova.backgroundfetch.HeadlessBroadcastReceiver">
<intent-filter>
<action android:name="${applicationId}.event.BACKGROUND_FETCH" />
</intent-filter>
</receiver>
<provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="org.apache.cordova.camera.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/camera_provider_paths" />
</provider>
<activity android:label="#string/multi_app_name" android:name="com.synconset.MultiImageChooserActivity" android:theme="#style/Theme.AppCompat.Light" />
</application>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
change Projected.properties file replace those
cordova.system.library.4=com.google.android.gms:play-services-gcm:11.0.1
cordova.system.library.5=com.google.android.gms:play-services-location:11.0.1
those are related your issue
https://github.com/jeduan/cordova-plugin-facebook4/issues/507
https://forum.ionicframework.com/t/failed-to-apply-plugin-class-com-google-gms-googleservices-googleservicesplugin/101086/11

Cause of Error Message "Error:(27) Tag <manifest> attribute package has invalid type 4."

When trying to build my app, I get the following error message: "Error:(27) Tag <manifest> attribute package has invalid type 4." Any ideas on what is causing this? Here is a copy of my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dummy.tanc">
<application
android:supportsRtl="true"
android:allowBackup="true"
android:fullBackupContent="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="#string/app_id" />
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity
android:name="com.google.example.games.tanc.MainActivity"
android:label="#string/title_activity_main"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I think it is because, in your manifest, you've set your package name (line 2) to be
package="com.dummy.tanc"
and in when defining the activity (line 18), you've used
android:name="com.google.example.games.tanc.MainActivity"
Because of this mismatch, the issue could be arising. Change the line 18 to
android:name="com.dummy.tanc.MainActivity"
It means attribute package has type float but not string.
I guess your package name contains only numbers, something like package="1.0".

ACRA not sending to eMail

I am trying to send crash reports to email but when my app crashes nothing happens. I tried messing around with configurations but i just kept getting errors (unknown member mostly, wth that is). Here's my code for the class.
#ReportsCrashes(
mailTo = "me#gmail.com")
public class MyApplication extends Application
{
#Override
public void onCreate() {
super.onCreate();
// The following line triggers the initialization of ACRA
ACRA.init(this);
}
}
My manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ghostdevelopment.ueni2"
android:versionCode="1"
android:versionName="1.0"
android:debuggable="true">
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="25" />
<application
android:name="MyApplication"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:label="#string/app_name"
android:name="com.ghostdevelopment.ueni2.MainActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:label="Ship Database"
android:name=".ShipInfo" />
</application>
</manifest>
According to your logcat it appears that your app has not included the ACRA library. You need to configure your build so that ACRA is included in your APK.

AdMob still not working

I got a problem regarding Google AdMob:
I try to display a Interstitial, for this I have added the AdActivity, permissions and meta-tags to manifest.
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lunation.warface"
android:versionCode="10"
android:versionName="1.4" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:largeHeap="true"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan|adjustResize" >
<!--This meta-data tag is required to use Google Play Services.-->
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<!--Include the AdActivity configChanges and theme. -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="sensorPortrait"
android:windowSoftInputMode="adjustPan|adjustResize" >
<intent-filter>
</intent-filter>
</activity>
<activity
android:name=".SplashScreen"
android:noHistory="true"
android:screenOrientation="sensorPortrait"
android:theme="#style/Theme.Transparent" >
<intent-filter>
<action android:name="android.intent.action.MAIN" >
</action>
<category android:name="android.intent.category.LAUNCHER" >
</category>
</intent-filter>
</activity>
<activity android:name="gallery.FullScreenViewActivity"></activity>
</application>
</manifest>
In MainActivity:
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("xxx/xxx");
AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);
if (mInterstitialAd != null && mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
}
Logcat:
04-04 15:15:19.397: W/Ads(19752): There was a problem getting an ad response. ErrorCode: 0
04-04 15:15:19.407: I/dalvikvm(19752): Could not find method android.webkit.WebSettings.setMixedContentMode, referenced from method com.google.android.gms.ads.internal.s.g.<init>
04-04 15:15:19.407: W/dalvikvm(19752): VFY: unable to resolve virtual method 3153: Landroid/webkit/WebSettings;.setMixedContentMode (I)V
04-04 15:15:19.407: D/dalvikvm(19752): VFY: replacing opcode 0x6e at 0x004a
04-04 15:15:19.502: W/Ads(19752): Failed to load ad: 0
Besides there is also a compilation error:
Conversion of dalvik format failed with error code 1
I tried about 20 answers, still not working.
I also dont know whether the problem is the unit id, I can change
mInterstitialAd.setAdUnitId("xxx/xxx");
to:
mInterstitialAd.setAdUnitId("xxx");
and I got the same errors.
I use the following external libraries:
android support v4&v7, picasso, ftpclient(commons, httpmime),FAB
Does somebody have a advice?
Greetings
Solution found!
Seems like some features in CyanogenMod blocks AdMob.
Flashed a new version WITHOUT Adaware and blocking Tools.
WORKING NOW :D

Categories

Resources