Paypal android INSTALL_PARSE_FAILED_MANIFEST_MALFORMED - android

I am trying to implement paypal sandbox into my application, i've followed every steps from the https://developer.paypal.com/sdk/in-app/android/ , however after importing everything and when i am trying to start my application i get the following error:
Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
List of apks:
[0] '/Users/xxx/Desktop/Work/shop_java/app/build/outputs/apk/debug/app-debug.apk'
Installation failed due to: 'INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl695433300.tmp/base.apk (at Binary XML file line #63): com.paypal.pyplcheckout.home.view.activities.PYPLInitiateCheckoutActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'
And i don't quite understand why it is,
my Android manifest is:
<?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.xxx">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:networkSecurityConfig="#xml/network_security_config"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:dataExtractionRules="#xml/data_extraction_rules">
<activity android:name=".ProductActivity"/>
<activity android:name=".promotion.PromotionItemActivity"
/>
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:hardwareAccelerated="true"
tools:node="merge">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
However it fails, i tried to rebuild, tried to clean, invalidate caches, gradle runs ok, but when i try to run it says this, any solutions?

Try to update the Library in build.gradle now the last version is 0.6.1.
implementation 'com.paypal.checkout:android-sdk:0.6.1'

Related

Manifestation merger failed with multiple errors, see logs

I've checked the merged manifest to find these errors
(Note that I'm a beginner android developer so every problem in android studio seems like the end of the world to me. Please help me solve this error, thanks in advance)
ERROR: tools:replace specified at line:6 for attribute android:appComponentFactory, but no new value specified App_Name.app main manifest (this file), line 5
ERROR: Validation failed, exiting App_Name.app main manifest (this file)
My Manifest.xml 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.syddhoo.bookapp">
<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.BookApp"
tools:replace="android:appComponentFactory">
<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>

Android Studio 4.0.1, Gradle, and React Native: AndroidManifest.XML not found when it exists

INTRO
Greetings, all!
My Android Studio 4.0.1 project refused to build due to not being able to find an AndroidManifest.xml file that's in /main/ where it should be, according to the documentation. Mass replacing the occurrences of "api" with "implementation" or vice versa hasn't helped.
Thus, what other information do you want for clarification, and what should change to ensure this works?
Thankee!
MANIFEST FILE
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hornet">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
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.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
RUN ERRORS WITH DEBUG MODE ACTIVE
Moved to this Google Doc for being too long for this post!
https://docs.google.com/document/d/19OO-OIzFy6IXPEOAdvGZLgXNsW_1sfiZsLDs6H0Jjzs/edit?usp=sharing
Try to rebuild the project or modify project structure. It happens when something was wrong

"Could not identify launch activity: Default Activity not found" - Android Studio - no answers working

Whenever trying to run the app, getting the error:
"Could not identify launch activity: Default Activity not found".
I have seen a few other threads on the same issue, but the below solutions have not worked for me:
Invalidating gradle cache and re-running
Manually overriding in the edit configuration tab to select the default activity (it then says "The activity 'MainActivity' is not declared in AndroidManifest.xml" even though it is!)
Re-syncing the gradle files
Literally shuffling around the order of the activities in my manifest
Using the long name for my activities, but doesn't make any difference
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mywebname">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_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"
android:screenOrientation="portrait"
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=".ListenScreen"
android:parentActivityName=".MainActivity"
android:screenOrientation="portrait">
</activity>
</application>
</manifest>
```
As you can see, I have clearly declared the activities (my app only has 2 so far), and I've put the intents around the ".MainActivity".
This answer worked for me after trying so many other tweaks, just adding the package name solved my problems
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.name">
https://stackoverflow.com/a/72300233/8720836
You can only have to add the package name inside the manifest tag you can find your package name inside app.gradle file and you are good to go

Manifest error while implementing MaterialNavigationDrawer

I am trying to integrate this Material Drawer to my project, however i am facing a Manifest error. I have tried changing the minSdk and targetSdk as it is suggested on some similar questions but with no success.
Here is the error i get:
Error:Execution failed for task ':app:processDebugManifest'.
> Error: [project_path\build\intermediates\exploded-aar\it.neokree\MaterialNavigationDrawer\1.2.9\AndroidManifest.xml:8] Invalid instruction 'overrideLibrary', valid instructions are : REMOVE,REPLACE,STRICT
Here is my app manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.package.name">
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".activities.SplashScreenActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:theme="#style/NavigationDrawer" />
</application>
</manifest>
I am using Android Studio (Beta) 0.8.0.
What is causing this error?
I solved the error by going to the MaterialDrawer library Manifest and removing the uses-sdk:
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="21"
tools:overrideLibrary="at.markushi.ui" >
</uses-sdk>
I am not sure if that will bring up any error later on but at least it solve the problem i had

Android "Permission Denial"

I have been working on an Android 2.2 app for the past three months, but decided this past week to try to build the app using Android 2.1 SDK. The app ran fine under 2.2 in the emulator, and I was able to build the source as a 2.1 project successfully, but when I try to run the app in the 2.1 emulator, I get the following runtime error:
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.tampamobileapps.testapp/.LoginScreen } from null (pid=-1, uid=-1) requires null
The app is not that complicated and only makes HTTP POST and GET requests. It also supports PayPal payments, but this API worked fine under 2.2. I have googled this error message and have not found any solutions to get rid of the error.
Any ideas?
Edit:
Here's the relevant parts of the Android manifest; the LoginScreen currently does nothing of consequence.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon"
android:debuggable="true"
android:label="#string/app_name"
android:name=".SharedApplicationContext">
<activity android:name=".LoginScreen"
android:label="#string/login_screen_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginScreen"
android:label="#string/app_name">
</activity>
<activity android:name=".MainMenu"
android:label="#string/app_name">
</activity>
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
</manifest>
You have duplicate activities defined in your manifest for .LoginScreen. Try removing:
<activity android:name=".LoginScreen"
android:label="#string/app_name">
</activity>
You may need to use the android:exported="true" option.
For instance, preference activities in live wallpapers need this set. Hope this helps someone else as I know you have probably already sorted the issue.

Categories

Resources