打包編譯錯誤訊息
Unsupported major.minor version 52.0
JRE與JDK版本不相容解決方法
先確認版本
java -version
J2SE 8 = 52
J2SE 7 = 51
J2SE 6.0 = 50
J2SE 5.0 = 49
JDK 1.4 = 48
JDK 1.3 = 47
JDK 1.2 = 46
JDK 1.1 = 45
Error:Execution failed for task 'preDexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command finished with non-zero exit value 1
1.檢查用到的 jar libs 內 是不是有重復到的元件
2.檢查做jar時的拫是不是夠高
3.檢查做jar時的jdk是不是太高
SyntaxError: Attempted to redefine property 'key'
重複定key,找出程式重複定義的地方,可能是標籤或初始變數
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES
手機裡面有的版本與正要安裝的版本有衝突,可能是開發版與正式版的問題或是appid命名相同了
RESOLVING ERROR COULD NOT FIND PROPERTY ‘MYAPP_RELEASE_STORE_FILE’
打開編輯 ~/.gradle/gradle.properties 輸入以下內容,名稱與密碼改為現在使用的
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
找不到 ANDROID_HOME 這個變數,所以就要幫他設定,看的android sdk 的位置在那裡,就設定那個位置
export ANDROID_HOME="~/Library/Android/sdk"
com.android.builder.testing.api.DeviceException: No online devices found.
找不到實際手機裝置,確定有接裝置,或裝置是否有同意debug,可以執行
adb devices # 查看是否有抓到裝置
react-native-fbsdk 打包錯誤
Execution failed for task ':react-native-fbsdk:processReleaseResources'
X:\app\node_modules\react-native-fbsdk\android\build\intermediates\res\merged\release\values-v24\values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
X:\app\node_modules\react-native-fbsdk\android\build\intermediates\res\merged\release\values-v24\values-v24.xml:4: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
X:\app\node_modules\react-native-fbsdk\android\build\intermediates\res\merged\release\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
X:\app\node_modules\react-native-fbsdk\android\build\intermediates\res\merged\release\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
facebook sdk 與 react native 版本有落差,沒有找到 linkview, 先安裝 0.5.0的 fbsdk
將 react-native-fbsdk 的 node_modules/react-native-fbsdk/build.gradle
compile('com.facebook.android:facebook-android-sdk:4.+')
改
compile('com.facebook.android:facebook-android-sdk:4.22.1')
就可以用了
或是 android/build.gradle file
allprojects {
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
details.useVersion "0.37.0" // Your real React Native version here
}
}
force 'com.facebook.android:facebook-android-sdk:4.22.1'
}
}
}