Stetho, not seen inspect link - android

As you see in the picture, inspect link is not seen. I did steps in this answer:
https://stackoverflow.com/a/32173974/5118976
After I run application on the my phone but there is no inspect link. Why does this problem occur? How to solve?

Add
compile 'com.facebook.stetho:stetho:1.3.1'
in gradle file.
and confirm you added
Stetho.initializeWithDefaults(this);
in application class

I had same issues in android
I refer this line.https://github.com/facebook/stetho/issues/40
This is know issues .
After created the sqlite it does not work u want uninstall the app and install it will work .It worked for me.

Aside from creating the application class please make sure it's also added to the Manifest file. :)
<application
android:name=".App" // application class
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
...
...
/>

Related

Android Studio: The activity 'MainActivity' is not declared in AndroidManifest.xml

I know that there are some similiar questions to this one but I've tried the suggestions that I found in the asnwers but none of them worked for me so I decided to publish my version of the problem.
I'm using this android studio project https://github.com/rosjava/android_core that has multiples modules inside as you can see. I had another project that I had to import to this android_core one so I downgraded its graddle version, since the version was more updated, and added it as an imported module.
After I fixed some building problems I got the "Default Activity not found" error which seemed odd to me since I had an activity marked to be the default activity so either way I decided to add it here too:
The next warning is the one on the bottom of the image which, once again, sounds odd to me since I had everything declared in the oringal project's AndroidManifest.xml file it's exactly the same on this one:
I have tried re-building, Invalidating Cache/Restarting and deleting and re-extend the AppCompactActivity class but nothing seems to work.
What am I missing? Thanks in Advance!
In the root of the manifest xml should be a manifest node with an attribute package. Make sure that the package 'com.example.prj_' is the value.
Then in your activity node you only have to place the value '.MainActivity'. Otherwise you can get some build errors for the resources in the R class.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.prj_">
<application
...>
<activity
android:name=".MainActivity"
...
</activity>
</application>
</manifest>
Add .MainActivity to your Android Manifest file.
<application
...>
<activity
android:name=".MainActivity"
...
</activity>
</application>
There are apparently race conditions with background computation of the merged manifest vs. automatic checks of it. The workaround would be to open AndroidManifest.xml and click on Merged Manifest, this forces the merge. Then clicking Run should pass the automatic tests.
See also https://issuetracker.google.com/issues/158019870
There are some ways to clean a project for removing this error.
1- File-> Sync Project with Gradle Files
2- Files -> invalidate cache / Restart
3- android:name=".MainActivity" --> android:name="com.example.prj.MainActivity"

Failling to add library to android studio project

I want to add Github library to my project in android studio , and I tried more than 7 time . Every time I have problem. I don't know what can I do Please help me
This is the library.
The library you are using is using a value for android:icon in its manifest, and so are you. Since the compiler doesn't know which icon to use, this error is thrown. So in your manifest, add tools:replace="android:icon" to override the library's manifest like so:
<Application
tools:replace="android:icon"
... >
// Other elements here
</Application>

Eclipses does not seem to generate the correct Blank Activity android project

Hey guys I am new to Android development with eclipse. I am following the walkthrough on the google website (here) and already hit an issue with it. I've installed the SDK and eclipse as instructed. Now I am trying to create and run a default Blank Activity android app. When I create the project, eclipse creates an appcompat_v7 project along side my MyFirstApp project. When I hit run, the app seems to be build without any issues and the log tells mw that it is installed on my app. But nothing happens, and I can't find it on the device.
Now the reason I think that it is not getting generated is because that Android Manifest is very barebones and missing lots of vital things by the looks of it:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
Secondly, the next step in the tutorial asks me to open up the fragment_main.xml file from the res/layout/ directory. This file does not exist. The directory is empty, there is nothing there.
I don't get any errors so I am not sure what has gone wrong.
So after a long discussion with #Prodigga, we came to the point where we think it is better to take a step back and wait for things to settle with the new SDK release (api level 21).
By the way, tutorial in the question is not outdated. There is this minor problem with the new sdk.
I don't know what is causing the problem and I don't know the solution yet but there is a workaround. If you only want to create a blank activity, given that you are experiencing the same issue, do as follows
Uncheck "create activity" check box when configuring your new project.
Create the package and MainActivity manually.
Add it to the manifest manually.
If you would like to benefit from code auto-generation, then I recommend downgrading the sdk. For example, you could use this ADT bundle (10/30/2013 - Windows 64-bit), but don't try updating the SDK to level 21, not yet.
In your android manifest file, add an activity element as the child of the application element. Add the name of the Activity class that you would want to show on the launch screen. See the below link on the syntax for this:
http://www.mkyong.com/android/how-to-set-default-activity-for-android-application/

Robolectric test not running for project having own Application class

I have followed steps as mentioned Robolectric http://robolectric.org/eclipse-quick-start/
I am able to successfully run the test as per steps provided. For a fresh new Project and Test project.
But when I followed same steps for my existing project, then nothing happens only a warning is being shown and test gets terminated.
My existing app is for target android-15 and I am using robolectric-2.2-jar-with-dependencies.jar
P.S. I have created a new Java Project for my existing project.
UPDATE
After hours of debugging I found that, if I remove android:name="com.myapp.bl.MyApplication from AndroidManifest, then its starts executing tests.
<application
android:name="com.myapp.bl.MyApplication"
android:allowBackup="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
Is there any addition flag or setting, that I have to pass Robolectric, so that it
understands MyApplication class.
Regards,
Yuvi
I found the issue, there was an exception in MyApplication class. If that exception occurs then application was getting closed.

<uses-library /> in Android Manifest

I'm a newbie for Android and I need help regarding this issue. I am developing a game using Eclipse. In my project, I added AndEngine and AndEngine Augmented Reality as libraries. I was testing the project out in my Android device, every time I tap the text which uses the class of AR, it force close. I was told to register AndEngine in my Android Manifest file. I have checked about it and used <uses-library />. Now, I placed these two lines in my manifest:
<uses-library android:name="org.andengine.extension.augmentedreality"
android:required="true"/>
<uses-library android:name="org.andengine"
android:required="true"/>
but I get this error message: Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
when I comment out those <uses-library /> lines, I can run the app but it force close when tapping the text that directs to the class of AR. Anything wrong in using it? Or any better way in doing it? Please post all your advises in an easy-to-understand-for-newbies way. THANK YOU!
<uses-library> is not meant to include libraries in your application. It is used to restrict app availability in Google Play based on the availability of a library already on the device like maps. AndEngine is a library project so include it in your build via Ant, Maven or whatever IDE you use.
In case you aren't familiar with what a library project is here's a link:
https://www.vogella.com/tutorials/AndroidLibraryProjects/article.html
If this element is present and its android:required attribute is set
to true, the PackageManager framework won't let the user install the
application unless the library is present on the user's device.
<uses-library> - specifies a shared library that the application must be linked against. This element tells the system to include the library's code in the class loader for the package.
creat a libs folder inside the res folder and put the AndEngine jars in it.set the class path of jar.

Categories

Resources