Integrate new relic sdk into a non-gradle project in android studio - android

I am trying to integrate new relic SDK into my app, and the problem is that the code is old and wasn't ported to gradle and we don't have time to port it. So when we try to add the new relic sdk into the project structure as a library is not working and it's throwing me an error that I can't get any feedback, the error is the following.
Failed to detect New Relic instrumentation. Something likely went wrong during your build process and you should contact support#newrelic.com.

NewRelic provides a video on their page for proper import in ADT/Eclipse. It is available on this page: https://docs.newrelic.com/docs/mobile-apps/android-installation-and-configuration
Generally, after adding a .jar to your library directory, you must set your build path correctly. Right click on your project, select Build Path -> Configure Build Path and make sure that the .jar appears in the Libraries tab and that it is checked in the Order and Export tab.

Anyways, regarding about the problem of not been able to build in android studio is fixed, but also I were able to import my code to eclipse and make it run and after that I make it work also in android studio without gradle. I have submitted a ticket to new relic just in case they are willing to create a new tutorial for people, like me, that are not using gradle an make it work in android studio.
This is the important line:
-javaagent:/path/to/newrelic-android-3.330.0/lib/class.rewriter.jar
you have to add this into your compilation parameters, and the only way to do it is through the preference of the android studio, instead of your project preference.
Try to find a way to add this command only for when we are building this project and not other ones. Let see.

Related

Not able to add dependency to android project in flutter

Hello I am new to flutter and i want to do native function calls using flutter, i wrote an sample native code app and it is working as expected. Now i want to use some packages on my android code, which is platform specific.
I have added my dependcies in my build.gradle file and it the gradle build is success,
But i cannot use the package there,
say for example: i have added the dependency for the com.squareup.okhttp3:okhttp:3.4.2 and gradle build is success and now icannot access their methods and other stuffs. Please let me know to what to do with it. Thanks in advance.enter image description here
Finally it worked, i opened the android project as an new android project in android studio which resolved the issue.

Adding crashlytics in an Android project without Gradle

I'm working with an Android Project which does not have Gradle. It is an old-style structure project which has not been updated for using Gradle.
I'm trying to find the way of adding Crashlytics but I cannot find a way.
Is there any easy way to add crashlytics without Gradle?
Thanks.
Are you using Android Studio?
All the ways you can integrate are listed on Fabric's download page
If you are not using gradle, I guess it's still a Eclipse project. And Crashlytics is now part of Fabric, so I guess it's Fabric too what you are using.
About Eclipse, I'd recommend migrating it to Android Studio and take advantage of Gradle, but anyway, the steps would be:
Clip on Help -> Install New Software
Click "Add..." and add a new repository with the name Fabric and in the location, type in https://fabric.io/download/eclipse.
Look for "Fabric" and check its checkbox
Install it, restart eclipse, and you should be seeing a new blue icon in Eclipse's toolbar, for Fabric.
Edit: for using the library files (jar and aar) directly, in a IDE independent way, or with maven, the artifactory repo for twitter can be useful: https://twittersdk.artifactoryonline.com/twittersdk/webapp/home.html?3
There, you can find crashlytics libraries: http://twittersdk.artifactoryonline.com/twittersdk/webapp/search/artifact/?4&q=crashlytics, and also fabric: http://twittersdk.artifactoryonline.com/twittersdk/webapp/search/artifact/?5&q=fabric
For every dependency, Twitter's Artifactory help with code for Ivy, Maven or Gradle integration.

Could not find BaseGameUtils.apk

For the last 2 days I've been trying to simply get Google play game services Integrated into my game. I've followed the instructions here...
https://github.com/playgameservices/android-basic-samples/blob/master/README.md
...many many times. I have been trying to get it to build with Gradle but for now, I'll just focus on Eclipse building until that works. I've imported BaseGameUtils project into my workspace as an Android library project. My game android project has two Android library dependencies: google-play-services_lib and BaseGameUtils. Everything in Eclipse is showing without any errors. When I build and run on a real device, I see an error that says -
[2014-10-27 20:39:25 - BaseGameUtils] Could not find BaseGameUtils.apk!
I don't know why it's even looking for BaseGameUtils.apk since it should be an Android library. That said, I'm not sure how an Android library is really handled so maybe it should be a .apk. In any case, I couldn't find any information on this bug and the error message doesn't give me much to work with. I've tried adjusting things in the Build Path but no luck. I did have to remove some redundant dependencies in my Build Path earlier since I was getting some kind of duplicate DEX error but I'm not sure that's related in any way to this. I am desperate for help, anyone have any idea?
Can you try this? It has to do with conflicting methods of specifying that a project is a library.
I found the source of the problem!
It turns out that "with the new library feature, you don't specify the
Android projects you depend on in the Java Build Path section of the
Properties. You do it in the Android section of the Properties".
So all I had to do is go the Application Project's Properties, hit the
Projects tab, select my own library project and click the Remove
button. That's it. No more problem.
In Eclipse Java EE select the project Properties, then select Project
References, then check the FacebookSDK (see screen capture)
From: Android Eclipse - Could not find *.apk
If that doesn't help, you may want to double check that you selected "Is Library" in BaseGameUtils.
Also, when you hit "Run" in Eclipse, are you running your application and not BaseGameUtils?
Please would you check that BaseGameUtils has "is library" checked and that your application project DOES NOT have "is library" checked.
If this is correct, then please would you review the following in detail (especially as regards checking and unchecking "is library" ) :
Android Eclipse - Could not find *.apk
I presume that the DEX error related to two or more versions of the same lib. What is the specific GameHelper error ?
As a general point, I find it productive to get a sample project working first to ensure that I have got the environment working correctly before I start integrating game services into my own projects. If you have been changing the build path then it may be quicker to start from scratch and get a sample working. I have followed those instructions in the past and they are accurate.

Android Studio 0.2.9 and New Project

I am using android studio for app development and i am using it from its 1st release, i keep updating it whenever a patch is available.Recently I updated my android studio to latest version , that is 0.2.9 and now i am facing problem while creating new project.
every time i am getting this exception msg box
The following dependencies were not resolvable. See your build.gradle file for details.
- com.android.support:appcompat-v7:18.0.0
and i am clueless about what went wrong !!
p.s : previous projects are working fine
seeking suggestions on it :)
Make sure you download the Android Support Repository under Extras using the SDK Manager
The in your project module look for the second build.gradle file uncomment the dependencies section that is pointed in your case, the file provides some instruction on what you have to do.
With that in place save, build and test, happy coding!

Android Library Dependencies broken after SDK/ADT-Update

Today, I updated my Android SDK and Eciple ADT to the most recent versions (ADT Rev 22). After restarting Eclipse it is quite unhappy with the Build Paths whenever I reference custom libraries.
An example is shown in this screenshot:
My custom "Android Utilities Library" compiles fine, but everything that depends on it shows build path errors. E.g. when I investigate the build path settings for "Android URA Library" it shows me an error with the android_utilities_library.jar missing under "Android Dependencies" (which in fact is true, the libraries will be built to individual class files in bin/classes).
After reading the solution to Build path errors with library projects I tried to clean and manually build my projects in the correct order, but to no avail.
I've never dealt with this before, so I don't know how to attack the problem.
Any help is appreciated. Thx!
Installing the new Build Tools did the trick. They were not automatically included when I updated the SDK (probably need to run the update twice I guess).
I found a solution that works for me:
Go to Project Properties > Build Path > Order and Export
Then you have to check each checkbox.
In my case my libraries were restored
I hope it will help.
I can see that your project Android URA Library is referring to Android Utilities Library, then the problem should not relate to SDK/ADT update.
Please check:
Project Properties of Android URA Library, choose Project tab and make sure you added Android Utilities Library as dependency project. Otherwise, please add it.
If the problem is still existing, then Projects \ Clean All Projects
Go to libraries and check the build path of the dependent libraries. It should be same as your projects build path.
if you have import all the Dependencies in your workSpace.maybe you can:projetc-->build all.
I meet the problem,and it works well

Categories

Resources