Eclipse Android Error with appcompat_v7 values-14 and values-11 - java

Im trying to see if I can get my Android App running with API 8. I've changed the build target for the project to 2.2 and I've changed the java compiler to 1.6. In problems I'm getting an error where R cant be resolved (I've checked to make sure my files don't contain import android.R) and in the console I'm getting a lot of red text that says:
[2015-08-02 16:12:13 - my app] /home/myname/workspace/appcompat_v7/res/values-v14/styles_base.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar'.
I wont paste the whole console but it goes on like that for almost everything in styles_base.xml and themes_base.xml for values-v14 and values-v11
The only suggestions I have found are to change to a higher build target but I want to see if I can make my program compatible with API 8
I dont know if it's relevant but, I've searched through my project and I'm not using Holo anything either as far as I can tell.

You can keep the minimum required SDK for a project to be API v8 and still set a higher build target. The error you quoted is related to the AppCompat library and not your project. You should have no problems setting a higher build target for the library.

Related

Android Studio Javadoc Generation error: cannot find symbol R

I am trying to generate javadocs for a larger android project - using android studios built-in "Tools > Generate JavaDoc". I have tried different scopes (my module, a custom scope containing only the java files I created, Project Files, ...) but everytime there is a class included which uses import com.my-app.R; or a generated class such as SomeFragmentBinding for ViewBinding, I get an
error: cannot find symbol from javadoc...
Apart from this problem the usual building and executing of the app is completely successful and works like a charm, although I get some some warnings regarding my database layout. Also I am using Hilt for Dependency Injection, but I don't really think that is related?
Now I am a complete noob using gradle and my attempts to configure the javadoc task myself have failed - and from what I have found online this should generally work out-of-the-box.

Why is Visual Studio trying to use the wrong JDK version?

I am trying to build WeatherApp, which comes from this tutorial, but I am seeing this error:
The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_55\bin\javac.exe" is invalid.
and this warning (not sure if they are related):
Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Runtime" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding>
I can doube-click the warning to make it go away, but the error remains. I am not sure why the project is trying to use that version of the jdk, as I have changed my xamarin optioins to point at Program Files instead:
Why is Visual Studio trying to use that versioin of the JDK?
Sometimes there's a sdk.caches file that will hold an old reference. Please try to delete both your obj/bin folders and see if that resolves the issue. If it doesn't, turn up your Build Output verbosity and attach a Build Output Log to your post:
https://forums.xamarin.com/discussion/27515/how-to-obtain-diagnostic-build-logs (XS)
http://blogs.msdn.com/b/msbuild/archive/2005/09/29/475157.aspx (VS)

"Unsupported flags DT_FLAGS_1=0x9" error on android gomobile

What I got going on in the project is a Cordova project that uses gradle to build. I created an android plugin that calls the Go script in the form of an .aar. All works with the simple hello world.go .aar. So I know that everything works. But adding in the selphyprint.aar it crashes with "Unsupported flags DT_FLAGS_1=0x9" error in adb logcat.
It's up at https://github.com/pbdesign/selphy. The full project is at https://github.com/pbdesign/printproject with an installable apk in the android folder of the com.photobooth project directory.
If you have any ideas, I found some similar error messages that are connected to android linker but don't know if they are related. Also any ideas on how to debug such an error would be appreciated.
This is not an actual full answer, but as a hint, DT_FLAGS_1 is a Binutils custom dynamic section entry (see the ELF standard).
These are produce by Binutils ld during link.
The 0x8 bit in particular is defined as:
#define DF_1_NODELETE 0x00000008
inside include/elf/common.h in Binutils 2.29.1.
I would then try to determine from Binutils source / docs what DF_1_NODELETE does to understand what is happening.
That flag is also mentioned at: glibc : Test if lib as DF_1_NODELETE flag or if lib has unique symbol

GoogleApiClient not resolving in Android Eclipse

I am getting this error
"GoogleApiClient cannot be resolved to a type"
when attempting to build a new api client. I have followed the directions to the tee from this site: https://developers.google.com/places/android/start , and I believe I have done everything else necessary as far as setting up the build target to Google APIs + Android 5.1.1.
I think I have down to this error I get from the console :
invalid resource directory name: C: ... JavaWorkspace\google-play- services_lib\res values-ne-rNP (1)
because that file does not exist in that location, but I am not sure how to resolve that.
Thanks!
Found the problem, and a work around, not an actual solution though. For some reason eclipse would add a space in between res and values: C: ... JavaWorkspace\google-play- services_lib\res values-ne-rNP. I think because it was in Google Drive. So I switched my workspace and it fixed itself.

Using JRuby in Android Studio

I'm trying to use JRuby in projects created in Android studio. I have built the latest (as of 9/10/2014) JRuby, and have completely updated Android Studio. I have a working app that I can use to test. I have a copy of jruby.jar in the MyApp/app/libs directory. Once there I right-clicked on jruby.jar and selected "Add as Library", which presumably did something (though what I am not certain), and have added the line "compile files('libs/jruby.jar')" to the build.gradle that is in MyApp/app/.
In one of the class files I have "import org.jruby.embed.ScriptingContainer;", which Android Studio says is fine (if I hadn't added jruby.jar as a library I couldn't include this without an error). Then in one of the working methods I say "ScriptingContainer container = new ScriptingContainer();". When I run this method the app will crash. I won't try to include the whole error message, but the important part seems to be:
Caused by: java.lang.ExceptionInInitializerError
at org.jruby.embed.internal.AbstractLocalContextProvider.<init>(AbstractLocalContextProvider.java:42)
at org.jruby.embed.internal.SingletonLocalContextProvider.<init>(SingletonLocalContextProvider.java:88)
at org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:248)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:228)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:185)
and
Caused by: java.lang.RuntimeException: unsupported Java version: 0.9
at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1858)
at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1608)
At least, those are the parts that make sense to me. I hav no idea why I would get the error "java.lang.RuntimeException: unsupported Java version: 0.9", since I am using 1.8.0_20. The rest of the errors I cannot follow. When I click on any of the files giving me an error (say AbstractLocalContextProvider.java:42) Android Studio will show the file but also say "Sources not found". That could be the problem, but I don't know why it can't find the sources.
Thanks for any help,
Brian
Uwe Kubosch (‏#donv70) was able to tell me the solution to this via Twitter, so credit to him, but I wanted to post the solution here in case anyone else needs it.
It was Java version that was causing the problem. In Ruboto the problem is solved here: https://github.com/ruboto/ruboto/blob/master/assets/src/org/ruboto/JRubyAdapter.java#L137
and for use in Android Studio it is necessary only to include the line: System.setProperty("jruby.bytecode.version", "1.6");
The number of course can be 1.6, 1.7, or 1.8, depending on your version of Java.
Looks like an interoperability problem between JRuby and the Dalvik VM (don't forget that you're running against Dalvik, not the Java VM).
There's a bug report at http://jira.codehaus.org/browse/JRUBY-5774 that may lead you in the right direction.
It's kind of old, and is marked 'fixed', but maybe it'll provide some clues?

Categories