android支持库添加问题
Posted
技术标签:
【中文标题】android支持库添加问题【英文标题】:android support library addition issue 【发布时间】:2018-09-03 12:38:55 【问题描述】:<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.first.densgi"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="27" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
上面是manifest.xml 下面是主要活动类的副本。
package com.first.densgi;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends ActionBarActivity
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@Override
public boolean onCreateOptionsMenu(Menu menu)
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
@Override
public boolean onOptionsItemSelected(MenuItem item)
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings)
return true;
return super.onOptionsItemSelected(item);
我还附上了1个截图和一个日志,截图是查看应用程序中的所有项目文件夹和日志以捕获尝试通过android工具添加支持库时的错误消息。一个回复提到将 support-v4.jar 添加到我的 lib 文件夹中。那么从截图中你会发现eclipse没有创建那个文件夹。
Image, Android API 24, revision 19
[2018-03-26 11:45:20 - SDK Manager] Found Google Play Intel x86 Atom System Image, Android API 25, revision 9
[2018-03-26 11:45:20 - SDK Manager] Found Google Play Intel x86 Atom System Image, Android API 26, revision 7
[2018-03-26 11:45:20 - SDK Manager] Found Google Play Intel x86 Atom System Image, Android API 27, revision 3
[2018-03-26 11:45:20 - SDK Manager] Found Google Play Intel x86 Atom System Image, Android API P, revision 1
[2018-03-26 11:45:20 - SDK Manager] Done loading packages.
[2018-03-26 11:45:20 - Android Support Jar not found:] C:\Users\Uchenna\Desktop\v4\android-support-v4.jar
view of screen shot of project files
大多数建议我有使用 android studio 的在线建议,但只是安装了 eclipse,并希望我的所有开发(即 se、ee、web 和移动设备)都在一个环境中。
如果我第一次在这个平台上提出问题,没有人尝试回答,我感到非常难过。
我仍然面临上述问题,我已将 eclipse 更新到oxygen3.a,现在我还有一个无法安装 jboss 和 wildfly 服务器的问题。给出一个未处理的事件循环异常
【问题讨论】:
用正确的问题和正确的格式编辑您的问题,并使用导致问题的足够代码 sn-p。 【参考方案1】:不是因为SDK位置错误。
将特定库放在你的android项目文件夹内的libs文件夹中。
在 Eclipse 的 android 项目中打开您的应用级 build.gradle 文件并添加库来编译它。 前任;编译'com.ajts.androidmads.SQLite2Excel:library:1.0.2'
然后同步eclipse项目。
【讨论】:
以上是关于android支持库添加问题的主要内容,如果未能解决你的问题,请参考以下文章
如何将页脚添加到 NavigationView - Android 支持设计库?