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>
Related
Running my app got this error:
Manifest merger failed : Attribute application#appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.
I've tried to add to gradle.properties
android.useAndroidX=true
android.enableJetifier=true
and also (to AndroidManifest)
tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString"
and also (to build.gradle)
implementation "androidx.appcompat:appcompat:1.0.0"
replacing the previous
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
but not working for me.
-- Android Manifest.xml --
<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"
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>
-- build.gradle --
dependencies {
implementation project(':react-native-exit-app')
implementation project(':react-native-firebase')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompatv7:
${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:17.0.0"
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-database:18.0.0'
}
It means that one of your libraries is using AndroidX. So, you have to convert your app to AndroidX.
android.useAndroidX=true android.enableJetifier=true Put these lines in your gradle.properties.
npm install --save-dev jetifier
npx jetify
npx react-native run-android (your app should correctly compile and work)
Call npx jetify run in the postinstall target of your package.json (Any time your dependencies update you have to jetify again)
Unable to find explicit activity class {ad97.com.ocruse/com.theartofdev.edmodo.cropper.CropImageActivity}; have you declared this activity in your AndroidManifest.xml?
Unable to find explicit activity class
{ad97.com.ocruse/com.theartofdev.edmodo.cropper.CropImageActivity};
You should add CropImageActivity into your AndroidManifest.xml
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="#style/Base.Theme.AppCompat"/>
After that,
Clean-Rebuild-Run.
Read Android Image Cropper
To use dependency and Sync.
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
or
api 'com.theartofdev.edmodo:android-image-cropper:2.5.1'
or
api 'com.theartofdev.edmodo:android-image-cropper:2.4.1'
you have to declare CropImageActivity in Manifest file
Something like that
<application
android:name=".MyApplication">
<activity
android:name="ActivityName"/>
</application>
In your manifest file add this code
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"/>
you can use
jcenter()
in the gradle repositories
instead of using
mavenCentral() repositories
When I load up Android Studio and build my project I get a unresolved class in my manifest file.
<activity
android:name="com.google.zxing.client.android.CaptureActivity" //THIS IS WHERE THE ERROR POINTS TO
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="google.zxing.client.android.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
I also added its reference to my build.gradle
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-v4:28.0.0-rc01'
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.journeyapps:zxing-android-embedded:3.0.2#aar'
implementation 'com.google.zxing:core:3.3.2'
//...More dependencies below
}
I have tried cleaning and rebuilding, running my gradle file, restarting Android Studio but I am still getting that unresolved class issue. I believe it might be that CaptureActivity is no longer being used. This is just speculation. I have gone through the android developer site to see if I can find it but no such luck.
EDIT
Iforgot to mention that I first saw this when I ran the code analyze. Analyze->Inspect Code. Its under Android Resource Validation.
UPDATE! Please read
After making this change I seem to have an issue when I clean/rebuild my project
D:\Foo_Workspace\Library Build\Foo\mobile\src\main\AndroidManifest.xml:151:13-50 Error:
Attribute activity#com.journeyapps.barcodescanner.CaptureActivity#screenOrientation value=(landscape) from [:Foo] AndroidManifest.xml:151:13-50
is also present at [com.journeyapps:zxing-android-embedded:3.0.2] AndroidManifest.xml:51:13-56 value=(sensorLandscape).
Suggestion: add 'tools:replace="android:screenOrientation"' to <activity> element at AndroidManifest.xml:148:9-164:20 to override.
D:\Foo_Workspace\Library Build\Foo\mobile\src\main\AndroidManifest.xml:152:13-71 Error:
Attribute activity#com.journeyapps.barcodescanner.CaptureActivity#theme value=(#android:style/Theme.NoTitleBar.Fullscreen) from [:Foo] AndroidManifest.xml:152:13-71
is also present at [com.journeyapps:zxing-android-embedded:3.0.2] AndroidManifest.xml:53:13-54 value=(#style/zxing_CaptureTheme).
Suggestion: add 'tools:replace="android:theme"' to <activity> element at AndroidManifest.xml:148:9-164:20 to override.
:mobile:processDebugManifest
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:mobile:processDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mobile: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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Class in manifest is wrong, change it to
<activity
android:name="com.journeyapps.barcodescanner.CaptureActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden"
tools:replace="screenOrientation,android:theme" />
Also Better update gradle dependencies
implementation ('com.journeyapps:zxing-android-embedded:3.6.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'
In my Android Studio androidManifest.xml file, I found an unresolved package generated. How can I fix it?
The issued code is : android:name=".provider.generated.SquawkProvider
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.aaa">
<uses-permission android:name="android.permission.INTERNET" />
<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">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name=".provider.generated.SquawkProvider"
<!-- shows unresolved package "generated" -->
android:authorities="com.example.android.aaa.provider.provider"
android:exported="false" >
</provider>
<activity
android:name=".following.FollowingPreferenceActivity"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<service
android:name=".fcm.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
</application>
</manifest>
This issue stems from annotation processing now being included in Gradle from version 2.2. You can fix project and get it running with the following changes.
Project level "build.gradle" remove this line:
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2'
App level "build.gradle" remove this line:
apply plugin: 'android-apt'
and change this line replacing apt with annotationProcessor:
apt 'net.simonvt.schematic:schematic-compiler:0.6.3'
In build.gradle(Module:app)
remove this two line
1) Top on the file
apply plugin: 'android-apt'
2) in dependencies
apt 'net.simonvt.schematic:schematic-compiler:0.6.3'
add this
annotationProcessor 'net.simonvt.schematic:schematic-compiler:0.6.3'
If the above responses don't work for you, make sure you are using the latest version of Android Studio and gradle plugin (4.4 as of this post) and have changed all the 'compile' lines with 'implementation'.
After that try Build -> Clean Project then Build -> Rebuild Project. (All of this after following #drspaceboo's answer of deleting classpath and plugin lines, then changing apt to annotationProcessor.)
Try this:-
Go to File -> Invalidate Caches / Restart and then Invalidate and Restart.
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