I set up admob using npm i --save react-native-admob#next and after that implemented of course in my XML file for android the right app-ID which was given to me by admob. I did it just like that:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-****************~*********"/>
Also I implemented into the app gradle file following line:
implementation 'com.google.android.gms:play-services-ads:20.2.0'
The last step I did was going into the nodemodules/react-native-admob/build.gradle and changing one line into this:
implementation 'com.google.android.gms:play-services-ads:19.8.0', before that the build was crashing.
My application now builds and doesnt give me ANY error message, however it closes directly after popping up and Im unable to do anything.
No error logs and nothing else beside that. Tried out several solutions which worked for people here, unluckily it didnt work for me.
same issue i faced with this plugin react-native-admob#next.
try this one https://github.com/react-native-admob/admob
this might seem trivial but I can't understand why I'm getting this error.
I downloaded the sample app activityInstrumentation( from Android Studio File -> import Sample) and inside the testing project manifest I get an unresolved symbol for
android:targetPackage="com.example.android.activityinstrumentation".
After that I've created a manifest for my application and still there is an unresolved symbol on the attribute.
My application project dir and test project dir are:
app/src/main/java/com/example/appname
where manifest has
package="com.example.appname"
app/src/androidTest/java/com/example/appname
where manifest has
<manifest
...
package="com.example.appname.tests"
...
android:targetPackage="com.example.appname"
...
</manifest>
Please help me sort this out. I don't know what else I can do: using a sample app to create a full fledged test project was my very last hope.
You must specify android:targetPackage in instrumentation tag.
[http://developer.android.com/guide/topics/manifest/instrumentation-element.html
]
I see the same thing. Seems to be only false alert produced by the lint code inspection. When you run analysis (Analyze->Inspect code...) and open "Inspection" tab you can select the warning and mark it Suppress for tag. That will get rid of the warning.
I imported android project an I got 3 errors
error: Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait'). AndroidManifest.xml /com.cartmillimaging.fishingmate.MapViewActivity line 16 Android AAPT Problem
same error on different lines.
<activity android:name=".MapViewActivity" android:screenOrientation="sensorPortait">
For project build target I have selected Google APIs 2.3.3. 10.
I also enabled Java compiler project specific settings and put compiler compliance error to 1.6.
I am new to android development, so can you help me?
checkout your API level. The following attributes:
android:screenOrientation="sensorPortrait" only can work on API level 16+
android:screenOrientation="sensorPortait" can work under level 15
I think it's a fixed bug
There's a typo error in the value. The correct name is "sensorPortrait"
when you load project I get this error (I use api level 10). I found solution for this. You change screenOrientation to something else, save it, and then return to sensorPortait and everything now is working.
Confirmed what cashmere said.
i changed all
android:screenOrientation="sensorPortrait"
to
android:screenOrientation="sensorLandscape"
built the project and then changed it back again for all my activites in the manifest and all works good :)
Had this error and couldn't kick it. Some how my build settings had API 13 selected... Selected API 21 and yay no more issue!
In my application I use RoboGuice and the configuration for RoboGuice requires to add an Application-class and specify it in the AndroidManifest.xml file in the application-tag using the 'android:name' attribute.
So this is how my applicaiton-tag in the manifest looks like:
<application android:label="Worktime" android:icon="#drawable/logo" android:name=".guice.Application">
This always works and still does when I compile inside my IDE (IntelliJ) and deploy it to my device.
However when I want to run my tests using Ant (and only via Ant, this also still works in the IDE) I have this error on the console:
[exec] android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests:INSTRUMENTATION_RESULT: shortMsg=Unable to instantiate application eu.vranckaert.worktime.guice.Application: java.lang.ClassNotFoundException: eu.vranckaert.worktime.guice.Application in loader dalvik.system.PathClassLoader#44e88928
[exec] INSTRUMENTATION_RESULT: longMsg=java.lang.RuntimeException: Unable to instantiate application eu.vranckaert.worktime.guice.Application: java.lang.ClassNotFoundException: eu.vranckaert.worktime.guice.Application in loader dalvik.system.PathClassLoader#44e88928
This has worked before but started failing since I upgraded my 'Android SDK Tools' to revision 17 and the 'Android SDK Platform-tools' to revision 11.
Anyone who had this issue also or who knows how to fix it?
I think that the error saying
java.lang.ClassNotFoundException:
is occur only when you have create new class Activity and not declare(register) that in manifest file
please check if you have any new activity and not declare(register) that activity in manifest file
Thanks.
we might have encountered the same error - In my case the solution was to separate the Ant targets to two calls (i.e. "ant myParameters myTarget1 myTarget2", and "ant myParameters debug delivery"). Hope this works for you, anyhow - Google need to add better support for their undocumented/faulty changes (and stackoverflow isn't the best place for questions that are not originated in stupidity, as the lifetime of a complex question isn't too long here).
Aaaargh! I don't know what's going on, but suddenly I can't launch my app. I'm using IntelliJ and I keep getting this error. I thought maybe there was a typo somewhere in the manifest, but there doesn't seem to be. Heres' the error:
Launching application: com.foo.app/com.foo.app.main.
DEVICE SHELL COMMAND: am start -n "com.foo.app/com.foo.app.main"
Starting: Intent { cmp=com.foo.app/.main}
Error type 3
Error: Activity class {com.foo.app/com.foo.app.main} does not exist.
And here's my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.foo.app">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".main">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".NoBellsActivity"/>
</application>
</manifest>
And the strange thing is that ADB shows me that the ActivityManager is starting the intent just fine...
The problem is in the build / run configuration of your project.
You have to check the "Deploy application" checkbox in the Run/Debug Configuration screen, under the General tab.
This solved my problem.
I had a very similar error.
In my case the application was not completely removed from the Android phone.
I simply removed it using ADB, e.g. adb unsinstall com.your_app_name
Check if you don't have another application with the same package id installed on device: https://stackoverflow.com/a/22524188/540639
after checking all other things that people stated in their post, check in the IDEA:
Run -> Edit Configurations -> Android Application -> Launch the activity that you want to start on launch of your application should be there...
I have tried every suggestion i found, but couldnt solve the issue.
After that i figured it out myself:
The problem in my case was that i renamed the package.
To make sure you dont get the error above, add the
defaultConfig {
applicationId "com.yourpackage.yourapplication"
}
to your build.gradle file.
Hope that helps.
I had a problem with identical symptoms and following solved it in my case.
If you're not already, use LogCat window to get more precise information about the exception than console offers.
If you haven't already, check through your layout XML files in case you have a custom object and you're using the wrong path for a resource.
If you haven't already, or you have to address the above, try cleaning your project and then building again.
Rebuild the application and run it.
This solved my problem.
I found an extra <application> </application> tag in my manifest, I don't know how it got there but removing it fixed my issue.
I get this all the time in intellij.
It looks like you are missing the line that states what your default package is e.g. Com.foo. Something is wrong with your manifest there...try creating a new blank test project and compare what you are missing because that looks like it is too short.
Also double check the package and activity name. I got a similar error caused by a missing dot in front of the activity name (e.g. "package.Activity" instead of ".package.Activity" ). IntelliJ didn't mark it as wrong so it was easily overlooked.
Similar to Joff's answer. It seems in Lollipop, when you try to uninstall an application, it doesn't uninstall for all users (although I only have one user).
I just go to the Apps section in Settings, select the application and use the menu and "Uninstall for all users".
I'd had the same problem, after closed Genymotion emulator and connected my phone. Cleaning the project and rerunning solved my problem too.
I had the same issue reported here. I recently added a third activity to my application and it was failing to launch with the same error. To fix the issue, I used a detail posted here. Another developer said that introducing an error to their AndroidManifest.xml file corrected their issue. I did the same: I added a space to cause a compile error, built, got the error reported, corrected the error and then recompiled and deployed and IT WORK.
Hope it fixes your issue.
One Solution:
Just create a new project and copy your classes from the old project into the new project, run the new project and it will probably work, worked for me.
In Android Studio under Run->Edit Configurations check that the package name is correct in the Launch Activity box.
I had an issue with a capital letter in that box that wasn't in the package name.
It happened with me because I forget to add it in manifest file or misspell Class name
I tried many but the problem is confliction of the package. I just invalidated caches and restarted my Android studio and working well.
Hope this may help you!
Probably this answer is too late, but I have to share my experience.
I got this problem while I developed a multi-platform Xamarin app and I was getting:
Error type 3 Error: Activity class {com.companyname.Name/com.companyname.Name.MainActivity} does not exist.
I just solved this issue removing the tag: <category android:name="android.intent.category.LAUNCHER" /> and that's it, problem solved!
NOTE: I'm using a Splash Launcher and that was the reason of my problem, when I added the tag LAUNCHER on my MainActivity all the app crashed.
its as simple as just removing the . (dot) in front of your activitys name. Your main activity should not be dotted. Dots in front of the name means its an child of the main one.