我在Android2.33中创建了应用程序。我使用了APKV2键,并且我遵循了所有的步骤,但是它仍然显示错误
**xml**
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
**Mainfest**
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Maps.mappv2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="com.Maps.mappv2.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.Maps.mappv2.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.
permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter >
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="mm" />
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA64MFhpngQBkXP5__fvHeLE0xAXWKwfgU"/>
</application>
</manifest>
**Activity**
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
我包括了google-play-services jar库文件,但它仍然显示未预期停止...
**The error are**
12-22 20:51:59.344: E/Trace(698): error opening trace file: No such file or directory (2)
12-22 20:52:00.165: E/AndroidRuntime(698): FATAL EXCEPTION: main
12-22 20:52:00.165: E/AndroidRuntime(698): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
12-22 20:52:00.165: E/AndroidRuntime(698): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.Activity.onCreateView(Activity.java:4663)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.Activity.setContentView(Activity.java:1867)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.Maps.mappv2.MainActivity.onCreate(MainActivity.java:13)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.Activity.performCreate(Activity.java:5008)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.os.Handler.dispatchMessage(Handler.java:99)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.os.Looper.loop(Looper.java:137)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-22 20:52:00.165: E/AndroidRuntime(698): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 20:52:00.165: E/AndroidRuntime(698): at java.lang.reflect.Method.invoke(Method.java:511)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-22 20:52:00.165: E/AndroidRuntime(698): at dalvik.system.NativeStart.main(Native Method)
12-22 20:52:39.734: E/Trace(724): error opening trace file: No such file or directory (2)
12-22 20:52:40.244: E/AndroidRuntime(724): FATAL EXCEPTION: main
12-22 20:52:40.244: E/AndroidRuntime(724): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
12-22 20:52:40.244: E/AndroidRuntime(724): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.Activity.onCreateView(Activity.java:4663)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.Activity.setContentView(Activity.java:1867)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.Maps.mappv2.MainActivity.onCreate(MainActivity.java:13)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.Activity.performCreate(Activity.java:5008)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.os.Handler.dispatchMessage(Handler.java:99)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.os.Looper.loop(Looper.java:137)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-22 20:52:40.244: E/AndroidRuntime(724): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 20:52:40.244: E/AndroidRuntime(724): at java.lang.reflect.Method.invoke(Method.java:511)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-22 20:52:40.244: E/AndroidRuntime(724): at dalvik.system.NativeStart.main(Native Method)
12-22 20:52:49.084: E/Trace(738): error opening trace file: No such file or directory (2)
12-22 20:52:49.624: E/AndroidRuntime(738): FATAL EXCEPTION: main
12-22 20:52:49.624: E/AndroidRuntime(738): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
12-22 20:52:49.624: E/AndroidRuntime(738): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.Activity.onCreateView(Activity.java:4663)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.Activity.setContentView(Activity.java:1867)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.Maps.mappv2.MainActivity.onCreate(MainActivity.java:13)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.Activity.performCreate(Activity.java:5008)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.os.Handler.dispatchMessage(Handler.java:99)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.os.Looper.loop(Looper.java:137)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-22 20:52:49.624: E/AndroidRuntime(738): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 20:52:49.624: E/AndroidRuntime(738): at java.lang.reflect.Method.invoke(Method.java:511)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-22 20:52:49.624: E/AndroidRuntime(738): at dalvik.system.NativeStart.main(Native Method)
首先尝试清洁构建库项目和普通项目。未工作请检查以下内容:
我包含了google-play-services jar库文件
你不必包括罐子。您必须导入为android库项目。
本文向大家介绍Android如何在原生App中嵌入Flutter,包括了Android如何在原生App中嵌入Flutter的使用技巧和注意事项,需要的朋友参考一下 本文参考文档Add Flutter to existing apps。 首先有一个可以运行的原生项目 第一步:新建Flutter module Terminal进入到项目根目录,执行flutter create -t module ‘m
做这件事最轻的方法是什么。使用像反应艺术这样的东西对我试图做的事情来说是过度的。
我正在编写一个小闹钟程序,当闹钟时间到了时,它会播放一个音频文件几次。 程序的报警部分已经完成。现在我开始播放文件。我使用jFileChooser来选择文件。javax . sound . sampled . audio inputstream、javax . sound . sampled . audio system和javax.sound.sampled.Clip来播放我的wav文件。也在工
所以我有下面的问题。我收到一个文件,其中包含一组字体。这些字体没有嵌入到文件中。下面是一个简单的例子: 我希望将这些字体嵌入到中,这样它们就可以自包含并且始终可用。但事情似乎没那么简单。我正在使用进行处理。 我已经阅读并尝试了以下问题/答案: null
问题内容: 我有一个自定义字体,我想在Java程序中炫耀它,用户无需安装就可以查看它。有谁知道这是怎么做到的吗? 工作解决方案 我已经实现了以下内容: 问题答案: 我从未做过,但似乎您想要的方法是 导入字体 或者 该参数是或,而或参数包含字体的二进制数据。 导入后使用字体: 要使Font对Font构造函数可用,必须通过调用在中注册返回的Font 。
问题内容: 我需要在Tomcat中启动Hazelcast,而无需单独的war文件。因此,将hazelcast.jar放入lib文件夹中的hazelczast.xml某处…接下来呢?还是不可能? 问题答案: 第一步是好的,只需将Hazelcast lib和配置放在Tomcat的libs文件夹中。接下来,如果您不需要单独的WAR文件,则是构建一个小的Valve类来启动/关闭Hazelcast节点。问题