I was following this tutorial https://facebook.github.io/react-native/docs/getting-started.html, but when i build the project using this command: react-native run-android, i got this message
Starting JS server... Running
/home/nakama/Android/Sdk/platform-tools/adb -s 915fdc90 reverse
tcp:8081 tcp:8081 adb server version (32) doesn't match this client
(36); killing...
* daemon started successfully * Building and installing the app on the device (cd android && ./gradlew installDebug... :app:preBuild
UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee0110Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore0110Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp30110Library
UP-TO-DATE :app:prepareComFacebookReactReactNative0350Library
UP-TO-DATE :app:prepareComFacebookSoloaderSoloader010Library
UP-TO-DATE :app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig
UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets
UP-TO-DATE :app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE :app:mergeDebugResources
UP-TO-DATE :app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE :app:processDebugResources
UP-TO-DATE :app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE :app:compileDebugJavaWithJavac
UP-TO-DATE :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources
UP-TO-DATE :app:preDexDebug UP-TO-DATE :app:dexDebug UP-TO-DATE
:app:validateDebugSigning :app:packageDebug UP-TO-DATE
:app:zipalignDebug UP-TO-DATE :app:assembleDebug UP-TO-DATE
:app:installDebug Installing APK 'app-debug.apk' on 'Mi 4i - 5.0.2'
Installed on 1 device.
BUILD SUCCESSFUL
Total time: 20.971 secs
This build could be faster, please consider using the Gradle Daemon:
http://gradle.org/docs/2.4/userguide/gradle_daemon.html Starting the
app (/home/nakama/Android/Sdk/platform-tools/adb shell am start -n
com.awesomeproject/.MainActivity... adb server version (32) doesn't
match this client (36); killing...
* daemon started successfully * Starting: Intent { cmp=com.awesomeproject/.MainActivity }
and the result is my apps always shows blank screen. I did not change any single javascript code on those project, what is the root caused which makes my apps always give me a blank screen ?
Please set your ip address in developer menu of react native. Follow this link
Running on android device. to run on android device.
When you using this command: 'react-native run-android'. You should use press 'R' twice times or Ctrl + M (open option menu and choose reload) to reload screen and see result. I recommend use Genymotion for android emulator.
Cheer! =))
Related
I'm trying to run the init react-native project, and for some reason I get a 500 error.
here is the console log
Danny#DESKTOP-GIRS9GM /cygdrive/c/Users/Danny/Desktop/TestProject
$ react-native run-android
Scanning 557 folders for symlinks in C:\Users\Danny\Desktop\TestProject\node_modules (29ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee101Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore101Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco101Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0471Library UP-TO-DATE
:app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateSigningDebug
:app:packageDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:installDebug
Installing APK 'app-debug.apk' on 'Nexus_5X_API_26(AVD) - 8.0.0' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL
Total time: 15.967 secs
Running C:\Users\Danny\AppData\Local\Android\sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
Starting the app on emulator-5554 (C:\Users\Danny\AppData\Local\Android\sdk/platform-tools/adb -s emulator-5554 shell am start -n com.testproject/com.testproject.MainActivity)...
but on the device I'm getting this error(on a red screen),
The development server returned response error code: 500
URL: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false
Body:
{"message":"TransformError: C:\\Users\\Danny\\Desktop\\TestProject\\index.android.js: Unexpected token ) (While processing preset: \"C:\\\\Users\\\\Danny\\\\Desktop\\\\TestProject\\\\node_modules\\\\babel-preset-react-native\\\\index.js\")","type":"TransformError","lineNumber":0,"description":"","errors":[{"description":"","lineNumber":0}]}
processBundleResult
BundleDownloader.java:170
access$100
BundleDownloader.java:39
onResponse
BundleDownloader.java:139
execute
RealCall.java:135
run
NamedRunnable.java:32
runWorker
ThreadPoolExecutor.java:1162
run
ThreadPoolExecutor.java:636
run
Thread.java:764
and this is the message from the window that gets open (when i run react-native run-android)
error: bundling failed: "TransformError: C:\\Users\\Danny\\Desktop\\TestProject\\index.android.js: Unexpected token ) (While processing preset: \"C:\\\\Users\\\\Danny\\\\Desktop\\\\TestProject\\\\node_modules\\\\babel-preset-react-native\\\\index.js\")"
I dont get it, how come the init project of react-native comes with errors ? or I'm doing something wrong ? im not sure anymore, thanks!
I think you are using a new version of babel-preset-react-native library and there is an unsupported trailing commas on that new version.
You can install the previous version of the library:
npm uninstall babel-preset-react-native
npm install babel-preset-react-native#2.1.0
Edit - you can see the problem on playframework repository: issue#15513
I have a meteor app that I want to test on my android device. The problem is that 95% of the time the app hangs at "Starting app on android device".
Logs:
Running Cordova app for platform Android with options --device
ANDROID_HOME=/home/john/Android/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
I20161214-11:04:25.063(2)? Kadira: completed instrumenting the app
I20161214-11:04:25.410(2) (percolate_migrations.js:106) Migrations: Not migrating, already at version 2
=> Started your app.
=> App running at: http://localhost:3000/
I20161214-11:04:25.965(2)? Kadira: successfully authenticated
nulltarting app on Android Device -
embeddeding app on Android Device -
org.xwalk:xwalk_core_library:17+e /
Incremental java compilation is an incubating feature.
UP-TO-DATE app on Android Device -
:preBuild UP-TO-DATE
:preArmv7DebugBuild UP-TO-DATE
:checkArmv7DebugManifest
:preX86DebugBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
UP-TO-DATE app on Android Device -
UP-TO-DATE app on Android Device -
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies -
UP-TO-DATE app on Android Device \
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
UP-TO-DATEg app on Android Device \
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE \
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
UP-TO-DATE app on Android Device \
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
UP-TO-DATE app on Android Device |ncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
UP-TO-DATE app on Android Device |bsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:preArmv7ReleaseBuild UP-TO-DATE
:preX86ReleaseBuild UP-TO-DATEice |
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest
Starting app on Android Device |
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
UP-TO-DATE:packageReleaseResources Starting app on Android Device |
:CordovaLib:compileReleaseAidl UP-TO-DATE
UP-TO-DATE app on Android Device /
:CordovaLib:mergeReleaseShaders UP-TO-DATE
:CordovaLib:compileReleaseShaders UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
UP-TO-DATE app on Android Device /
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
UP-TO-DATE app on Android Device /
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
UP-TO-DATEAndroidSupportSupportCompat2501Library
UP-TO-DATEAndroidSupportSupportCoreUi2501Library Starting app on Android Device /
:prepareComAndroidSupportSupportCoreUtils2501Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2501Library UP-TO-DATE
UP-TO-DATE app on Android Device -1Library
:prepareComAndroidSupportSupportV42501Library UP-TO-DATE
UP-TO-DATE app on Android Device -rary
:prepareArmv7DebugDependencies
:compileArmv7DebugAidl UP-TO-DATE
UP-TO-DATE app on Android Device -
UP-TO-DATE app on Android Device \
:mergeArmv7DebugShaders UP-TO-DATE
:compileArmv7DebugShaders UP-TO-DATE
:generateArmv7DebugAssets UP-TO-DATE
:mergeArmv7DebugAssets UP-TO-DATE
Starting app on Android Device \
:generateArmv7DebugResValues UP-TO-DATE
UP-TO-DATE app on Android Device \
UP-TO-DATE app on Android Device \
:processArmv7DebugManifest UP-TO-DATE
:processArmv7DebugResources UP-TO-DATE
:generateArmv7DebugSources UP-TO-DATE \
:incrementalArmv7DebugJavaCompilationSafeguard UP-TO-DATE
UP-TO-DATE app on Android Device |
:compileArmv7DebugNdk UP-TO-DATE
:compileArmv7DebugSources UP-TO-DATE
:prePackageMarkerForArmv7Debug
UP-TO-DATE app on Android Device |
:mergeArmv7DebugJniLibFolders UP-TO-DATE
UP-TO-DATE app on Android Device |ebug
:processArmv7DebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForArmv7Debug UP-TO-DATE
:validateDebugSigning
:packageArmv7Debug UP-TO-DATE
UP-TO-DATE app on Android Device |
:assembleArmv7Debug UP-TO-DATE
:cdvBuildDebug UP-TO-DATE
BUILD SUCCESSFUL
Total time: 17.072 secs
Built the following apk(s): evice |
/home/john/WebApps/agily-app/services/web/.meteor/local/cordova-build/platforms/android/build/outputs/apk/android-armv7-debug.apk
Using apk: /home/john/WebApps/agily-app/services/web/.meteor/local/cordova-build/platforms/android/build/outputs/apk/android-armv7-debug.apk
Package name: com.idkid0bbrlatmhkpu0ii
Starting app on Android Device \
I have tried different solutions: reset meteor, reconnect device, restarted adb, updated adb, updated gradle.
Has anyone had this problem and is there a solution?
Thanks!
Currently i am trying to run a sample application "Hello Gimbal Android" using Android Studio 1.3 (updated 28 july 2015)
After follow step by step from tutorial :
Clone sample application from github.
Import project in Android Studio
Fill in the API key in MainActivity file.
Add the jars from the Gimbal SDK libs directory to the project libs directory
Last step is build the project (using Build -> Make Project)
It is successfully built as shown in grandle console but after that i search it cant find the .apk file.
Anyone has this experience before? Any clue?
Executing tasks: [:app:compileDebugSources, :app:compileDebugAndroidTestSources]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72200Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42200Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:compileDebugAndroidTestJava
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:compileDebugAndroidTestSources
BUILD SUCCESSFUL
Total time: 5.7 secs
Note :
I use ubuntu 14.04, have downloaded the Android SDK and also have configured the PATH.
When you just build, you don't get an apk.
For an unsigned apk you need to either
- Run the app (Run > Run "YourProject")
- Execute assemble Task from Gradle panel (present in right hand side of the
Studio window) or from the embedded terminal window on bottom (in project Root)
Then the apk is in $YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk
For a signed apk, use Build -> Generate Signed APK
If you look in the Gradle Console Rebuild Project will say something like...:
See here. Perhaps help you...
I am trying android studio for the first time.
I have connected external android device via USB (debugging device settings are done in android device). I click on run button with selection as USB device.
The Run console shows this
Waiting for device.
Target device: iball-3g_q1035-0123456789ABCDEF
Whereas my gradle console shows this
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72200Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42200Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug UP-TO-DATE
:app:zipalignDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
BUILD SUCCESSFUL
Total time: 1.292 secs
But my application does not start on the device. Can somebody please let me know where i am doing mistake?(ps : application works perfectly on the eclipse)
I have an issue and despite of a lot of googling, i couldn't find any informations about it.
So I have Windows 7 and had Android Studio 1.1 RC Beta and after modifying my code regarding work with a database i got failure install_failed_dexopt
I tried to clean and then to rebuild my project and since that moment Gradle Executing Tasks never finishes if i run my project. I saw into the Gradle logs and here it is
Executing tasks:
[:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72102Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42102Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug
I waited ~30 minutes and nothing after that.
If i try to stop it, it also never stops, i see only
Stopping - Gradle: Executing Tasks[:app:assembleDebug]
and nothing else
I tried to unistall Android Studio, installed also 1.0.1, I tried to run "hello world" application - is always the same. It would be great if someone have any idea about it, thank you!
So it seemed to be a problem with sdk. At first I didn't notice, that even if I install Android Studio and sdk into another folder path to sdk was always the same and it was something wrong with that sdk directorie.