我开发了Android应用程序但是我面临的问题是我的应用程序在除5.0及更高版本之外的所有版本中都正常运行。我从很多天开始搜索解决方案,但仍然没有得到答案,我已经应用了很多方法
gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.vs.vertosys"
minSdkVersion 14
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter() {}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:multidex:1.0.1'
// compile 'com.android.support:appcompat-v4:23.1.1'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:+'
compile 'com.pushwoosh:pushwoosh:+'
}
清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vs.vertosys" >
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<permission
android:name="com.vs.vertosys.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.vs.vertosys.permission.C2D_MESSAGE" />
<application
android:name=".PushActivity"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".DesignActivity"
android:screenOrientation="portrait"/>
<activity
android:name=".WebViewActivity"
android:screenOrientation="portrait"/>
<activity android:name=".FragmentActivity"
android:screenOrientation="portrait"/>
<activity android:name=".DeepLinkActivity"/>
<meta-data android:name="PW_APPID" android:value="BAA2E-9B159" />
<meta-data android:name="PW_PROJECT_ID" android:value="A610486581713" />
<activity android:name="com.pushwoosh.richpages.RichPageActivity" />
<activity android:name="com.pushwoosh.MessageActivity" />
<activity android:name="com.pushwoosh.PushHandlerActivity" />
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.vs.vertosys" />
</intent-filter>
</receiver>
<service
android:name="com.pushwoosh.GCMListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service
android:name="com.pushwoosh.GCMInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service
android:name="com.pushwoosh.GCMRegistrationService"
android:exported="false">
</service>
<receiver android:name="com.pushwoosh.local.AlarmReceiver" />
</application>
</manifest>
Log cat:
03-01 16:09:25.073 705-774/? E/Sensors: new acc setDelay handle(7),ns(200000000) err! go to hwmsen
03-01 16:09:33.625 20238-20238/? E/Zygote: Zygote: error closing descriptor
03-01 16:09:33.625 20238-20238/? E/Zygote: libcore.io.ErrnoException: close failed: EBADF (Bad file number)
03-01 16:09:33.625 20238-20238/? E/Zygote: at libcore.io.Posix.close(Native Method)
03-01 16:09:33.625 20238-20238/? E/Zygote: at libcore.io.BlockGuardOs.close(BlockGuardOs.java:75)
03-01 16:09:33.625 20238-20238/? E/Zygote: at com.android.internal.os.ZygoteInit.closeServerSocket(ZygoteInit.java:221)
03-01 16:09:33.625 20238-20238/? E/Zygote: at com.android.internal.os.ZygoteConnection.handleChildProc(ZygoteConnection.java:879)
03-01 16:09:33.625 20238-20238/? E/Zygote: at com.android.internal.os.ZygoteConnection.runOnce(ZygoteConnection.java:242)
03-01 16:09:33.625 20238-20238/? E/Zygote: at com.android.internal.os.ZygoteInit.runSelectLoop(ZygoteInit.java:715)
03-01 16:09:33.625 20238-20238/? E/Zygote: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
03-01 16:09:33.625 20238-20238/? E/Zygote: at dalvik.system.NativeStart.main(Native Method)
03-01 16:09:33.982 20238-20238/? E/kris: false
03-01 16:09:33.982 20238-20238/? E/kris: true
03-01 16:09:33.983 20238-20238/? E/kris11111: false
03-01 16:09:33.986 20238-20238/? E/kris2222: false
03-01 16:09:33.989 20238-20238/? E/kris2222: false
03-01 16:09:34.137 20238-20238/? E/ffi_jank: timespan = 44.640076
03-01 16:09:35.648 705-715/? E/Sensors: new acc setDelay handle(0),ns(1000000) err! go to hwmsen
03-01 16:09:36.097 705-767/? E/Sensors: new acc setDelay handle(0),ns(1000000) err! go to hwmsen
03-01 16:09:39.056 794-794/? E/ffi_jank: timespan = 23.815077
03-01 16:10:00.034 944-944/? E/MyTag: updateClock : 4:10
03-01 16:10:00.068 944-944/? E/MyTag: updateClock : 4:10 PM
03-01 16:10:00.093 944-944/? E/MyTag: updateClock : 4:10 PM
03-01 16:10:00.134 1232-1232/? E/ActionIcon: time changed: time = 20160301T161000Asia/Calcutta(2,60,19800,0,1456828800)
03-01 16:10:00.147 20238-20238/? E/kris2222: false
03-01 16:10:00.153 794-794/? E/ffi_jank: timespan = 83.53192
03-01 16:10:00.203 794-794/? E/ffi_jank: timespan = 24.309769
03-01 16:10:00.216 20238-20238/? E/ffi_jank: timespan = 43.211075